Payments without order

datalink
New Community Member

I save orders with PHP after the payment is done by express checkout. I do this by updating and sending my form in onAuthorize:

 

onAuthorize: function(data, actions) {
    return actions.payment.execute().then(function() {
        document.getElementById('paypal_transaction').value = data.paymentID;
        document.forms['paymentform'].action = 'order-done-paypal.htm';
        document.forms['paymentform'].submit();
    });
}

After a half year there were 3 payments, from more then 100, without orders. So how to send my form, when PayPal fails? Is there something like:

onFail: function() {
    document.getElementById('paypal_transaction').value = 'No Payment ID';
    document.forms['paymentform'].action = 'order-done-paypal.htm';
    document.forms['paymentform'].submit();
}

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.