#Giriraj

1 messages · Page 1 of 1 (latest)

civic tinselBOT
solar summit
#

here i can't see pay button

#

it's still processing. and it's test mode

clear imp
#

hello! can you share your site's url for me to take a closer look?

solar summit
#

yes sure

#
  1. click on any slot then click on claim one session
  2. it's redirect to second page then you can see
clear imp
#

works fine for me

#

did you setup touch id?

solar summit
#

yes

clear imp
#

honestly, the only reason i can think of is something about your Apple Pay setup / config on your device isn't correct. I would suggest asking a couple of your other colleagues to try it out too

solar summit
#

should i need to add another step?

clear imp
#

what other step are you referring to?

#

the Apple Pay button shows fine for me, so it's got nothing to do with your code

solar summit
solar summit
clear imp
#

it's mentioned in step 4 and 5 of that document you shared

solar summit
#

yes, correct but where i need to put that code?

#

i have did this only

clear imp
#

you would create the PaymentIntent on your backend server.

#

you can take a look at the example : https://stripe.com/docs/payments/quickstart for the backend server code. It's not specifically for the Payment Request Button but it can serve as reference

Learn how to embed a custom Stripe payment form in your website or application. Build a checkout form with Elements to complete a payment using various payment methods.

solar summit
#

ok checking

#

but i have used Elements for Add new Card button

#

you can click on Add new card button and see

clear imp
#

I'm afraid I don't understand the problem - can you try phrasing your question to describe what you're seeing, and what is the behaviour you're expecting to see instead?

solar summit
#

let me download your provided link code and let me check

clear imp
#

prior to this, you were asking how to create the PaymentIntent. I pointed you to that quickstart guide : https://stripe.com/docs/payments/quickstart as reference for how to create the PaymentIntent on your server. As i've mentioned, that guide is not for the Payment Request Button, but you can use that guide as a reference to understand how to go about creating a PaymentIntent on your backend server

Learn how to embed a custom Stripe payment form in your website or application. Build a checkout form with Elements to complete a payment using various payment methods.

solar summit
#

wait i m checking

solar summit
#

let me share one example just let me know it's ok or not

#

const paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Demo total',
amount: totalPayPrice * 100,
},
});

  paymentRequest.canMakePayment().then(result => {
    console.log("result*************", result)
    if (result) {
      setPaymentRequest(pr);
    }
  });

paymentRequest.on('paymentmethod', async (ev) => {  

const {paymentIntent, error: confirmError} = await stripe.confirmCardPayment(
clientSecret,
{payment_method: ev.paymentMethod.id},
{handleActions: false}
);
if (confirmError) {
ev.complete('fail');
} else {
ev.complete('success');
if (paymentIntent.status === "requires_action") {
const {error} = await stripe.confirmCardPayment(clientSecret);
if (error) {
// The payment failed -- ask your customer for a new payment method.
} else {
// The payment has succeeded.
}
} else {
// The payment has succeeded.
}
}
});

#

can i put this code inside useEffect. can i use pr.canMakePayment() and paymentRequest.on() method ?

#

then payment is working?

clear imp
#

you can try it out