This article also covers
How to close the checkout page when opened in a new tab?
What is the plan URL syntax that could be shared with my customers to checkout?
What is the syntax for access link to customer portal?
Note: If you are using PC 2.0, refer this article to create the checkout URL.
Solution
You can manually generate a plan-specific checkout URL and embed this on your website. On click, customers would be directly taken to a checkout page in a new tab where they would be able to enter their payment information.
Here’s the syntax for generating the plan-specific checkout page URL
your-domain.chargebee.com/hosted_pages/plans/plan_id
With the hosted page URL, you can pass additional customer and subscription information during sign up. These details need to be passed on to the hosted page URL while redirecting users to the hosted checkout page.
Here’s the syntax to specify plan quantity during sign up
your-domain.chargebee.com/hosted_pages/plans/plan_id?subscription[plan_quantity]=number
NOTE: This applies only for plans with unit-based pricing model (Stairstep, Volume, Tiered)
Here’s the syntax to include addon during signup
your-domain.chargebee.com/hosted_pages/plans/plan_id?addons[id][0]=addon_id&addons[quantity][0]=number
NOTE: "[quantity][0]=number" is optional and can be used for quantity based addons.
Adding multiple parameters
Account information, billing address & shipping address ‘First name’, ‘Last name’, and other customer details can be prefilled whereas Card information cannot be prefilled as it needs to be updated using the token from the payment gateway.
Please refer to this link to know more.
To pass multiple parameters (whether it is subscription ID, plan quantity, addons or coupons) to the plan specific hosted page URL when creating a subscription, use an "&" symbol to separate parameters.
To illustrate, here is a sample URL for creating a subscription that includes subscription ID, plan quantity, addon with quantity and a coupon with each parameter separated by an "&" symbol:
https://yoursitename.chargebee.com/hosted_pages/plans/ ?subscription[id]= &subscription[plan_quantity]=2&addons[id][0]= &addons[quantity][0]=2&subscription[coupon]=coupon-name
Sample URL with the first name
Completing the checkout process- Closing the session
Since the Checkout page is generated using a URL in a new tab, the only way to close the checkout page is by closing the browser tab.
If you have any questions regarding this, please reach out to us at support@chargebee.com.