0

I'll be serving this via PHP, so it'll be more difficult to hijack. It's a temporary solution that'll be manually reviewed, so I'm not particularly worried about security. But, I was wondering if it's possible to create a link that would work with variables? Something like this:

https://paypal.com/pay?type=link&price=55aud&item=coffee

After thoroughly searching PP's API documentation I can't find anything of the type.

Jamus
  • 865
  • 4
  • 11
  • 28
  • 1
    such as any paypal 'buy now' button currently in existence? –  Jan 06 '14 at 01:41
  • possible duplicate of [Dynamic Paypal button encryption](http://stackoverflow.com/questions/4106376/dynamic-paypal-button-encryption) – Ast Derek Jan 06 '14 at 01:45

1 Answers1

0

Of course. You just need to build your string dynamically with PHP. For example, using your link sample, we might end up with something like this:

$price = 55;
$item = 'coffee';
$currency_code = 'aud';

$paypal_url = 'https://paypal.com/pay?type=link&price='.$price.'&currency_code='.$currency_code.'&item='.$item;

Of course, you could use static variables like I did here, or you could load the URL items with session variables, database data, etc. Once the URL is prepared you can output it and attach it to a link, button, simply redirect straight to it, or whatever you need to do.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51