Skip to content

支付宝支付在ios机子上报错? #10

@luojinghui

Description

@luojinghui

错误信息:

ExceptionsManager.js:82 Exception '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]' was thrown while invoking pay on target RNAlipay with params (
        {
        body = "\U91d1\U9526\U56caVIP\U4f1a\U5458";
        inputCharset = "utf-8";
        itBPay = 30m;
        notifyURL = "http://testoffline.jnexpert.com.ngrok.cc/jnExpertPay/aliPay/aliVIPCallback.php";
        outTradeNO = "JN-VIP-20170613190830702935";
        partner = 2088911538235821;
        paymentType = 1;
        privateKey = "...key";
        seller = "pay@jnexpert.com";
        service = "create_direct_pay_by_user";
        showURL = "jnexpert.com";
        subject = "\U91d1\U9526\U56caVIP\U4f1a\U5458";
        totalFee = "0.01";
    },
    36,
    37
)
onPressPay() {
    var orderId;

    request.get(`http://composer.jnexpert.com/api/Order/jnAliVIP/221`)
        .accept('json')
        .end((err, res) => {
          if (err) {
            console.log('网络错误,请稍后重试');
          } else {
            let data = res.body || {};
            let status = data.status;
            orderId = data.order_id.toString();
            // let price = data.total_fee.toString();
            let price = "0.01";
            if (status > 0) {
              // let orderId = "jn-" + (new Date().getTime().toString());
              const privateKey = "...key";
              const data = {
                privateKey,
                partner: '2088911538235821',
                seller: 'pay@jnexpert.com',
                outTradeNO: orderId, //订单ID(由商家自行制定)
                subject: '金锦囊VIP会员', //商品标题
                body: '金锦囊VIP会员', //商品描述
                totalFee: price, //商品价格
                notifyURL: 'http://testoffline.jnexpert.com.ngrok.cc/jnExpertPay/aliPay/aliVIPCallback.php', //回调URL
                service: 'create_direct_pay_by_user',
                paymentType: '1',
                inputCharset: 'utf-8',
                itBPay: '30m',
                showURL: 'jnexpert.com'
              };
              console.log(data);
              Alipay.pay(data).then((msg) => {
                console.log(msg);
              }, (e) => {
                // ToastAndroid.show('支付失败,请稍后重试', ToastAndroid.SHORT);
              });
            } else {
              // ToastAndroid.show('网络错误,请稍后重试', ToastAndroid.SHORT);
              console.log('网络错误,请稍后重试');
            }
          }
        });
  }

在ios上跑就是报哪个错误,不知道为什么,看结果是吊起pay方法时,强行插入了两个参数,37,38,但是这套代码在安卓没有任何问题,有人知道吗?
测试机是:苹果6plus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions