#mobileengagement
1 messages · Page 1 of 1 (latest)
Is the Subscription created and active as expected?
Currently I have to manually set the card as default, then yes I can create the subscription without issue. So I am missing the middle step of making the payment card added the default payment
I manually set the card in the dashboard
Ah, so you need an API solution for setting the card as the default payment method?
yes please
There are 2 ways to set the default PM: (1) the invoice settings of the Customer (https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), or (2) the default_payment_method of that specific Subscription (https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Option 1 update the customers. Can you kindly confirm my syntax on the php curl command. I have read this article already. Is it d "invoice_settings.default_payment_method"="pm_1xxxxxxxxxx"? Thanks. If so is that it job done?
please ignore last
$stripe = new \Stripe\StripeClient(
'sk_test_xxxxxxxxx'
);
$stripe->customers->update(
'cus_xxxxxx',
['invoice_settings' => ['default_payment_method' => 'pm_1xxxxxxx']]
);
Is this right?
yup! Looks right to me and runs in my console just fine