Setting payer information

lokitt
Contributor
Contributor

Hi,

 

I'm developing an Angular app and I'm trying to set up the payer information in the Contact form that shows up when the user clicks the PayPal buttons. I have this information about the user from the server (name, email etc.) and I'd like to fill them in for him so that his payment is faster. 

I've followed the documentation at https://developer.paypal.com/docs/api/orders/v2. regarding the payer information and the fields it contains. Through this, I've been able to set the name and address of the payer with no effort. However, when I try to do the same with the phone number, it just won't work. (I have also enabled the Contact Telephone Number option in the merchant account).

 

This is my code and it shows no errors in the console:

 

payer: {
  name: {
    given_name: this.userInfoService.getUserInfo().firstname,
    surname: this.userInfoService.getUserInfo().lastname
 },
 email_address: this.userInfoService.getUserInfo().email,
 address: {
    address_line_1: this.userInfoService.getCompanyInfo().address,
    postal_code: this.userInfoService.getCompanyInfo().postcode,
    admin_area_2: this.userInfoService.getCompanyInfo().city,
},
  phone: {
    phone_number: {
     national_number: '15417543010'
     }
  }
}

 

However, while the email, name and address of the payer are filled in correctly, no change is made in the phone number fields. Does anybody know why?

 

Thanks!

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.