Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.14 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <title></title>
  5. </head>
  6. <body>
  7. <?php
  8. $x_login = "HCO-OC-GR-821";  //  Take from Payment Page ID in Payment Pages interface
  9. $transaction_key = "AjJlGuzNwLFv2kP0v_gJ"; // Take from Payment Pages configuration interface
  10. $x_amount = "595.00";
  11. $x_currency_code = "USD"; // Needs to agree with the currency of the payment page
  12. //srand(time()); // initialize random generator for x_fp_sequence
  13. $x_fp_sequence = rand(1000, 100000) + 123456;
  14.  
  15. $fecha = new DateTime();
  16. $x_fp_timestamp = $fecha->getTimestamp();//time(); // needs to be in UTC. Make sure webserver produces UTC
  17. date_default_timezone_set('UTC');//importante settear timezone en UTC
  18. $hmac_data = $x_login . "^" . $x_fp_sequence . "^" . $x_fp_timestamp . "^" . $x_amount . "^" . $x_currency_code;
  19. $x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);
  20. ?>
  21. <!--<form action="https://checkout.globalgatewaye4.firstdata.com/payment" method="post"> -->
  22.   <h1>
  23.     Payment Pages: Sample PHP Payment Form 2
  24.   </h1>
  25.   <form action="https://demo.globalgatewaye4.firstdata.com/payment" method="POST">
  26.     <label>x_login</label>
  27.     <input name="x_login" value="<?= $x_login;?>" type="text">
  28.     <br>
  29.     <label>x_amount</label>
  30.     <input name="x_amount" value="<?= $x_amount;?>" type="text">
  31.     <br>
  32.     <label>x_fp_sequence</label>
  33.     <input name="x_fp_sequence" value="<?= $x_fp_sequence;?>" type="text">
  34.     <br>
  35.     <label>x_fp_timestamp</label>
  36.     <input name="x_fp_timestamp" value="<?= $x_fp_timestamp;?>" type="text">
  37.     <br>
  38.     <label>x_fp_hash</label>
  39.     <input name="x_fp_hash" value="<?= $x_fp_hash;?>" type="text">
  40.     <br>
  41.     <input name="x_show_form" value="PAYMENT_FORM" type="text">
  42.  
  43.     <input value="Checkout" type="submit">
  44.  
  45.     <input name="x_tax" value="26.59" type="text">
  46.  
  47.     <input name="x_freight" value="45.0" type="text">
  48.  
  49.     <input name="x_line_item" value="10<|>1999 Cabernet Sauvignon, 0.7 l<|>1999 Cabernet Sauvignon, 0.7 l <|>10<|>19.95<|>YES" type="text">  
  50.  
  51.     <input name="x_line_item" value="12<|>2003 Merlot, 0.7 l<|>2003 Merlot, 0.7 l<|>12<|>23.95<|>YES" type="text">
  52.  
  53.   </form>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement