Paypal Express Checkout - authorization does not appear on the control panel

I create and submit the following payment through the Express Express V4 API:

return paypal.rest.payment.create(env, client, {
    intent: 'authorize',
    payer: {
        "payment_method": "paypal"
    },
    transactions: [
        {
            amount: { total: '0.01', currency: 'GBP' }
        }
    ]
});

and I return the following object:

enter image description here

Everything seems to be on the right track. The problem is that there are no signs of this payment in the sandbox toolbar.

I even tried to use an active account and send a real penny, but there are no signs of a transaction in the account of the buyer or seller.

If this payment was not successfully created, why do I see a returned object with a status "created"?

FYI: if I send a payment using intent: 'sale', it is successfully processed and appears on the control panel.

+4
1

. API PayPal - - ...

:

1. .

-, :

  • Paypal onAuthorize: function (data, actions), :

 onAuthorize: function(data, actions) {
                  return actions.payment.get().then(function(payment) {
    
    
                      console.log(payment);
    
                      var b = payment.payer;
                      var bb = b.payer_info;
    
                    //  alert (bb.payer_id);
    
                   var newUrl = "http://YOURDOMAIN.COM/execute.php?paymentId="+payment.id+"&token=EC-"+payment.cart+"&PayerID="+bb.payer_id;
    
                      console.log(newUrl);
    // go to the execute.php and send to paypal payment confirmation
                     window.location.replace(newUrl);
    
    
                  });
    
            }
Hide result

, !

  1. https://github.com/paypal/PayPal-PHP-SDK/wiki/Installation PHP SDK, execute.php, , PayPal. SDK Composer.
  2. execute.php SDK Composer.

//

require __DIR__  . '/PayPal-PHP-SDK/autoload.php';
  1. execute.php PayPal . execute.php http://pastebin.com/K750qcxE . , API PayPal:)

p.s. script URL-, , paypal , javascript, .

+2

Source: https://habr.com/ru/post/1667975/


All Articles