Paymill API: How do I renew my credit card for a subscription?
I can create subscriptions, but I cannot figure out how to renew the subscription so that it uses the new credit card.
This is what I tried: (assuming there is already a customer, payment and subscription)
- create token in ui
- create a payment object on the server
-
update the client like this:
paymill.clients.update(clientId, { payment: payment.id }, callback);
I am getting this error:
Error: Identifier,payment
Exception: Api_Exception_InvalidParameter
What challenges do I need to make to achieve this?
+3
source to share
1 answer
Paymill has updated the api and you can now make this request which can be used to update the cc details in the subscription.
First create a payment and then update your subscription with a new payment ID.
curl -X PUT https://api.paymill.com/v2/subscriptions/<SubscriptionId> -u <ApiKey>: -d payment=<PaymentId>
+3
source to share