PHP Classes

File: ach_test.php

Recommend this page to a friend!
  Classes of Marc Guyer   ACH   ach_test.php   Download  
File: ach_test.php
Role: Example script
Content type: text/plain
Description: sample usage script
Class: ACH
ACH Direct raw post method using curl
Author: By
Last change:
Date: 21 years ago
Size: 2,278 bytes
 

Contents

Class file image Download
<html>
<head>
    <title>Untitled</title>
    <link rel="stylesheet" type="text/css" href="ach.css">
</head>

<body>

<?
if ($actn=='pay'){
    require (
'ACH_core.class.php');
    require (
'ACH.class.php');
   
$payarr = array_merge($_POST, array('pg_customer_ip_address'=>$ip));
   
$payment = new ACH($_POST['pg_merchant_id'], $_POST['pg_password'], $payarr, array('actn') );
    echo
$payment->getDisplayText(
        array(
       
'A'=>'', //link to display in left footer for Approved payments
       
'D'=>'<a href=javascript:history.back()>&lt;&lt; Go Back</a>',//link in left footer for Declined payments
       
'E'=>'<a href=javascript:history.back()>&lt;&lt; Go Back</a>'),//link in left footer for Error payments
       
array(
       
'A'=>'<a href=http://www.paymentsgateway.net>To PaymentsGateway &gt;&gt;</a>',// right footer
       
'D'=>'<a href=http://www.paymentsgateway.net>To PaymentsGateway &gt;&gt;</a>',// right footer
       
'E'=>'<a href=http://www.paymentsgateway.net>To PaymentsGateway &gt;&gt;</a>')// right footer
       
);
} else {
   
$inputs = array (
       
'pg_merchant_id' => "", 'pg_password' => "",
       
'pg_transaction_type' => "20", 'pg_total_amount' => "1",
       
// EFT
       
'ecom_payment_check_trn' => "123456", 'ecom_payment_check_account' => "123456",
       
'ecom_payment_check_account_type' => "C",
       
// IDs
       
'pg_consumer_id' => "", 'ecom_consumerorderid' => "",
       
// BILLING INFO
       
'ecom_billto_postal_name_first' => "Joe", 'ecom_billto_postal_name_last' => "Payer",
       
'ecom_billto_postal_street_line1' => "123 ACH Lane", 'ecom_billto_postal_street_line2' => "101",
       
'ecom_billto_postal_city' => "San Diego", 'ecom_billto_postal_stateprov' => "CA",
       
'ecom_billto_postal_postalcode' => "12345", 'ecom_billto_postal_countrycode' => "",
       
'ecom_billto_telecom_phone_number' => "", 'ecom_billto_online_email' => "",
       
'pg_billto_ssn' => "", 'pg_billto_dl_number' => "",
       
'pg_billto_dl_state' => ""
   
);
   
?>
<form action=ach_test.php method=post>
    <input type=hidden name='actn' value='pay'>
    <table border=0>
    <?
   
foreach($inputs as $k=>$v){
       
?>
<tr><td><?= $k ?> : </td><td><input type=text name='<?= $k ?>' value='<?= $v ?>'></td></tr>
        <?
   
}
   
?>
</table>
    <input type=submit>
    </form>
    <?
}
?>

</body>
</html>