react-native-payments icon indicating copy to clipboard operation
react-native-payments copied to clipboard

Cannot read property 'recipient' of null

Open mgarabedian opened this issue 5 years ago • 6 comments

While performing a PaymentRequest, requesting PayerName and PayerEmail via Apple Pay, I am getting a JS error:

Cannot read property 'recipient' of null

It is trying to find the shipping option recipient, but there is no shipping requested.

 const OPTIONS = {
      requestPayerName: true,
      requestPayerEmail: true,
    };

In debugger, here is the offending line, where this._shippingAddress evaluated as null:

payerName: this._options.requestPayerName ? this._shippingAddress.recipient : null,

mgarabedian avatar Jun 28 '19 04:06 mgarabedian

i got the same error

matwming avatar Aug 14 '19 03:08 matwming

+1

lenichols avatar Dec 04 '19 06:12 lenichols

@mgarabedian how did you get past this?

lenichols avatar Dec 04 '19 06:12 lenichols

I never did, and couldn't get it to reliably work. Ended up using tipsi-stripe for my project.

mgarabedian avatar Dec 04 '19 15:12 mgarabedian

@mgarabedian will tipsi-stripe get past the iOS app store?

lenichols avatar Dec 05 '19 06:12 lenichols

@lenichols @mgarabedian I was also getting the same error and I was able to fix it by setting requestShipping to false, like below -

const OPTIONS = { requestPayerName: true, requestShipping: false, };

rajatgyl avatar Jun 10 '21 13:06 rajatgyl