Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: Cybersource_request.php
<?php error_reporting(0); class Cybersource_request { private $api_key; private $secret_key; //private $timestamp; //private $nonce; private $return_url; private $cancel_url; public function __construct() { //$this->timestamp = $this->timestamp(); //$this->nonce = $this->nonce(); //$this->return_url = $this->return_url(); //$this->cancel_url = $this->cancel_url(); } // public function create_order($merchant_trade_no, $amount, $api_key, $secret_key, $params) { ini_set("error_reporting", 0); include(APPPATH.'/libraries/cyber_source_core/Cyber_source.php'); include(APPPATH.'/libraries/cyber_source_core/error_responses.php'); try { $soapClient = new ExtendedClient(WSDL_URL, array()); /* To see the functions and types that the SOAP extension can automatically generate from the WSDL file, uncomment this section:*/ /*$functions = $soapClient->__getFunctions(); echo "<pre>"; print_r($functions); $types = $soapClient->__getTypes(); print_r($types); die;*/ $request = new stdClass(); $request->merchantID = MERCHANT_ID; $merchantReferenceCode = "merchant_".time(); // Before using this example, replace the generic value with your own. $request->merchantReferenceCode = $merchantReferenceCode; // To help us troubleshoot any problems that you may encounter, // please include the following information about your PHP application. $request->clientLibrary = "PHP"; $request->clientLibraryVersion = phpversion(); $request->clientEnvironment = php_uname(); // This section contains a sample transaction request for the authorization // service with complete billing, payment card, and purchase (two items) information. $ccAuthService = new stdClass(); $ccAuthService->run = "true"; $request->ccAuthService = $ccAuthService; $billTo = new stdClass(); $billTo->firstName = $params['card_info']['fname']; $billTo->lastName = $params['card_info']['lname']; $billTo->street1 = $params['card_info']['street']; $billTo->city = $params['card_info']['city']; $billTo->state = $params['card_info']['state']; $billTo->postalCode = $params['card_info']['zip']; $billTo->country = $params['card_info']['country']; $billTo->email = $params['card_info']['email']; $billTo->ipAddress = $_SERVER['REMOTE_ADDR']; $request->billTo = $billTo; $card = new stdClass(); $card->accountNumber = $params['card_info']['accountNumber']; $card->expirationMonth = $params['card_info']['expirationMonth']; $card->expirationYear = $params['card_info']['expirationYear']; $request->card = $card; $purchaseTotals = new stdClass(); $purchaseTotals->currency = "USD"; $request->purchaseTotals = $purchaseTotals; /*$item0 = new stdClass(); $item0->unitPrice = "12.34"; $item0->quantity = "2"; $item0->id = "0";*/ $item1 = new stdClass(); $item1->unitPrice = $amount; $item1->id = $merchant_trade_no; $request->item = array($item1); // Update merchant id if($merchantReferenceCode){ $CI =& get_instance(); $CI->db->query("UPDATE tbl_gf_payments SET TransactionId = '$merchantReferenceCode', PaymentStatus = '1' WHERE PaymentId = '$merchant_trade_no'"); } $reply = $soapClient->runTransaction($request); foreach($errors as $error) { if($error['code'] == $reply->ccAuthReply->reasonCode) { //return $error['description'] .'<br>'. $reply; $reply->codeMessage = $error['description']; } } return $reply; // This section will show all the reply fields. // var_dump($reply); // To retrieve individual reply fields, follow these examples. /*printf( "decision = $reply->decision<br>" ); printf( "reasonCode = $reply->reasonCode<br>" ); printf( "requestID = $reply->requestID<br>" ); printf( "requestToken = $reply->requestToken<br>" ); printf( "ccAuthReply->reasonCode = " . $reply->ccAuthReply->reasonCode . "<br>");*/ } catch (SoapFault $exception) { return ($exception->getMessage()); //return (get_class($exception)); //return ($exception); } } }