#oushima0089

1 messages · Page 1 of 1 (latest)

dull escarpBOT
slim ginkgo
empty chasm
#

Ah okay, so the payment needs to be immediately marked as "completed" after paying via iDeal?

Thanks for the clear answer btw.

slim ginkgo
#

If you remove capture_method : manual, then iDEAL will show as a payment method option. i.e. don't use auth and capture. I'm not exactly certain what is meant by immediately mark it as completed

empty chasm
#

Yes you're right. If I disable manual then it loads as expected.

I want the restaurant owners to mark the payment as "Succeeded" in the Stripe dashboard by capturing the payment.

await this.stripeService.capturePayment({ paymentIntentId: order.stripePaymentIntentId });
```But that requires manual. 

What I mean with succeeded is: the payment is completed (no actions left to do).
slim ginkgo
#

then iDEAL isn't an going to be an option I'm afraid. Essentially, once the customer confirms the payment, the payment will be successful / failed, the restaurant owner can't capture it

empty chasm
#

Sometimes the restaurant might reject the order, in that case the payment shouldn't go through, is what I mean.

#

Ahaa, okay I got it. hm....

#

Darn it. 🤯
Thanx for the help... I need to think for a moment now

empty chasm
#

Thanks again for the help.

For now I have resorted to just refunding the payment through API call if the restaurant owner rejects the order.

Since I found no better solution for the iDeal problem. 😅

slim ginkgo
#

Is this flow abnormal or totally fine:

  1. Create payment intent (display elements e.g. iDeal, PayPal, credit card, etc.)

  2. Press "Order Now" -> insert order in database.

  3. Confirm Stripe payment (success in Stripe dashboard).

My concerns:
Inserting the order before confirming successfully completing the payment.

On the other side, I need to insert first because I use the order ID for the stripe return_url for the track-order page.
when you do 1), you should also be able to insert the corresponding order id of the PaymentIntent into your DB right?

empty chasm
#

One moment, I'll verify.

#

when you do 1), you should also be able to insert the corresponding order id of the PaymentIntent into your DB right?
Yup, I got that column.

#
    const { error } = await this.stripe.confirmPayment({
      elements: this.stripeElements,
      confirmParams: {
        // iDeal redirect on successful payment.
        return_url: `${environment.baseUrl}/track-order/${this.orderId}`,
      },
    });

But basically, I need to insert into the DB first before I can call this code. If this fails, then the order is still in the DB.

Is that OK?

Cuz my thoughts are: why insert if it isn't fully succesfully yet.

slim ginkgo
#

I don't think you need to insert into your DB first. You can always pass in the order id when creating the PaymentIntent as metadata.

empty chasm
#

If I don't, then I cannot concatinate it to this string:

return_url: `${environment.baseUrl}/track-order/${this.orderId}`,

slim ginkgo
#

Subsequently, use a return_url without the order id. When Stripe redirects the customer to the return_url, we provide the following URL query parameters : payment_intent, payment_intent_client_secret. You can use those parameters to retrieve the PaymentIntent data and make any necessary actions

#

why do you need this.orderId in your return url?

#

if you need it in order to process the order, that would be available in the PaymentIntent object if you retrieve it

empty chasm
#

I'm thinking about what you are saying hm...

I need it for this.

slim ginkgo
#

well, what i said still applies

empty chasm
#

Ah hm... I will take a good moment to re-read what you said.