Paymill API: How do I update a subscription's credit card?

风格不统一 提交于 2019-12-22 09:44:43

问题


I can create subscriptions, but I can't figure out how to update a subscription so that it uses a new credit card.

This is what I've tried: (assuming there is already an existing client, payment and subscription)

  1. create token in ui
  2. create a payment object in server
  3. update client like this:

    paymill.clients.update(clientId, { payment: payment.id }, callback);

I get this error:

Error: Identifier,payment
Exception: Api_Exception_InvalidParameter

Which calls do I need to make to achieve this?


回答1:


Paymill has updated the api and you can now make this request which can be used to update cc details on a subscription.

First create a payment and then update the subscription with the new payment id.

curl -X PUT https://api.paymill.com/v2/subscriptions/<SubscriptionId> -u <ApiKey>: -d payment=<PaymentId>


来源:https://stackoverflow.com/questions/14909570/paymill-api-how-do-i-update-a-subscriptions-credit-card

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!