I'm using react-native-stripe-id to connect to Stripe from a react-native app. I create a token from a card, then a customer, and then a subscription for them with:
...
.then(card => {
return stripeClient.createToken(card.cardNumber, card.expiryMonth, card.expiryYear, card.cvv);
})
.then(token => {
return stripeClient.createCustomer(token.id, user.email, user.uid, user.firstName, user.lastName);
})
.then(customer => {
return stripeClient.createSubscription(customer.id, "MyPlan");
})
.then(subscription => {
...
});
This seems to work perfectly.
From here, with a customer and subscription, how can I change or cancel their subscription?
Simply creating a new subscription to a new plan subscribes the customer to both plans and double charging them.
I can retrieve the customer's subscription with retrieveSubscription
, but don't know what I can do with that.