0

I need to find a way to customize the PayPal page that appears to the User which is starting a Transaction in order to give him a better experience. In particular I would like the PayPal page translated in the language of the User.

matteo
  • 1,635
  • 1
  • 15
  • 26

2 Answers2

1

First of all you need an access-token in order to be able to leverage the REST Api. You will find details in How to retrieve PayPal REST Api access-token using node. Once you have the access-token you can do the following:

request.post({
    uri: "https://api.sandbox.paypal.com/v1/payment-experience/web-profiles",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "bearer " + access_token
    },
    json: {
    "name": "English language",
    "presentation": {
        "locale_code": "US"
    },
    }
}, 
function(error, response, body) {
    console.log(body);
});

If the request is successful You'll get something like the following:

{ id: 'XP-ABCD-YDEF-GHIL-5MNO' }

Now to reach your goal You have to add the "experience_profile_id" parameter to your payment object with the value obtained above.

Community
  • 1
  • 1
matteo
  • 1,635
  • 1
  • 15
  • 26
1

this is Avi from paypal. You can use the officially supported PayPal node sdk to do this, here is a sample

Avi Das
  • 1,725
  • 1
  • 13
  • 19