#pulley

1 messages · Page 1 of 1 (latest)

fluid kestrelBOT
ivory wind
#

Hello

weak compass
#

Yo!

ivory wind
#

No recommendation really. SetupIntents won't validate a card 100% of the time as we sometimes don't actually perform an authorization in order to combat card testing (see: https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). Even if the SetupIntent does successfully validate the card, the issuer can always decline it on the charge later on. If this happens, you should just bring your customer back on-session and collect a new card.

#

To clarify though, you aren't creating your order immediately after collecting their details here right?

#

Like you collect the card details then sometime later when the customer isn't on-session you charge the card?

weak compass
#

From what i can tell through the code, they click the pay button to setup the card, we await the response for that to complete or error out, if error, displaying messages to user, if successfully we make a request to our api that builds the subscription and does this cashieer logic to create the subscription.

                                    ->withMetadata($metaDataArr)
                                    ->create(
                                        paymentMethod: $checkoutData->payment_method_id,
                                        subscriptionOptions: [
                                            'default_tax_rates' => [
                                                $stripeTaxRate->id,
                                            ],
                                            $addInvoiceItems
                                        ]
                                    );```
ivory wind
#

Ah okay I see. So yeah I'm not intimately familiar with Cashier, but what you want to be doing instead is creating your Subscription and then using the PaymentIntent generated from the initial Subscription to collect the card details (you would call stripe.confirmCardPayment() using that PaymentIntent's client secret).

#

Otherwise, you are going to need to catch the errors based on your Subscription creation request, which once again has to do with however Cashier handles this.

weak compass
#

Okay so let me see if i got the order of what you recommend.

Steps

  1. confirm card setup
  2. confirm card payment
  3. cashieer create subscription
ivory wind
weak compass
#

ok let me stew this over thanks so much

#

BTW love you guys and how quick you are to respond