在按返回按钮时反应本机贝宝包装器崩溃

时间:2019-02-04 09:34:47

标签: react-native

paypal(price,bookingId){

    PayPal.initialize(PayPal.SANDBOX, "ARFiHtTEV2P17X4Hdei6M4vqoLx_UVGAvELcTpNprLC4hNklLmNq7cl_z5OqhRGoBzzVRmS9sG-RfhXx");
    PayPal.pay({
            price: price.toString(),
            currency: 'USD',
            description: 'Payment for fuel delivery app',
          })
          .then(confirm => { 
            var pid = confirm.response.id
            this.paypalpaymentapi(price,bookingId,pid)
          })
          .catch(error => Alert.alert(error))
}

上面的代码是在React native中进行贝宝付款的。现在上面的代码中的问题是,当调用PayPal.initialize时,然后当我从初始化的贝宝按返回按钮时,我的应用程序崩溃了,这给了我错误

  

castexception无法从readablenativemap投射到String

如何解决此问题?

0 个答案:

没有答案