#Giriraj

1 messages · Page 1 of 1 (latest)

rigid burrowBOT
formal ocean
#

i m passing full amount from below code
const paymentIntent = await stripe.paymentIntents.capture(paymentIntentId, {
amount_to_capture: amount,
})

#

suppose i have capture 10$. i m passing 10$ to update capture method.

low forge
formal ocean
#

yes

low forge
#

How does it look? can you share the request id? req_xxx

formal ocean
#

req_v0rOXbegyc5a7x

#

i m capturing using below code

const paymentIntent = await stripe.paymentIntents.create(

{
amount: amount,
currency: "usd",
customer: customerId,
payment_method: paymentMethodId,
capture_method: 'manual',
off_session: true,
confirm: true,
receipt_email: receipt_email
}
);

low forge
#

This PI is captured successfully

formal ocean
#

yes correct, but why not updating status here?

#

i think i have provided wrong req_xxx id

low forge
#

That's different PI

formal ocean
#

yes

#

let me share that PI request id

#

i can't find req_xxx id let me share evt_xxx id
evt_3NNbleBSgwhLUexT003vI0pr

low forge
#

req_6S7DNkamd412zJ is the id

#

pi_3NNbleBSgwhLUexT0UWaHSWb

#

It wasn't captured yet

formal ocean
#

oh, so where i m wrong?

low forge
#

m capturing using below code

const paymentIntent = await stripe.paymentIntents.create(

{...
This doesn't capture

#

This is only to create and confirm the PI. You need a separate call to capture the PI, like stripe.paymentIntents.capture

formal ocean
#

you mean just i need to do like below?
const paymentIntent = await stripe.paymentIntents.capture(paymentIntentId)

low forge
#

Yep, please remove your image because it has your secret key

formal ocean
#

i think no need to pass amount_to_capture field. if i need to capture full amount.

low forge
#

Yes

#

it defaults to full amount

formal ocean
#

ok thank you

#

@low forge let move to another question.
currently i m use setupintent like below
const setupIntent = await stripe.setupIntents.create({
customer: customerId,
payment_method_types: ["card"],
});
and also i m use cardelement which is provided by stripe

but i need to add one more payment method which is apple pay. so how can i do that?

low forge
#

card already has apple pay inside

#

Btw you don't need to mention me on every message

formal ocean
#

yes, i know sorry

formal ocean
low forge
#

You just create a SetupIntent and use PaymentElement to show it on a Safari, within a Mac/iPhone has Apple Pay proper setup

#

Something like this

#

With a "Pay" button downside

formal ocean
#

ok thanks. but should i need to pass payment_method_types : ["card", "apple pay"]?

low forge
#

no, just card

formal ocean
#

ok let me check

#

i have enabled but it's not works

#

which setup i missed?

low forge
#

What doesn't work? Do you open on Safari, with ApplePay setup?

formal ocean
#

yes i have try but it's unable to works.

low forge
#

Do you use it in PaymentElement? Have you verified the domain?

formal ocean
#

yes, i have just now verified my domain. look above screenshot i have open in safari.

#

i can't see apple pay option

#

i have used paymentelement see my code

low forge
formal ocean
#

yes, same thing i followed. but it's not works for me

low forge
#

Ok can you send me the URL?

#

I can test it myself

formal ocean
#

click on any slots and click on claim one session button

#

then next page will open then click on add new card button

low forge
#

I see ApplePay

#

I think it's because of your location, when ApplePay isn't supported in India.

formal ocean
#

oh, it will support in maxico, united state?

low forge
formal ocean
#

thanks man for helping us

#

and yes, capture method is works for apple pay?

low forge
#

Yes should! ApplePay is just the payment method, shouldn't affect the capture step