#worldorder_95

1 messages · Page 1 of 1 (latest)

quick cosmosBOT
dire wing
#

Hi there!

#

Do you have a link where I can reproduce the issue?

urban rapids
#

Hello @dire wing, thanks for quick reply. Yes, we have a staging site where you can check the integration. Steps to test it:

  1. Go to https://petspace-staging.herokuapp.com/l/alpaca-coffee-colombia-mustafa/6560a03e-b376-4d01-8de7-83445f57bb3d
  2. Select Quantity and click But Now (you'll be able to continue as guest).
  3. 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

quick cosmosBOT
loud silo
#

Hi, what do you mean by this exactly?

I added new components that closely resemble those in the documentation on your website.

urban rapids
loud silo
#

Okay, I see what you meant. Let me check the code.

urban rapids
#

Sure, thank you!

loud silo
#

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?

urban rapids
#

Maybe I can try to explain it how the code works.

  1. 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.
  2. 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.
  3. 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.
loud silo
#

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.

loud silo
urban rapids
#

Sure @loud silo, I totally understand. Thanks for the help, have a great day.

loud silo
#

Please let me know if the problem is indeed with the PRB, or not.
You too!