3/ Send them to the hosted page for this newly created subscription to set up their payment method.
Get_student_name = Add_a_Student[ID == input.Student_Name];
Full_Name = Get_student_name.Student_Name.first_name + " " + Get_student_name.Student_Name.last_name;
//create plan
values = Map();
values.put("plan_code",input.Student_Name);
values.put("name",Full_Name);
values.put("recurring_price",input.Amount_per_Payment);
values.put("interval",input.interval);
values.put("interval_unit",input.interval_unit);
values.put("billing_cycles",input.Number_of_Payments);
values.put("setup_fee",input.Enrolment_Fee);
values.put("product_id","64299000000009107");
response = zoho.subscriptions.create("Plans","7001477462",values,"create_subscription_plan");
info response;
//create subscritption
organizationID = "7001477462";
plan = Map();
plan.put("plan_code",input.Student_Name);
customer = Map();
customer.put("display_name",Full_Name);
customer.put("first_name",Get_student_name.Student_Name.first_name);
customer.put("last_name",Get_student_name.Student_Name.last_name);
customer.put("email",input.Email);
payload = Map();
payload.put("plan",plan);
payload.put("customer",customer);
info payload;
response = invokeurl
[
type :POST
parameters:payload.toString()
connection:"create_subscriptions_subsrcription_hostedpage"
];
info response;
url = response.getJSON("hostedpage").getJSON("url");
info url;
openurl(url,"same window");