Posted By

mikael12 on 10/05/10


Tagged

paypal-xclick


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

boetech


PayPal xclick payment


 / Published in: PHP
 

PayPal test account can be created at https://developer.paypal.com/ HTML Variables for Website Payments Standard at https://cms.paypal.com/us/cgi-bin/?&cmd=render-content&contentID=developer/ehowtohtmlAppxwebsitestandard_htmlvariables

  1. define('PAYPAL_BUSINESS', '[email protected]');
  2. define('PAYPAL_URL', 'https://www.paypal.com/cgi-bin/webscr');
  3. define('PAYPAL_RETURN_URL', 'http://www.domain.com/process-paypal-response.php');
  4.  
  5. $amount = explode('.', number_format($post_price, 2));
  6. $paypal_data = array(
  7. 'cmd' => '_xclick',
  8. 'business' => PAYPAL_BUSINESS,
  9. 'item_name' => 'Order '.$order_id,
  10. 'item_number' => $order_id,
  11. 'amount' => $amount[0].'.'.$amount[1],
  12. 'currency_code' => 'EUR',
  13. 'button_subtype' => 'services',
  14. 'no_shipping' => 1,
  15. 'custom' => 'buy_now',
  16. 'return' => PAYPAL_RETURN_URL
  17. );
  18.  
  19. header('Location: '.PAYPAL_URL.'?'.http_build_query($paypal_data));

Report this snippet  

You need to login to post a comment.