#quantum1125-paymentrequest
1 messages · Page 1 of 1 (latest)
yeah the options param
<PaymentRequestButtonElement options={{paymentRequest}} />
i have a valid payment request object that i am using elsewhere but for some reason here once it's inside the double curly brace, it doesn't like it
can you share your exact code snippet? both of how you're defining the PaymentRequestButtonElement component and the options param
const pr = this.state.paymentRequest
<Button class="filled" style={{ display: this.state.applePay ? "inherit" : "none" }} clickHandler={this.handleApplePay.bind(this)}>
{pr ? <PaymentRequestButtonElement options={{pr}} /> : null}
</Button>```
paymentRequest returns successfully after calling stripe.paymentRequest earlier
it's a huge object
the most likely reason is that you're not passing in stripe.paymentRequest object correctly in options.
whoops sorry, ignore my previous code, that missed out all the bits in between
my suspicion here is that the object you're passing in is the entire PaymentRequest object, but the paymentRequest object is actually one of the values in the options object. The options object is supposed to look like this
const options = {
paymentRequest,
style: {
...
}
}
<PaymentRequestButtonElement options={options} />