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

Source for file linkpoint.php

Documentation is available at linkpoint.php

  1. <?php
  2.  
  3. require_once('Payment/Process.php');
  4.  
  5. $options = array();
  6.  
  7. // If you have a test store on the staging server uncomment these
  8. // $options['host'] = 'staging.linkpt.net';  
  9. // $options['port'] = '1129';
  10.  
  11. // Path to your keyfile (the pem file given to you by linkpiont)
  12. $options['keyfile''/path/to/your/keyfile.pem';
  13.  
  14. $process Payment_Process::factory('LinkPoint',$options);
  15. if (!PEAR::isError($process)) {
  16.     $process->_debug = true;
  17.     $process->login = 'xxxxxxxxxx'// Your linkpoint store ID
  18.     $process->password = '12345678'// Your store's password
  19.     $process->action = PAYMENT_PROCESS_ACTION_AUTHONLY;
  20.     $process->amount = 1.00;
  21.  
  22.     $card Payment_Process_Type::factory('CreditCard');
  23.     if (!PEAR::isError($card)) {
  24.         $card->type = PAYMENT_PROCESS_CC_VISA;
  25.         $card->invoiceNumber = 112345145;
  26.         $card->customerId = 1461264151;
  27.         $card->cardNumber = '411111111111111';
  28.         $card->expDate = '08/2008';
  29.         $card->zip = '98123';
  30.         $card->cvv = '444';
  31.  
  32.         if (Payment_Process_Type::isValid($card)) {
  33.             if(!$process->setPayment($card)) {
  34.                 die("Unable to set payment\n");
  35.             }
  36.  
  37.             $result $process->process();
  38.             if (PEAR::isError($result)) {
  39.                 echo "\n\n";
  40.                 echo $result->getMessage()."\n";
  41.             else {
  42.                 print_r($result);
  43.                 echo "\n";
  44.                 echo "---------------------- RESPONSE ------------------------\n";
  45.                 echo $result->getMessage()."\n";
  46.                 echo $result->getCode()."\n";
  47.                 $validate $result->validate();
  48.                 if(!PEAR::isError($validate)) {
  49.                     echo "All good\n";
  50.                 else {
  51.                     echo "ERROR: ".$validate->getMessage()."\n";
  52.                 }
  53.   
  54.                 echo "---------------------- RESPONSE ------------------------\n";
  55.             }
  56.         else {
  57.             echo 'Something is wrong with your card!'."\n";
  58.         }
  59.     else {
  60.       echo $card->getMessage()."\n";
  61.     }
  62. else {
  63.     echo $payment->getMessage()."\n";
  64. }
  65.  
  66. ?>

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