PHP Classes
elePHPant
Icontem

File: test/hsbc/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andreas Kollaros  >  Aktive Merchant  >  test/hsbc/index.php  >  Download  
File: test/hsbc/index.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Aktive Merchant
Common interface to process payments with gateways
Author: By
Last change:
Date: 3 years ago
Size: 737 bytes
 

Contents

Class file image Download
<?php
require_once('../../lib/merchant.php');
require_once(
'../login.php');

Merchant_Billing_Base::mode('test');

$gateway = new Merchant_Billing_HsbcSecureEpayments(array(
   
'login' => HSBC_LOGIN,
   
'password' => HSBC_PASS,
   
'client_id' => HSBC_CLIENT_ID,
   
'currency' => 'EUR'
 
)
);

$cc = new Merchant_Billing_CreditCard( array(
   
"first_name" => "Test",
   
"last_name" => "User",
   
"number" => "4007000000027",
   
"month" => "12",
   
"year" => "2012",
   
"verification_value" => "123"
 
)
);

try {
 
$response = $gateway->authorize('1', $cc);
  if (
$response->success() ) {
    echo
'Success authorize!';
  } else {
    echo
$response->message();
  }
} catch (
Exception $exc) {
  echo
$exc->getMessage();
}


?>