#aaparth-payment-button

1 messages · Page 1 of 1 (latest)

stark zealot
#

Hi! What do you mean by payment method id?
You should create a Payment Intent on the backend, and it will automatically create a Payment Method for you.

edgy basin
#

yes we did, but let me check again

#

can you help with the second question please

stark zealot
#

Have you tried Google Pay or Apple Pay in india? Have you seen any error message?

edgy basin
#

request timeout in Google Pay

stark zealot
#

Can you share a PaymentIntent ID if you have one (pi_xxx)? And what part of your code is generating the timeout?

edgy basin
#

let me check

trim minnow
#

i got error when i pay using testing card in google pay. Error - Your request failed. Use a different payment method, or contact us. Learn more [OR-CCSEH-21]

stark zealot
trim minnow
#

acct_1Eep6YCmxQwltEUM

stark zealot
#

Thanks! Give me a few minutes to look into this.

dense remnant
#

you probably are using the Indian version of Google Pay, which is different from the one in the rest of the world, we don't support it

edgy basin
#

@dense remnant

the account is from UK and we are developing the system.

dense remnant
#

@edgy basin ok, but are you in India and are using an phone with the Indian version of Google Pay?

edgy basin
dense remnant
#

cool

edgy basin
#

still it does not works for me

dense remnant
#

so is this in livemode or test mode?

edgy basin
#

test mode

dense remnant
#

do you have a credit card in your Google Pay account?

edgy basin
#

yes I do

#

that too is Live card

dense remnant
#

what type of card is it? (like which brand)

edgy basin
#

MasterCard

dense remnant
#

is it a website you're building or a mobile Android app

edgy basin
#

website

dense remnant
#

link?

edgy basin
#

just a moment

dense remnant
#

take out the alert()

#

like the alert(ev.paymentMethod.id);

#

remove it

#

it stops the rest of the code executing until the box is closed, and you can't see or close the box because the Google Pay popup is still open. So the code is frozen so processing the payment and calling the function to close the GPay popup never happens and eventually it times out.

#

use console.log to debug, it's 2022 😓

trim minnow
#

removed it

dense remnant
#

cool

#

so now you need to fix this , right?

trim minnow
#

@dense remnant let me check

#

@dense remnant i have checked my code, clientSecret is defined in click of paymentmethod but where to get value of clientSecret ?

dense remnant
#

ok you are extremely lost then

#

the clientSecret comes from your backend server.

#

you create a PaymentIntent object on your server by calling our API, and then you send a field of that object (the secret) to the frontend and use it in that code.

edgy basin
#

@dense remnant

this is the testing page as of now to check for Apple & Google pay

dense remnant
#

ok!

edgy basin
#

@dense remnant is there any demo example available for this on Github or somewhere else ?

dense remnant
edgy basin
#

because the documentation is little bit tricker to understand and we got lost in between

dense remnant
#

I highly suggest you use ^^ that guide (the PaymentElement), it supports cards and Google Pay directly, you don't have to build the PaymentRequestButton itself on its own

edgy basin
#

we have used this in another application where stripe handles this but in this the client requires it to be custom on the website so we have to use the Payment buttons

dense remnant
#

to be clear, I'm not talking about Checkout

edgy basin
#

okay then

dense remnant
#

but ok, if you've used this stuff before than you know what PaymentIntents are right? and how you need to create one on the backend and return the client_secret to the frontend

#

it's the same here

#

the docs for the PaymentRequestButton assume you're familiar with that already

edgy basin
#

yeah @dense remnant and btw thanks with this, now will check this out and if we stuck somewhere then will ping again over here

#

can you not archieve this thread for now so we can message you again over here only and don't have to start again

dense remnant
#

sorry but no, this is not a 1-on-1 support channel, it's for one-off questions to unblock you. We work different timezones and shifts so you can't always talk to me

edgy basin
#

okay

#

@dense remnant

we got this to work and the payment has been succeed in dashboard but just one more question. How will be know when the payment is successful

dense remnant
#

you get a payment_intent.succeeded webhook

edgy basin
#

okay and anything else on the View page ?

dense remnant
dense remnant
edgy basin
#

okay thanks, was looking for Promise

dense remnant
#

your code has a line already : // The payment has succeeded.

#

that's where the execution goes when the payment has succeeed.

#

note you can not rely on that code to execute, you must use webhooks to actually process the user's order and update your database since otherwise you will have cases where the customer pays but the frontend code doesn't execute and you fail to update your records

edgy basin
#

okay

#

@dense remnant

over here we have a code which checks for 3D Secure cards, so when that is encountered what is the next step like we do for in mobile sdk. HandleNextAction

dense remnant
#

what do you mean by 'over here'?

edgy basin
#

just a moment

#

I mean what if confirmResult.paymentIntent.status === "requires_action"

dense remnant
#

then the code will close the payment sheet(ev.complete('success')) and then presents the 3D Secure popup(by calling stripe.confirmCardPayment again).

edgy basin
#

okay so then we confirm that

#

@dense remnant

how can we subscribe to price with this, do we need to create the payment intent with price_id or something else ?

dense remnant
#

you mean you want to start a subscription(recurring payments)?

edgy basin
#

yes

dense remnant
#

before I answer — can you use Checkout or is that not possible?

edgy basin
#

not possible as we need to do in this only

dense remnant
#

ok, then be aware you have a lot work ahead of you

edgy basin
#

okay no worries

#

actually we have subscriptions running from our mobile apps so webhook and everything else is tested and working fine

dense remnant
#

i.e you create a Subscription -> get the Invoice->PaymentIntent->clientSecret and use that on the frontend.