#bohdan_70704
1 messages · Page 1 of 1 (latest)
$params = [
'customer' => $customer_id,
'items' => [
[
'price' => $price_id,
],
],
'payment_behavior' => 'default_incomplete',
'collection_method' => 'charge_automatically',
'payment_settings' => [ 'save_default_payment_method' => 'on_subscription' ],
'expand' => [ 'latest_invoice.payment_intent', 'latest_invoice.charge.payment_method_details.card' ],
'metadata' => [
'site_url' => get_site_url(),
],
];
return Stripe_Client::get()->subscriptions->create(
$params,
[ 'stripe_account' => Stripe_Module::get_connected_stripe_account_id() ]
);
Hi there!
Hi!
Can you share the Subscription ID (sub_xxx)?
The latest one is sub_1NzFtUC1LluJiuYaCHWR9Vdj
but the same is for all previous subscriptions
Account is connected, in test mode, but I guess that client_secret should be received anyway..
Thanks! Give me a few minutes to look into this.
Thank you!
You can see the first Invoice generated for that Subscription is below $0.50: https://dashboard.stripe.com/test/subscriptions/sub_1NzFtUC1LluJiuYaCHWR9Vdj
And Stripe doesn't make payments smaller than $0.50, so it's expected to have no payment_intents.
In this case, you should retrieve the pending_setup_intent https://stripe.com/docs/api/subscriptions/object?lang=ruby#subscription_object-pending_setup_intent
And once the total for the customer goes about $0.50, they will be charged
Got it! Thank you!