#Karl Yang

1 messages · Page 1 of 1 (latest)

tender snowBOT
plain magnet
#

Hi! Let me help you with this.

#

Could you please share the context?

formal pecan
#

We expect to have this outcome, but now is

#

only showing the following screen

plain magnet
#

What are you expecting to see?

formal pecan
#

what can we do now?

plain magnet
#

Are you using Stripe Checkout or Payment Element?

formal pecan
#

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

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.

plain magnet
#

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?

formal pecan
formal pecan
plain magnet
#

Now fails with 500

formal pecan
plain magnet
#

I get an error when I access this endpoint. It's related to your code.

tender snowBOT
formal pecan
#

{"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

verbal cloud
#

sound like your $jsonObj value is null then

formal pecan
#

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.

verbal cloud
#

what error do you see in the browser console?

formal pecan
verbal cloud
#

I see a PaymentElement on that page.

#

so is that working? is that what you expect? if not, what do you expect instead?

formal pecan
#

It works now. But how can I get the success processed data?

formal pecan
#

Thanks a lot! How can we receive whether a transaction proceed successfully or not through php or js?

tender snowBOT
formal pecan
#

Besides, we need the transaction data generated by Stripe. How can we receive that information?

verbal cloud
#

what is "the transaction data" exactly, what information do you want?

formal pecan
#

The data input by the credit card holder and from Stripe like PayPal

verbal cloud
#

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?

formal pecan
#

Email, name, payment id, customer id etc.

verbal cloud
#

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