I need to write a small code for my wordpress website.
I am hosting online video courses on a online hosting platform. Currently all the payments of the courses purchased by the users are handled by the course hosting platform. I want to handle the payment via my wordpress website. This is possible via coupons given by the hosting platform. I will generate bulk 100% discount coupons on my hosting platform. When someone purchases the course on my website I will send them the 100% off coupon and the user can register in hosting platform by entering the coupon code for 0 amount.
I want this to be automated. I want an interface where I can upload course-wise coupon code and the direct purchase link url. When a user makes successful payment, a coupon should be taken from this uploaded coupons lot and should be sent in email to the user automatically.
I should get an option to view coupons. Also I should be able to modify and remove unused coupons.
I am using avada theme and having woocommerce.