Integration Error: For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element. #456
Getting "Integration Error: For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element." This is despite checking for canMakePayment() in render method and returning null in conditional if false. By console.log() I could detect the error arises as soon as canMakePayment return true in the form {applePay: true}
The reason I'm passing the paymentRequest as a prop is because my orderTotal is subject to change, which I can't account for if my paymentRequest is created in the constructor of the child element.
Here is my code summary and snippets:
I'm passing the paymentRequest object as a prop to the PaymentRequestButton component:
Summary
Getting "Integration Error: For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element." This is despite checking for canMakePayment() in render method and returning null in conditional if false. By console.log() I could detect the error arises as soon as canMakePayment return true in the form {applePay: true}
The reason I'm passing the paymentRequest as a prop is because my orderTotal is subject to change, which I can't account for if my paymentRequest is created in the constructor of the child element.
Here is my code summary and snippets:
I'm passing the paymentRequest object as a prop to the PaymentRequestButton component:
Code in Parent Component:
Code in Child (PaymentRequestButtonStripe):
Other information
Safari