Skip to content

Instantly share code, notes, and snippets.

@v9n
Created June 4, 2011 05:29
Show Gist options
  • Select an option

  • Save v9n/1007620 to your computer and use it in GitHub Desktop.

Select an option

Save v9n/1007620 to your computer and use it in GitHub Desktop.
Generate checkout link and use with Secret Paypal
<?php
include '../secretpaypal/paypal.php';
$paypal = new SecretPaypal();
$checkoutLink1 = $paypal->getLink('book1.pdf',
array(
'amount' => 29.99,
'item_name' => 'My Book',
'return' => 'http://house.axcoto.com/example/return.html',
'cancel_return' => 'http://house.axcoto.com/example/cancel.html',
)
);
$checkoutLink2 = $paypal->getLink('mybook.zip',
array(
'amount' => 29.99,
'item_name' => 'My Book',
'return' => 'http://house.axcoto.com/example/return.html',
'cancel_return' => 'http://house.axcoto.com/example/cancel.html',
)
);
$mp3Link = $paypal->getLink('my_sound.mp3',
array(
'amount' => 29.99,
'item_name' => 'My Book',
'return' => 'http://house.axcoto.com/example/return.html',
'cancel_return' => 'http://house.axcoto.com/example/cancel.html',
)
);
$pictureLink = $paypal->getLink('picture_cat.png',
array(
'amount' => 29.99,
'item_name' => 'My Book',
'return' => 'http://house.axcoto.com/example/return.html',
'cancel_return' => 'http://house.axcoto.com/example/cancel.html',
)
);
?>
<a href="<?php echo $checkoutLink1 ?>">
<img src="http://placekitten.com/101/80"><br />
Buy Now
</a>
<a href="<?php echo $checkoutLink2 ?>">
<img src="http://placekitten.com/101/80"><br />
Buy This
</a>
<a href="<?php echo $mp3Link ?>">
<img src="http://placekitten.com/101/80"><br />
Buy This Song
</a>
<a href="<?php echo $pictureLink ?>">
<img src="http://placekitten.com/101/80"><br />
Buy This Picture
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment