#mobileengagement

1 messages · Page 1 of 1 (latest)

elder violetBOT
cerulean wigeon
#

Is the Subscription created and active as expected?

reef umbra
#

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

cerulean wigeon
#

Ah, so you need an API solution for setting the card as the default payment method?

reef umbra
#

yes please

cerulean wigeon
#

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)

reef umbra
#

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?

cerulean wigeon
#

yup! Looks right to me and runs in my console just fine