PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, July 4, 2022

[FIXED] How to create a paypal link from user's email address to send money to them?

 July 04, 2022     javascript, payment, paypal     No comments   

Issue

I want to create a way to dynamically generate paypal links where the receiver is already set by their email address (and amount). I know that paypal has the "paypal.me" feature for this, but to use it the user has to create it by themselves first. Example: https://paypal.com/sendMoney?receiver=paul@gmail.com&amount=10$


Solution

You cannot use the "send money" flow for this, but you can make a regular PayPal payment go to any destination email. Via https://www.paypal.com/buttons , create a Buy Now button and in Step 2 uncheck the option to save the button at PayPal. After clicking to create, switch to the "Email" tab. This results in a link like the following:

https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=xxxxxxxxxx&lc=US&button_subtype=services&no_note=0&cn=Add%20special%20instructions%20to%20the%20seller%3a&no_shipping=2&currency_code=USD&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted

Which can be simplified to:

https://www.paypal.com/webscr?cmd=_xclick&item_name=Purpose%20of%20payment%20goes%20here&amount=&currency_code=USD&business=somereceiver@emaildomain.com


The above satisfies your request for a link. If you want a nice looking button and in-context flow that doesn't redirect away from your site, start with a regular PayPal Checkout integration and add a payee parameter in the createOrder payload, as documented here.



Answered By - Preston PHX
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing