I am new to Javascript and rest API. I am building a simple ecommerce site where sellers can list some items for the public to buy, so I am using paypal connected account as payment processing medium.
Paypal website say a restAPI should be call in this link
https://developer.paypal.com/docs/api/partner-referrals/#partner-referrals_create I have a paypal logo on the signup page, once the user clicks the logo I want it to call the API
they gave two steps on the page
Create partner referral
Show referral data
Sample Request
curl -v -X POST https://api.sandbox.paypal.com/v1/customer/partner- referrals \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token" \
-d
this is my paypal logo click handler
$('#paypal_img').click(function() {
console.log("lets go to payment")
//API Call
})
sample customer data format from paypal site
"customer_data": {
"customer_type": "MERCHANT",
"person_details": {
"email_address": "customer@example.com",
"name": {
"prefix": "Mr.",
"given_name": "Shashank",
"surname": "Wankhede",
"middle_name": "Govind"
},
I tried to look through the tutorial but could not get much out of it How do I Call the paypal REST API for connected account in Javascript?