#worldorder_95
1 messages · Page 1 of 1 (latest)
Hello @dire wing, thanks for quick reply. Yes, we have a staging site where you can check the integration. Steps to test it:
- Go to https://petspace-staging.herokuapp.com/l/alpaca-coffee-colombia-mustafa/6560a03e-b376-4d01-8de7-83445f57bb3d
- Select Quantity and click But Now (you'll be able to continue as guest).
- You'll land on CheckoutPage and at the top you'll be able to see the Payment Request Button. Clicking on it should give you the issue (the amount should be 0, and there won't be any shipping options).
Also, here's the code used in the integration: https://github.com/AleksaButterfly/PaymentRequestButton
Please let me know if you need any help. Thanks again.
And if you can't continue as guest, please use this login info:
Email: stripe-test@petspace.uk
Password: stripetest123
Hi, what do you mean by this exactly?
I added new components that closely resemble those in the documentation on your website.
So the code that I have added (visible on this repo https://github.com/AleksaButterfly/PaymentRequestButton) is mostly the same as the one in your documentation (https://stripe.com/docs/stripe-js/elements/payment-request-button?client=react).
Okay, I see what you meant. Let me check the code.
Sure, thank you!
I am trying to follow your code and it's a bit difficult between different files and without types. I think there's a mistake somewhere where you're passing around the options for the paymentRequest, and that's where the amount gets lost
Maybe you could try to simplify your code to spot the problem.
Does it work if you pass a hard-coded amount?
Maybe I can try to explain it how the code works.
- Main StripePaymentRequestButton.js (https://github.com/AleksaButterfly/PaymentRequestButton/blob/master/StripePaymentRequestButton.js) component is just a <Elements /> wrapper component that wraps up the Payment Request Form.
- PaymentRequestForm.js is a form component that displays the button (using PaymentRequestButtonElement), where everything happens. In this file I have usePaymentRequest (https://github.com/AleksaButterfly/PaymentRequestButton/blob/master/PaymentRequestForm/PaymentRequestForm.js) where I pass the request options. Here I also pass the payment amount that is available after initial render, I try hardcoding the value and when I hard code it it does work, it shows the price that I hardcoded. Same happens when I hardcode the shipping.
- PaymentRequestForm.shared.js (https://github.com/AleksaButterfly/PaymentRequestButton/blob/master/StripePaymentRequestButton.shared.js) is where I create functions for options and payment request. Those are completely the same as the one in the Stripe Docs. So it seems that useMemo doesn't run in usePaymentOptions inside this file, when the paymentRequest changes.
Unfortunately, I don't have time on Discord to dive deep into your code, that's not directly related to Stripe, sorry. I can help if something is not working as expected with the Payment Request Button options directly, but I can't debug your own application code right now.
Hence, the question ☝️
Sure @loud silo, I totally understand. Thanks for the help, have a great day.
Please let me know if the problem is indeed with the PRB, or not.
You too!