cancel
Showing results for 
Search instead for 
Did you mean: 

tying a login name to a payer

Options
derbysoft
Contributor
Posted on

How should I update my payer info with a loginname to identify them? Could use a name field but thats a hack.

8 REPLIES 8

tying a login name to a payer

Options
MTS_Andre
Moderator

Hi, it is my understanding you would like to assign a "login" name or "alias" to the buyer's email which are paying on your website (via the REST API PayPal button). If so then you need to build your own database/logic as PayPal needs the payerID / email to recognize the user and process the payment. You can't forward to PayPal a customized login / alias name instead of the email they insert on the PayPal checkout page.

tying a login name to a payer

Options
derbysoft
Contributor

Im using the subscription API to create the subscription not the button. Should I set the email in PayerInfo and then use that to identify the user to the back end system? I looked at the PayerInfo and i cant find a user specified ID or login name field.

tying a login name to a payer

Options
derbysoft
Contributor

If i do use email. What if they change their address? is it possible to update the user info given a payer id?

tying a login name to a payer

Options
MTS_Andre
Moderator

Hi, PayPal will use the payerID to charge the payer, which can't be changed by the payer, so all good on that side.

You can store some payer info on the object subscriber, like you can see here the full request parameters

 

tying a login name to a payer

Options
derbysoft
Contributor

Hello still dont get this. Im creating a plan and an agreement. When they sign up it redirects to ExecuteAgreement.php and the agreement is exceuted using the passed token. I still dont know how to tie the billing agreement to a user id. I know I can get the email, but I cant set that, it returns the email on the account. Their email for paypal may not match the one they gave me in which case i cant identify who they are. The only solution i can think of is to use a session vairable to identify the user in ExecuteAgreement. Is that the accepted solution or is there some other way to set and retrieve the user id passed from creating the plan to executing it?

tying a login name to a payer

Options
derbysoft
Contributor

How is a subscriber object related to a billing plan? Cant see any documentation on this.

tying a login name to a payer

Options
derbysoft
Contributor

Also , there is no subscription class in the PHP SDK API

tying a login name to a payer

Options
MTS_Andre
Moderator

Hi, in the API you have tie together into the request to create a new subscription v1/billing/subscriptions the subscriber with a specific plan.

You can check this link

We can see that into the request you pass a plan_id and the subscriber object where you can set the email as well:

 

{
"plan_id": "P-5ML4271244454362WXNWU5NQ",
"start_time": "2018-11-01T00:00:00Z",
"quantity": "20",
"shipping_amount": {
"currency_code": "USD",
"value": "10.00"
},
"subscriber": {
"name": {
"given_name": "John",
"surname": "Doe"
},
"email_address": "customer@example.com",
"shipping_address": {
"name": {
"full_name": "John Doe"
},
"address": {
"address_line_1": "2211 N First Street",
"address_li

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.