Start a new topic

How to create subscriptions without collecting credit card details?

Say you have a free trial plan you want your customers to try out. But you do not want them to enter their card information when they subscribe to the plan.


The hosted pages are used for collecting payment details, so at the moment it's not possible to skip collecting the payment details. 


So, how do you create a subscription for a plan that has a trial period or if the plan has a $0 plan price, without collecting the card details?


If you do not want to collect credit card information during sign up, you can build a form on your website to collect the customer's name and email address and create the trial subscription.


Before trying to create a subscription, make sure you have a plan configured with free trial days or plan price as $0.


Attached is a sample sign up page with the code to create subscriptions without a credit card. Similarly, you can build your own form.


In the attachment, if you browse to "trial_signup > chargebee_js > signup.html", you will see a code similar to what I've pasted below.





The changes you need to make for this sample sign up form to work(indicated with arrows above) are:


1. Your ChargeBee site name (only the sub-domain name).

2. A publishable API key. You can create one under Settings > API & Webhooks > API Keys > Add API Key.

3. Your trial plan ID. You will find this when you open your trial plan under "Product Catalog".


When creating a publishable API key, please ensure that you check the option "Use From Browser" as shown below:




And also select the option "Publishable API Key".


This way you could create a trial subscription or a subscription using a $0 plan without having to collect card information.


Note: When a trial subscription's trial period ends and is about to activate, if the card details are not present at that time, the subscription will be automatically canceled.


Hope this helps.

zip

how can I add address fields to this form?

Hello There,


If you are looking to also capture the customer address, the Trial Sign up form has to be edited to add the extra fields.


Assuming that you are looking to add a shipping address, we have created a sample form, that we also emailed you via the support ticket, that includes fields for the shipping address.


Please find the file attached. Do let us know if you have any further questions.


zip

Hi there. I am about to test this for a Soft launch. Do i need to upgrade any JS files in your example?

Hi Peter


You don't have to upgrade any JS; the given file will work as it is. The changes you need to make for this sample sign up form to work are:


1. Your ChargeBee site name (only the sub-domain name).

2. A publishable API key. You can create one under Settings > API & Webhooks > API Keys > Add API Key.

3. Your trial plan ID. You will find this when you open your trial plan under "Product Catalog".


1 person likes this

Hi again. I need to add the following variable to Chargebee from the signup form.


formParam['locale'] = en


But i cant seem to get it to work. Is it the correct way to do it?

HI i am trying to add the locale to the form



$("#subscribe-form").on('submit', function(e) {

// form validation

if (!$(this).valid()) {

return false;

}

$(".alert-danger").hide();

$('.subscribe_process').show();

// Disable the submit button to prevent repeated clicks and form submit

$('.submit-button').attr("disabled", "disabled");

//getting form param

var formParam = getFormParam($(this));

//passing customer[email] as customer[id] to avoid duplicate signup with same email id

formParam['customer[id]'] = formParam['customer[email]'];

//Adding plan code

formParam['plan_id'] = planName;

//Adding user locale

formParam['locale'] = "da";

// calling chargebee create subscription API

ChargeBee.subscription.create(formParam).request(apiResponseHandler);

return false;


But it does not work. ?

Hi Peter


The locale needs to be passed as customer[locale]. Could you try and let us know if it works at your end?





But is it not like this? formParam['locale'= "da";

Hi Peter


I see that you've replied to the forum response notification and it has been created as a new ticket (#58032). We'll check with our Engineers further and get back to you on the ticket.

Hi,


Very useful article. I understand that this method works for a free trial or $0 plan.

Is it possible to bypass the billing and credit card info for the paid plan with a coupon that brings the price to $0?


Please let me know.

Regards,

Paul



Hey Paul, 


When you provide a plan ID in the script, any subscriber to that plan will not be asked for card information irrespective of a coupon bringing the price to $0 or not. So customers trying to sign up for the paid plan even without a coupon will not be asked for card information.

Thanks for the assistance on this. Have most of my form working correctly (http://serendipityventures.co/trial-test/). Was told by Chargebee support to move to v2, but can't get it to work with v2. Have you redone or do I need to redo in v2?


The form will post, and submit products with quantities associated only;


- if BOTH product quantities are entered.

- I have tested and coded out all add-on and add-on quantity code and the post will occur and a Plan will be created.


Desired would be that they need at least add-on. Acceptable is no-add selected.


Desired is check box selection, and quantity selection. Acceptable is check box selected and “0” quantity


Guidance and assistance appreciated.


Frank


Hi Frank


I've created a ticket (#89209) for your last comment and we'll continue the discussion there.        

Login or Signup to post a comment