#quantum1125-paymentrequest

1 messages · Page 1 of 1 (latest)

eternal gulch
#

hello @remote solar! are you facing any issues with a particular param?

remote solar
#

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

eternal gulch
#

can you share your exact code snippet? both of how you're defining the PaymentRequestButtonElement component and the options param

remote solar
#

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

eternal gulch
#

what does pr return?

#

when you log it just before PaymentRequestButtonElement

remote solar
#

it's a huge object

eternal gulch
#

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} />