#s0__0-PI

1 messages · Page 1 of 1 (latest)

dawn iris
proven stag
#

$stripe->paymentIntents->create(
[
'amount' => 1099,
'currency' => 'eur',
'automatic_payment_methods' => ['enabled' => true],
]
);

#

what i have return is this @@

dawn iris
#

You need to store the PaymentIntent in a variable, something like this:

$paymentIntent = $stripe->paymentIntents->create( ... );

And then in the $paymentIntent variable there will be a client_secret.

proven stag
#

can i directly show card number fields after customer choose stripe method?

#

customer will choose his payment method and fill in email addr, after that, if he choose stripe, another page showing card number field

dawn iris
proven stag
#

okok i can now show my card form, how can i pass the product information back to my server?

#

should i save the client_secret to my database, and when customer paid, i can check which order No. by comparing the client_secret to know which order is paid?

dawn iris
proven stag
#

okok thanks!

proven stag
#

when i press submit, an error is occur @@

balmy spear
#

Hey, taking over from @dawn iris here

#

Something seems off here. Your UI is using the Payment Element yet your code is creating a card element

#

Ah, you're creating a UPE instance earlier in your code

#

Why are you creating a Token?

proven stag
#

I am very confuse what am i doing

#

Lots of example and doc

#

And i mix up everything

#

Now i can show the card field, but what i have to handle with the submit button?

balmy spear
#

Are you following a guide from somewhere?

#

Generally you shouldn't use createToken

proven stag
#

Okok but what i have to do about the submit button?

balmy spear
#

I'm guessing you're following another guide online?

#

I can't write code for you, so you need to share the exact block of code you're struggling with and what exactly the issue is

proven stag
#

yes i am following this page

#

once i click the submit buttom, the url goes the same, and nothing happen, no success msg

#

and i havnt set src in the <form> tag

#

do i need to event.preventDefault();
to disable the submit action?

balmy spear
#

Can you share the code your submit button triggers?

proven stag
#

i have updated the trigger code

balmy spear
#

You need some JavaScript to handle the form submission

proven stag
balmy spear
#

I can't see that in what you've shared

proven stag
#

but i got some error

#

can you see my image now @@?

balmy spear
#

Does the error make sense to you?

proven stag
#

is it a must to show region select option?

hot fable
proven stag
#

how can i add alipay and wechat in my form?

hot fable
proven stag
#

i have enable them
currency is hkd
region is hk
but no alipay/wechat button appear @@

hot fable
#

what's the PaymentIntent ID pi_xxx you're using so I can check something?

proven stag
#

pi_3KlBJZJnRDDqOaR70Pb11sGy

hot fable
#

you're not using your own Stripe account

#

I assume you copy and pasted API keys from our docs somewhere, so you're actually creating that object on one of our test accounts

#

get your own keys from https://dashboard.stripe.com/test/apikeys and configure the PHP code to use those instead, so that the settings from your own account will apply and the payments appear on your own dashboard

proven stag
#

oops, sorry

#

i can see them now

#

can i adjust the width to see them all?

#

width of the form

hot fable
#

it fits the width of the container you mount the PaymentElement to, but in general that's how it's designed, it has a dropdown menu for picking other payment methods

proven stag
#

i cant see the form in mobile after i change the keys

#

PC looks fine

hot fable
#

what debugging have you done?

#

if you have a public link to the site I can have a look too.

hot fable
#

seems fine to me

#

how did you test exactly, what does "in mobile" mean precisely?

proven stag
#

i just open this link in my andriod phone @@

#

no form appeared, just only my submit button

hot fable
#

opened it on my Android phone and it displays fine

proven stag
#

hello

#

i have got this error

#

{
"error": {
"message": "The client_secret provided does not match any associated PaymentIntent on this account.",
"param": "client_secret",
"type": "invalid_request_error"
}
}

#

but in my pc and your phone, it works fine @@!

proven stag
#

my iphone didnt show apple pay method @@

rapid kernel
#

Hi there 👋 jumping in as my teammates needed to step away. The sever is very busy at the moment, would you mind summarizing your current questions/concerns?

proven stag
#

the previous problem is settled

#

the newest question is
my iphone didnt show apple pay method @@

rapid kernel
#

I'm not seeing it either, have you followed the instructions in the "Set up Apple Pay for your website" section from this article to verify your domain with Apple Pay?
https://support.stripe.com/questions/enable-apple-pay-on-your-stripe-account

proven stag
#

i turn on apple and google pay
for my android phone, i can see google pay
but no apple pay in my iphone

#

oh i know what u mean now

#

hnvt do that yet

rapid kernel
#

Alright, you'll need to verify your doamin with Apple before they will allow Apple Pay to be displayed.

proven stag
#

ok thanks

#

how about wechat ?
in pc, It show a qr code only
after i cross it (didnt scan) , it redirect to my return_url

#

does it mean a bug? or i have to set a fail page?

hot fable
#

what does "cross it" mean?

proven stag
#

closs the pc code by pressing the "cross" icon

hot fable
#

can you share a screenshot of what you're describing?

proven stag
hot fable
#

makes sense, so you cancelled the payment

#

it will go to your return_url yes

#

if you look in the URL you probably see information that tells you the payment is not complete(I think there's a &redirect_status=failed or something similar)

hot fable
#

ok, then you would want my second option

proven stag
hot fable
#

yep, indeed

#

do you have a question?

proven stag
#

in test case, if success payment, will my webhook receive a notification?

hot fable
#

yep!

proven stag
#

how can i redirect a fail page to customer while they cancel paying?

#

const {error} = await stripe.confirmPayment({
//Elements instance that was used to create the Payment Element
elements,
confirmParams: {
return_url: 'https://yudans.net/complete',
},
});

#

i have just only set a return_url

hot fable
#

you can't, that's not supported right now

proven stag
#

after i've received a success msg from my webhook, can i trust it? or i still have to check with stripe again?

hot fable
#

you can trust it

proven stag
#

in my return_url, i have to handle both success and fail msg, right?

hot fable
#

yes

proven stag
#

okok

hot fable
#

@proven stag going to close this thread for now as it's been ongoing for a long time and you seem to be making progress and are not blocked. Happy hacking!