// Email Address: test@bluepay.com
$payment->setEmail('*****@*****.**');
/* RUN A $0.00 CREDIT CARD AUTH */
$payment->auth('0.00');
$payment->process();
// If transaction was approved..
if ($payment->getStatus() == "APPROVED") {
    $updateRebillPaymentInformation = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
    // Creates a new transaction that reflects a customer's updated card expiration date
    // Card Number: 4111111111111111
    // Card Expire: 01/21
    $updateRebillPaymentInformation->setCCInformation('4111111111111111', '0121');
    // Stores new card expiration date
    $updateRebillPaymentInformation->auth("0.00", $payment->getTransID());
    $updateRebillPaymentInformation->process();
    $updateRebill = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
    // Updates rebill using Rebill ID token returned
    // Rebill Start Date: March 1, 2015
    // Rebill Frequency: 1 MONTH
    // Rebill # of Cycles: 8
    // Rebill Amount: $5.15
    // Rebill Next Amount: $1.50
    $updateRebill->updateRebillingCycle($payment->getRebillID(), '2015-03-01', '1 MONTH', '8', '5.15', '1.50');
    // Updates the payment information portion of the rebilling cycle to the
    // new card expiration date entered above
    $updateRebill->updateRebillingPaymentInformation($updateRebillPaymentInformation->getTransID());
    $updateRebill->process();
    # Read response from BluePay
    echo 'Rebill ID: ' . $updateRebill->getRebillID() . '<br />' . 'Template ID: ' . $updateRebill->getTemplateID() . '<br />' . 'Rebill Status: ' . $updateRebill->getRebStatus() . '<br />' . 'Rebill Creation Date: ' . $updateRebill->getCreationDate() . '<br />' . 'Rebill Next Date: ' . $updateRebill->getNextDate() . '<br />' . 'Rebill Last Date: ' . $updateRebill->getLastDate() . '<br />' . 'Rebill Expression: ' . $updateRebill->getSchedExpr() . '<br />' . 'Rebill Cycles Remaining: ' . $updateRebill->getCyclesRemaining() . '<br />' . 'Rebill Amount: ' . $updateRebill->getRebAmount() . '<br />' . 'Rebill Next Amount Charged: ' . $updateRebill->getNextAmount();
} else {
    echo $payment->getMessage();
*
* This code sample runs a $0.00 Credit Card Auth transaction
* against a customer using test payment information.
* This stores the customer's payment information securely in
* BluePay to be used for further transactions.
* Note: THIS DOES NOT ENSURE THAT THE CREDIT CARD OR ACH
* ACCOUNT IS VALID.
*/
include "BluePayPayment_BP10Emu.php";
$accountID = "MERCHANT'S ACCOUNT ID HERE";
$secretKey = "MERCHANT'S SECRET KEY HERE";
$mode = "TEST";
// Merchant's Account ID
// Merchant's Secret Key
// Transaction Mode: TEST (can also be LIVE)
$payment = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
// First Name: Bob
// Last Name: Tester
// Address1: 123 Test St.
// Address2: Apt #500
// City: Testville
// State: IL
// Zip: 54321
// Country: USA
$payment->setCustomerInformation('Bob', 'Tester', '123 Test St.', 'Apt #500', 'Testville', 'IL', '54321', 'USA');
// Card Number: 4111111111111111
// Card Expire: 12/15
// Card CVV2: 123
$payment->setCCInformation('4111111111111111', '1215', '123');
// Phone #: 123-123-1234
$payment->setPhone('1231231234');
// State: IL
// Zip: 54321
// Country: USA
$payment->setCustomerInformation('Bob', 'Tester', '123 Test St.', 'Apt #1009', 'Testville', 'IL', '54321', 'USA');
// Card Number: 4111111111111111
// Card Expire: 12/15
// Card CVV2: 123
$payment->setCCInformation('4111111111111111', '1215', '123');
// Rebill Start Date: Jan. 5, 2015
// Rebill Frequency: 1 MONTH
// Rebill # of Cycles: 5
// Rebill Amount: $3.50
$payment->setRebillingInformation('2015-01-05', '1 MONTH', '5', '3.50');
// Phone #: 123-123-1234
$payment->setPhone('1231231234');
// Email Address: test@bluepay.com
$payment->setEmail('*****@*****.**');
/* RUN A $0.00 CREDIT CARD AUTH */
$payment->auth('0.00');
$payment->process();
// If transaction was approved..
if ($payment->getStatus() == "APPROVED") {
    $cancelRebill = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
    // Cancels rebill above using Rebill ID token returned
    $cancelRebill->cancelRebillingCycle($payment->getRebillID());
    $cancelRebill->process();
    // Read response from BluePay
    echo 'Rebill ID: ' . $cancelRebill->getRebillID() . '<br />' . 'Template ID: ' . $cancelRebill->getTemplateID() . '<br />' . 'Rebill Status: ' . $cancelRebill->getRebStatus() . '<br />' . 'Rebill Creation Date: ' . $cancelRebill->getCreationDate() . '<br />' . 'Rebill Next Date: ' . $cancelRebill->getNextDate() . '<br />' . 'Rebill Last Date: ' . $cancelRebill->getLastDate() . '<br />' . 'Rebill Expression: ' . $cancelRebill->getSchedExpr() . '<br />' . 'Rebill Cycles Remaining: ' . $cancelRebill->getCyclesRemaining() . '<br />' . 'Rebill Amount: ' . $cancelRebill->getRebAmount() . '<br />' . 'Rebill Next Amount Charged: ' . $cancelRebill->getNextAmount();
} else {
    echo $payment->getMessage();
}
* BluePay PHP 5 Sample Code
*
* This code sample runs a $15.00 Credit Card Sale transaction
* against a customer using test payment information.
* Optional transaction data is also sent.
* If using TEST mode, odd dollar amounts will return
* an approval and even dollar amounts will return a decline.
*/
include "BluePayPayment_BP10Emu.php";
$accountID = "MERCHANT'S ACCOUNT ID HERE";
$secretKey = "MERCHANT'S SECRET KEY HERE";
$mode = "TEST";
// Merchant's Account ID
// Merchant's Secret Key
// Transaction Mode: TEST (can also be LIVE)
$payment = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
// First Name: Bob
// Last Name: Tester
// Address1: 123 Test St.
// Address2: Apt #500
// City: Testville
// State: IL
// Zip: 54321
// Country: USA
$payment->setCustomerInformation('Bob', 'Tester', '123 Test St.', 'Apt #500', 'Testville', 'IL', '54321', 'USA');
// Card Number: 4111111111111111
// Card Expire: 12/15
// Card CVV2: 123
$payment->setCCInformation('4111111111111111', '1215', '123');
// Phone #: 123-123-1234
$payment->setPhone('1231231234');
<?php

/**
* BluePay PHP Sample code.
*
* This code sample runs a report that grabs data from the
* BluePay gateway based on certain criteria. This will ONLY return
* transactions that have already settled. See comments below
* on the details of the report.
* If using TEST mode, only TEST transactions will be returned.
*/
include "BluePayPayment_BP10Emu.php";
$accountID = "100013391447";
$secretKey = "5YRFNRBCZN/6Y4OPZNWPYDRNAVX7BMMD";
$mode = "TEST";
// Merchant's Account ID
// Merchant's Secret Key
// Transaction Mode: TEST (can also be LIVE)
$report = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
/* RUN A REPORT FOR SETTLED TRANSACTIONS */
// Report Start Date: Jan. 1, 2013
// Report End Date: Jan. 15, 2013
// Also search subaccounts? Yes
// Output response without commas? Yes
// Do not include errored transactions? Yes
$report->getSettledTransactionReport('2013-01-01', '2013-01-15', '1', '1', '1');
$report->process();
// Read response from BluePay
echo 'Response: ' . $report->getResponse() . '<br />';
// First Name: Bob
// Last Name: Tester
// Address1: 123 Test St.
// Address2: Apt #500
// City: Testville
// State: IL
// Zip: 54321
// Country: USA
$payment->setCustomerInformation('Bob', 'Tester', '123 Test St.', 'Apt #500', 'Testville', 'IL', '61123', 'USA');
// Card Number: 4111111111111111
// Card Expire: 12/15
// Card CVV2: 123
$payment->setCCInformation('4111111111111111', '1215', '123');
// Phone #: 123-123-1234
$payment->setPhone('1231231234');
// Email Address: test@bluepay.com
$payment->setEmail('*****@*****.**');
/* RUN A $3.00 CREDIT CARD AUTH */
$payment->auth('3.00');
$payment->process();
// If transaction was approved..
if ($payment->getStatus() == "APPROVED") {
    $paymentCapture = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
    // Attempts to capture above Auth transaction
    $paymentCapture->capture($payment->getTransID());
    $paymentCapture->process();
    // Read response from BluePay
    echo 'Status: ' . $payment->getStatus() . '<br />' . 'Message: ' . $payment->getMessage() . '<br />' . 'Transaction ID: ' . $payment->getTransID() . '<br />' . 'AVS Response: ' . $payment->getAVSResponse() . '<br />' . 'CVS Response: ' . $payment->getCVV2Response() . '<br />' . 'Masked Account: ' . $payment->getMaskedAccount() . '<br />' . 'Card Type: ' . $payment->getCardType() . '<br />' . 'Authorization Code: ' . $payment->getAuthCode() . '<br />';
} else {
    echo $payment->getMessage();
}
$payment = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
// First Name: Bob
// Last Name: Tester
// Address1: 123 Test St.
// Address2: Apt #500
// City: Testville
// State: IL
// Zip: 54321
// Country: USA
$payment->setCustomerInformation('Bob', 'Tester', '123 Test St.', 'Apt #500', 'Testville', 'IL', '54321', 'USA');
// Card Number: 4111111111111111
// Card Expire: 12/15
// Card CVV2: 123
$payment->setCCInformation('4111111111111111', '1215', '123');
// Phone #: 123-123-1234
$payment->setPhone('1231231234');
// Email Address: test@bluepay.com
$payment->setEmail('*****@*****.**');
/* RUN A $3.00 CREDIT CARD SALE */
$payment->sale('3.00');
$payment->process();
// If transaction was approved..
if ($payment->getStatus() == "APPROVED") {
    $cancelPayment = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
    $cancelPayment->void($payment->getTransID());
    $cancelPayment->process();
    // Read response from BluePay
    echo 'Status: ' . $payment->getStatus() . '<br />' . 'Message: ' . $payment->getMessage() . '<br />' . 'Transaction ID: ' . $payment->getTransID() . '<br />' . 'AVS Response: ' . $payment->getAVSResponse() . '<br />' . 'CVS Response: ' . $payment->getCVV2Response() . '<br />' . 'Masked Account: ' . $payment->getMaskedAccount() . '<br />' . 'Card Type: ' . $payment->getCardType() . '<br />' . 'Authorization Code: ' . $payment->getAuthCode() . '<br />';
} else {
    echo $payment->getMessage();
}
$payment = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
// First Name: Bob
// Last Name: Tester
// Address1: 123 Test St.
// Address2: Apt #500
// City: Testville
// State: IL
// Zip: 54321
// Country: USA
$payment->setCustomerInformation('Bob', 'Tester', '123 Test St.', 'Apt #1009', 'Testville', 'IL', '54321', 'USA');
// Card Number: 4111111111111111
// Card Expire: 12/15
// Card CVV2: 123
$payment->setCCInformation('4111111111111111', '1215', '123');
// Phone #: 123-123-1234
$payment->setPhone('1231231234');
// Email Address: test@bluepay.com
$payment->setEmail('*****@*****.**');
/* RUN A $3.00 CREDIT CARD SALE */
$payment->sale('3.00');
$payment->process();
// If transaction was approved..
if ($payment->getStatus() == "APPROVED") {
    $paymentRefund = new BluePayPayment_BP10Emu($accountID, $secretKey, $mode);
    $paymentRefund->capture($payment->getTransID());
    $paymentRefund->process();
    // Read response from BluePay
    echo 'Status: ' . $payment->getStatus() . '<br />' . 'Message: ' . $payment->getMessage() . '<br />' . 'Transaction ID: ' . $payment->getTransID() . '<br />' . 'AVS Response: ' . $payment->getAVSResponse() . '<br />' . 'CVS Response: ' . $payment->getCVV2Response() . '<br />' . 'Masked Account: ' . $payment->getMaskedAccount() . '<br />' . 'Card Type: ' . $payment->getCardType() . '<br />' . 'Authorization Code: ' . $payment->getAuthCode() . '<br />';
} else {
    echo $payment->getMessage();
}