#Karl Yang
1 messages · Page 1 of 1 (latest)
What are you expecting to see?
but now is only like this : https://www2.cccowe.org/public/checkout.html
A demo of a payment on Stripe
what can we do now?
Are you using Stripe Checkout or Payment Element?
We follow the link river provided yesterday => I'm afraid I'm not familiar with PHP and the error is not Stripe specific. Alternatively, I'd recommend downloading the source code here https://stripe.com/docs/payments/quickstart with step by step guide and integrate it into your app
I looked at your DevTools and it seems like your https://www2.cccowe.org/create.php endpoint is failing.
Do you know what's wrong?
Please try again now?
Please try this updated link https://www2.cccowe.org/checkout.html
A demo of a payment on Stripe
Now fails with 500
Sorry, can you try this https://www2.cccowe.org/public/create.php
I get an error when I access this endpoint. It's related to your code.
{"error":"Argument 1 passed to calculateOrderAmount() must be of the type array, null given, called in /home/am9nzurouhmm/public_html/www2.cccowe.org/public/create.php on line 29"}
Line 29 is
'amount' => calculateOrderAmount($jsonObj->items),
I changed it to 20000, then it return a key
pi_3MqwNqAZZ5NhXiy72un6tbD3
sound like your $jsonObj value is null then
I have change the $jsonObj to 20000
And it return the pi key now
But in checkout.html, also no payment method for the client to choose.
what error do you see in the browser console?
Can you try again https://www2.cccowe.org/public/checkout.html
A demo of a payment on Stripe
I see a PaymentElement on that page.
so is that working? is that what you expect? if not, what do you expect instead?
It works now. But how can I get the success processed data?
Thanks a lot! How can we receive whether a transaction proceed successfully or not through php or js?
Besides, we need the transaction data generated by Stripe. How can we receive that information?
same link as above — you get a webhook on your backend server indicating the payment outcome.
what is "the transaction data" exactly, what information do you want?
The data input by the credit card holder and from Stripe like PayPal
not sure what that means. Can you be more explicit?
what exact values do you want, can you name some examples? like the last 4 digits of the credit card used, something else?
Email, name, payment id, customer id etc.
that information is contained within the webhook mentioned above
the best approach is that when handling the webhook, look at the latest_charge field on the PaymentIntent object. Then retrieve that from the API : https://stripe.com/docs/api/charges/retrieve
there's then a bunch of information on the transaction in charge->payment_method_details https://stripe.com/docs/api/charges/object#charge_object-payment_method_details and billing_details https://stripe.com/docs/api/charges/object#charge_object-billing_details
so I'd start there and experiment with some code