Search code examples
paypalpaypal-sandboxpaypal-rest-sdk

empty related_resources in response from credit card payment


I'm using paypalrestsdk for Credit Card Payment. When I switch to SANDBOX mode and make a request, the paypal service return me this:

{'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'}

why is the related_resources empty? How can i test my code in sandbox mode? Of course in PRODUCTION mode related_resources contain sales as in example: https://developer.paypal.com/docs/integration/direct/accept-credit-cards/

The number of credit card is 4111111111111111.


Solution

  • 4111111111111111 is not working anymore, you can try with an other one like 4929931129414294