Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
 Am busy with a shopping app here so am having issues with the checkout of items, like when the user needs to make a payment, so how do I incorporate PayPal to my application? 
 
Because what am actually trying to do is to perform a payment with 3 steps:

1) Order Page with PayNow Button for users to click

2) PayPal Payment

3) Redirect to "Payment completed page"


What I have tried:

I have tried to implement this:

Paypal.Button.render({
  //Configure environment
  env: 'production', // To test, set to `sandbox`
  payment: function () {
    // Set up the payment here, when the buyer clicks on the button
  },
  onAuthorize: function (data, actions) {
    // Call your server to execute the payment
    if (error === 'INSTRUMENT_DECLINED') {
      actions.restart();
    }
  }
}, '#paypal-button');
Posted
Updated 16-Sep-19 11:53am

1 solution

The instructions on the PayPal site pretty much lay it out for you quite nicely; why don't you try the simple Basic Imtegration tutorial and build from that?
Add the Buttons - PayPal Developer[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900