I need help with the paid plans api. I do have the standard paid plans page that was automatically generated but I would like to design a more mobile friendly paid plans page and individually plan page for each service and for my buy now button to start the direct purchase for that selected paid plan using the purchasePlan() function.
I am new to the Corvid coding so bare with me. I’ve tried the purchasePlan() function for one of my service pages and the button does request to have me sign in or sign up but once logged in and I select the same buy now button nothing happens.
Do I need to customize this code from the corvid reference or add anything to the backend?
I did change the Get the plan ID for a non-free plan with my plan ID and export function id. Any help would be greatly appreciated.
mport wixPaidPlans from ‘wix-paid-plans’;
import wixPay from ‘wix-paid-plans’;
let planId = // 7a00f46f-333d-47fd-b397-8e545ab6bfce
$w.onReady( function () {
//TODO: write your page related code here…
});
export function button3_click(event) {
wixPaidPlans.purchasePlan(planId)
.then( (myPurchase) => {
let myOrderId = myPurchase.orderId;
let myWixPayOrderId = myPurchase.wixPayOrderId;
let myWixPayStatus = myPurchase.wixPayStatus;
} );
}
/* myPurchase:
- {
- “orderId”: "b3fb3a4d-c223-4040-8bc3-8dfdefb1bafc",
- “wixPayOrderId”: "06af8fd6-6c82-4b51-bc08-0b556aad6f4f",
- “wixPayStatus”: "Successful"
- }
*/