Advertisement
Guest User

PHP CURL Tranzilla

a guest
Jul 25th, 2011
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $host = 'https://secure5.tranzilla.com/31.cgi';
  5.  
  6. $params = array(
  7.     'supplier' => 'Supplier',
  8.     'sum' => '10.00',
  9.     'price' => '5.00',
  10.     'cname' => 'Product',
  11.     'city' => 'Street',
  12.     'zipCode' => '332311',
  13.     'email' => 'example@example.com',
  14.     'cardNum' => '9999999999',
  15.     'eYear' => '2015',
  16.     'eMonth' => '2015',
  17.     'first_name' => 'First Name',
  18.     'supplier' => 'SUPPNUMBER'
  19. );
  20.  
  21. try
  22. {
  23.     $curl= curl_init();
  24.     curl_setopt($curl, CURLOPT_URL, $host);
  25.     curl_setopt($curl, CURLOPT_POST, 1);
  26.     curl_setopt($curl, CURLOPT_FAILONERROR, true);
  27.     curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
  28.     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  29.     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
  30.     $result = curl_exec($ch);
  31.     curl_close($curl);
  32.    
  33.     $error = curl_error($curl_connection);
  34.     if ( ! empty($error)) { die($error); }
  35. }
  36. catch (ErrorException $e)
  37. {
  38.     die($e->getMessage());
  39. }
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement