How to fill the buyer's email and first and lastname
Olilou
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Nov-16-2020
11:19 AM
Hi,
I'm trying to find how to fill the shipping informations in paypal.
Here is my code :
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
reference_id: "PUHF",
description: "Some description",
custom_id: "Something7364",
soft_descriptor: "Great description 1",
amount: {
currency_code: "EUR",
value: "234.00",
breakdown: {
item_total: {
currency_code: "EUR",
value: "200.00"
},
tax_total: {
currency_code: "EUR",
value: "20.00"
},
discount: {
currency_code: "EUR",
value: "5.00"
},
shipping: {
currency_code: "EUR",
value: "20.00"
},
insurance: {
currency_code: "EUR",
value: "1.00"
},
shipping_discount: {
currency_code: "EUR",
value: "2.00"
}
}
},
items: [
{
name: "Item 1",
description: "The best item ever",
sku: "xyz-2654",
unit_amount: {
currency_code: "EUR",
value: "100.00"
},
quantity: "1"
},
{
name: "Item 2",
description: "Not bad too",
sku: "zdc-3942",
unit_amount: {
currency_code: "EUR",
value: "50.00"
},
quantity: "2"
}
],
shipping: {
address: {
name: {
given_name: 'Jean',
surname: 'Martin'
},
email_address: 'jeanmartin[at]email.com',
address_line_1: "218 rue de la liberté",
address_line_2: "",
admin_area_2: "Paris",
admin_area_1: "",
postal_code: "75000",
country_code: "FR",
}
}
}]
});
},
The shipping address is well filled but the name and email address are not filled in paypal page.
Is someone can help me to pass the right parameters to paypal please ?
Thank in advance !
Labels:
- Labels:
-
Payments REST APIs
1 REPLY 1
MTS-Aaron
PayPal Employee
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov-19-2020
10:02 AM
Hi @Olilou
That's a great question! Just from looking at your code, it looks like you've got the "Name" object inside of the "Address" object. From the documentation here, it looks like it should be this inside the shipping object:
Name: { full_name: 'Jean Martin' },
Address:{
address_line_1: "218 rue de la liberté",
address_line_2: "",
admin_area_2: "Paris",
admin_area_1: "",
postal_code: "75000",
country_code: "FR" }
Hope that helps!
-Aaron
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Website payment preferences, auto return stopped working with new subscription payment button in PayPal Payments Standard
- Which paypal API is necessary to create market place? in REST APIs
- Payee account is invalid issue in REST APIs
- Processor Declined for Braintree Sandbox transaction in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- Buyer has not agreed to subscription in REST APIs