Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sample_Code/PHP/BluePayPayment_BP10Emu.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class BluePayPayment_BP10Emu {
// $accID : Merchant's Account ID
// $secretKey : Merchant's Secret Key
// $mode : Transaction mode of either LIVE or TEST (default)
public function BluePayPayment_BP10Emu($accID, $secretKey, $mode) {
public function __construct($accID, $secretKey, $mode) {
$this->accountID = $accID;
$this->secretKey = $secretKey;
$this->mode = $mode;
Expand Down Expand Up @@ -360,7 +360,9 @@ public function http_parse_headers($header) {
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
foreach( $fields as $field ) {
if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {
$match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
$match[1] = preg_replace_callback('/(?<=^|[\x09\x20\x2D])./', function ($match) {
return strtoupper($match[0]);
}, strtolower(trim($match[1])));
if( isset($retVal[$match[1]]) ) {
if (!is_array($retVal[$match[1]])) {
$retVal[$match[1]] = array($retVal[$match[1]]);
Expand Down