Telerik-Verified-Plugins/Stripe

Subscription issue

Closed this issue · 4 comments

stripe.subscriptions.create function is not working.

I am also having this subscription issues. DO you have any update ?

it seems, the same issue... Do you have any solution, please?

Hi! I'm glad to take a part in issues solving, because I found a lots of ready solutions earlier.
So: (sorry, it's just a copy of my own notes)

fix stripe.subscriptions.create bug: plugin used a wrong stripe api endpoint

first find your-app-name/plugins/com.telerik.stripe/www/subscriptions.js

and change Subscriptions.prototype.create to:

Subscriptions.prototype.create = function(arg, successCallback, errorCallback){
this.processRequest(["POST", "subscriptions", arg], successCallback, errorCallback);
}

for Android do the same thing twice:

for your-app-name/platforms/android/assets/www/plugins/com.telerik.stripe/www/subscriptions.js

and for your-app-name/platforms/android/platform_www/plugins/com.telerik.stripe/www/subscriptions.js

and call this method with params:

stripe.subscriptions.create(
{
customer: customer.id,
plan: plan.name
},
_onSuccessStripeSubscriptionCreate,
_onReject
)

This works for me.
Attention: take a look at your customer - he must have attached card before creating subscription

@ShepelE Thank you for your help!