PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Chris Kois   Bluepay   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Bluepay v0.01 Example
Class: Bluepay
Process credit card payments using BluePay gateway
Author: By
Last change:
Date: 15 years ago
Size: 975 bytes
 

Contents

Class file image Download
<?php
//
// Example of usage for Services_Bluepay
//

include "Bluepay.php";

//-- Run transaction using bp20post interface
$bp = new Services_Bluepay();
$bp->setValue("ACCOUNT_ID", '100008088837');
$bp->setValue("SECRET_KEY", 'OYWEV/LJQBKLGHSGKTVUPVIQTNQ8MFF0');
$bp->setValue("TRANS_TYPE", 'SALE');
$bp->setValue("MODE", 'TEST'); # Default is TEST --> Set to LIVE for live tx
$bp->setValue("AMOUNT", '3.01'); # ODD returns Approved, EVEN returns Declined in TEST mode
$bp->setValue("PAYMENT_ACCOUNT", '4111111111111111'); # VISA Test Card
$bp->setValue("CARD_EXPIRE", '0808');
$bp->bp20post();
//-- Display Response
echo "TRANS_ID: " . $bp->getValue("TRANS_ID") . "\n";
echo
"STATUS: " . $bp->getValue("STATUS") . "\n";
echo
"AVS: " . $bp->getValue("AVS") . "\n";
echo
"CVV2: " . $bp->getValue("CVV2") . "\n";
echo
"AUTH_CODE: " . $bp->getValue("AUTH_CODE") . "\n";
echo
"MESSAGE: " . $bp->getValue("MESSAGE") . "\n";
echo
"REBID: " . $bp->getValue("REBID") . "\n";
?>