从信用卡付款中清空related_resources

时间:2016-11-17 17:29:09

标签: paypal paypal-sandbox paypal-rest-sdk

我使用paypalrestsdk进行信用卡付款。当我切换到SANDBOX模式并提出请求时,paypal服务会将此返回给我:

{'update_time': u'2016-11-17T16:47:46Z',
'payer': 
     {'payment_method': u'credit_card',
     'funding_instruments': [
            {'credit_card': 
                  {'first_name': u'first_name',
                  'billing_address': {'city': u'London', 'postal_code': u'123','line1': u'fooo', 'country_code': u'EN'},
                  'expire_month': u'12',
                  'number': u'xxxxxxxxxxxx1111',
                  'last_name': u'last_name',
                  'expire_year': u'2020',
                  'type': u'visa'}}]},
'links': [
       {'href': u'https://api.sandbox.paypal.com/v1/payments/payment/PAY-1GH35642K71421451LAW56MQ',
       'method': u'GET',
       'rel': u'self'}
 ],
 'transactions': [
         {'item_list': {
               'items': [
                       {'currency': u'USD',
                       'price': u'367.77',
                       'name': u'Foooo',
                       'quantity': u'10'}],
                'shipping_address': {'city': u'London', 'line1': u'line1', 'recipient_name': u'name', 'phone': u'321312', 'state': u'state', 'postal_code': u'123', 'country_code': u'EN'}},
                'related_resources': [],
                'amount': {'currency': u'USD', 'total': u'3688.77', 'details': {'subtotal': u'3677.70', 'shipping': u'11.07'}},
                'description': u'Charge for order: #1'}],
'state': u'created',
'create_time': u'2016-11-17T16:47:46Z',
'intent': u'sale', 
'id': u'PAY-1GH35642K71421451LAW56MQ'}

为什么related_resources为空?如何在沙箱模式下测试我的代码?当然,在PRODUCTION模式中,related_resources包含销售,例如:https://developer.paypal.com/docs/integration/direct/accept-credit-cards/

信用卡号码为4111111111111111。

1 个答案:

答案 0 :(得分:1)

4111111111111111不再有效了,你可以试试4929931129414294

等其他人
相关问题