#noahbundeling

1 messages ยท Page 1 of 1 (latest)

modest rootBOT
lucid bone
#

๐Ÿ‘‹ happy to help

#

payment methods have a pm_xxx IDs

#

what you're passing is the Setup Intent ID seti_xxx

leaden walrus
#

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'
        ]);
lucid bone
leaden walrus
#

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.

lucid bone
#

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)

leaden walrus
#

I'm going to give it a try, thanks for your help.

lucid bone
#

let me know if you need any more help

leaden walrus
#

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?

lucid bone
#

yes please do it here

leaden walrus
#

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?
lucid bone
#

you can use 'proration_behavior' => 'always_invoice'

leaden walrus
#

I'm not quite sure if I really understand the differences between 'create_prorations' and 'always_Invoice'

lucid bone
#

always_invoice always invoice immediately for prorations.

leaden walrus
#

Thanks for your help so far!