Payment_Process2
[ class tree: Payment_Process2 ] [ index: Payment_Process2 ] [ all elements ]

Source for file TrustCommerce_creditcard.php

Documentation is available at TrustCommerce_creditcard.php

  1. <?php
  2. require_once 'Payment/Process2.php';
  3. require_once 'HTTP/Request2.php';
  4.  
  5. $options = array();
  6. $options['debug'= TRUE;
  7.  
  8. $request = new HTTP_Request2();
  9. $request->setConfig('ssl_verify_peer'false)// Remove this line if using in production, install the certificate
  10.  
  11. $process Payment_Process2::factory('TrustCommerce'$options);
  12. $process->setRequest($request);
  13.  
  14. $process->_debug = true;
  15. $process->login = 'TestMerchant';
  16. $process->password = 'password';
  17. $process->action = Payment_Process2::ACTION_NORMAL;
  18. $process->amount = 99.99;
  19.  
  20. $card Payment_Process2_Type::factory('CreditCard');
  21. $card->setDate(strtotime('2004-01-01'));
  22. $card->type = Payment_Process2_Type::CC_VISA;
  23. $card->cardNumber = '4111111111111111';
  24. $card->expDate = '01/2005';
  25.  
  26. $process->setPayment($card);
  27. $result $process->process();
  28.  
  29. echo 'Processor result: ' "\n";
  30. echo $result->getCode()." - ";
  31. echo $result->getMessage("\n";

Documentation generated on Mon, 11 Mar 2019 15:40:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.