本文整理汇总了PHP中litle\sdk\LitleOnlineRequest::voidRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP LitleOnlineRequest::voidRequest方法的具体用法?PHP LitleOnlineRequest::voidRequest怎么用?PHP LitleOnlineRequest::voidRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类litle\sdk\LitleOnlineRequest
的用法示例。
在下文中一共展示了LitleOnlineRequest::voidRequest方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_simple_void
public function test_simple_void()
{
$hash_in = array('litleTxnId' => '123456789012345678');
$initilaize = new LitleOnlineRequest();
$voidResponse = $initilaize->voidRequest($hash_in);
$response = XmlParser::getAttribute($voidResponse, 'litleOnlineResponse', 'response');
$this->assertEquals('0', $response);
}
示例2: test_loggedInUser
public function test_loggedInUser()
{
$hash_in = array('id' => 'id', 'litleTxnId' => '123123', 'merchantSdk' => 'PHP;8.14.0', 'reportGroup' => 'Planets', 'loggedInUser' => 'gdake');
$mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
$mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*merchantSdk="PHP;8.14.0".*loggedInUser="gdake" xmlns=.*>.*/'));
$litleTest = new LitleOnlineRequest();
$litleTest->newXML = $mock;
$litleTest->voidRequest($hash_in);
}
示例3: test_VoidSettledTransaction
public function test_VoidSettledTransaction()
{
$auth_hash = array('orderId' => '1', 'amount' => '10010', 'orderSource' => 'ecommerce', 'card' => array('number' => '375001010000003', 'expDate' => '0112', 'cardValidationNum' => '1313', 'type' => 'AX'));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$capture_hash = array('litleTxnId' => XmlParser::getNode($authorizationResponse, 'litleTxnId'));
$captureResponse = $initilaize->captureRequest($capture_hash);
//echo $captureResponse;
$this->assertEquals('000', XmlParser::getNode($captureResponse, 'response'));
$void_hash1 = array('litleTxnId' => 362);
$voidResponse1 = $initilaize->voidRequest($void_hash1);
$this->assertEquals('362', XmlParser::getNode($voidResponse1, 'response'));
$credit_hash = array('litleTxnId' => XmlParser::getNode($captureResponse, 'litleTxnId'));
$creditResponse = $initilaize->creditRequest($credit_hash);
$this->assertEquals('000', XmlParser::getNode($creditResponse, 'response'));
$void_hash2 = array('litleTxnId' => XmlParser::getNode($creditResponse, 'litleTxnId'));
$voidResponse2 = $initilaize->voidRequest($void_hash2);
$this->assertEquals('000', XmlParser::getNode($voidResponse2, 'response'));
}
示例4: test_6_sale
public function test_6_sale()
{
$sale_hash = array('orderId' => '6', 'amount' => '60060', 'orderSource' => 'ecommerce', 'billToAddress' => array('name' => 'Joe Green', 'addressLine1' => '6 Main St.', 'city' => 'Derry', 'state' => 'NH', 'zip' => '03038', 'country' => 'US'), 'card' => array('number' => '4457010100000008', 'expDate' => '0612', 'type' => 'VI', 'cardValidationNum' => '992'));
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($sale_hash);
$this->assertEquals('110', XmlParser::getNode($saleResponse, 'response'));
$this->assertEquals('Insufficient Funds', XmlParser::getNode($saleResponse, 'message'));
$this->assertEquals('34', XmlParser::getNode($saleResponse, 'avsResult'));
$this->assertEquals('P', XmlParser::getNode($saleResponse, 'cardValidationResult'));
$void_hash = array('litleTxnId' => XmlParser::getNode($saleResponse, 'litleTxnId'), 'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$voidResponse = $initilaize->voidRequest($void_hash);
$this->assertEquals('360', XmlParser::getNode($voidResponse, 'response'));
$this->assertEquals('No transaction found with specified litleTxnId', XmlParser::getNode($voidResponse, 'message'));
}
示例5: array
function test_5_sale()
{
$sale_hash = array('id' => '1211', 'orderId' => '5', 'amount' => '50050', 'orderSource' => 'ecommerce', 'card' => array('number' => '4457010200000007', 'expDate' => '0512', 'cardValidationNum' => '463', 'type' => 'VI'), 'cardholderAuthentication' => array('authenticationValue' => 'BwABBJQ1AgAAAAAgJDUCAAAAAAA='));
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($sale_hash);
$this->assertEquals('000', XmlParser::getNode($saleResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($saleResponse, 'message'));
$this->assertEquals('55555 ', XmlParser::getNode($saleResponse, 'authCode'));
$this->assertEquals('32', XmlParser::getNode($saleResponse, 'avsResult'));
$this->assertEquals('N', XmlParser::getNode($saleResponse, 'cardValidationResult'));
//test 5B
$credit_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($saleResponse, 'litleTxnId'), 'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$creditResponse = $initilaize->creditRequest($credit_hash);
$this->assertEquals('001', XmlParser::getNode($creditResponse, 'response'));
$this->assertEquals('Transaction Received', XmlParser::getNode($creditResponse, 'message'));
//test 5C
$void_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($creditResponse, 'litleTxnId'), 'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$voidResponse = $initilaize->voidRequest($void_hash);
$this->assertEquals('001', XmlParser::getNode($voidResponse, 'response'));
$this->assertEquals('Transaction Received', XmlParser::getNode($voidResponse, 'message'));
}
示例6: voidRequest
/**
* Make a void API request.
*
* This method wraps the LitleOnlineRequest.
*
* @param array $hash_in
* The request data.
*
* @return DOMDocument|SimpleXMLElement
* The response.
*/
public function voidRequest($hash_in)
{
return $this->request->voidRequest($hash_in);
}
示例7: test_void
public function test_void()
{
$hash_in = array('litleTxnId' => '123456789012345678', 'id' => '1211');
$litle = new LitleOnlineRequest($treeResponse = true);
$response = $litle->voidRequest($hash_in);
$this->assertEquals('0', $response['response']);
}