#noahbundeling
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
payment methods have a pm_xxx IDs
what you're passing is the Setup Intent ID seti_xxx
Hey tarzan, thanks in advance for taking a look. Here's an example request: https://dashboard.stripe.com/test/logs/req_Ao947tsrMQt49X
And this is some code:
$session = CheckoutSession::create([
'customer' => Core::app()->user->getClient()->getSubscriptionCustomerId(),
'mode' => 'setup',
'success_url' => 'https://' . Core::app()->user->getClient()->getDomain() . '/subscription/overview' . ($started_subscription ? '?method_added=true' : ''),
'cancel_url' => 'https://' . Core::app()->user->getClient()->getDomain() . '/subscription/overview',
'payment_method_types' => $payment_method_types,
'currency' => $currency,
'locale' => 'en'
]);
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
you need to pass the setup_intent.payment_method https://stripe.com/docs/api/setup_intents/object#setup_intent_object-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.
So, we basically need to use a different way instead of using the checkoutsession system we have right now? Because this worked fine for just creditcard only.
When we use the CheckoutSession, you can choose between either iDEAL or creditcard (depending if you're in Holland or not - only in Holland iDEAL is available too). That automatically already creates a setupintent. Maybe I should just retrieve the webhook for setup_intent.succeeded and then connect that payment method to the customer?
I tried that at least too, but the setupintent object is already connected to the customer.
what you can do in the checkout.session.completed event, is to retrieve the Setup Intent (https://stripe.com/docs/api/setup_intents/retrieve) and then use the payment_method object on it to store as the invoice_settings.default_payment_method without having to attach it to the customer first, since it is going to be previously attached to the customer (from the checkout session)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I'm going to give it a try, thanks for your help.
let me know if you need any more help
Oh, I also do have some other question regarding iDEAL i.c.w. SEPA. Can I drop that one here as well or do you want that I create another thread for that?
yes please do it here
We also have a cron in place that checks for changes in the subscription items. If that cron finds any results, the following code is sent to Stripe:
$subscription_id,
array(
'payment_behavior' => 'pending_if_incomplete',
'proration_behavior' => 'create_prorations',
'items' => array(
$items
)
)
);```
Now, this doesn't seem to work with iDEAL (SEPA). Our flow is that customers pay automatically, after 12 hours of their made changes. So, we don't use metered or something. Is there any way we can do make this flow work in combination with SEPA debit i.c.w. iDEAL or no option at all unless we change our complete flow?
you can use 'proration_behavior' => 'always_invoice'
I'm not quite sure if I really understand the differences between 'create_prorations' and 'always_Invoice'
create_prorationswill cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under certain conditions https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment.
always_invoicealways invoice immediately for prorations.
Thanks for your help so far!