本文整理汇总了PHP中litle\sdk\LitleOnlineRequest::captureRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP LitleOnlineRequest::captureRequest方法的具体用法?PHP LitleOnlineRequest::captureRequest怎么用?PHP LitleOnlineRequest::captureRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类litle\sdk\LitleOnlineRequest
的用法示例。
在下文中一共展示了LitleOnlineRequest::captureRequest方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_capture
public function test_capture()
{
$hash_in = array('id' => '1211', 'litleTxnId' => '1234567891234567891', 'amount' => '123');
$litle = new LitleOnlineRequest($treeResponse = true);
$response = $litle->captureRequest($hash_in);
$this->assertEquals('Transaction Received', $response->captureResponse->message);
}
示例2: test_simple_capture_with_partial
public function test_simple_capture_with_partial()
{
$hash_in = array('litleTxnId' => '1234567891234567891', 'patial' => 'true', 'amount' => '123');
$initilaize = new LitleOnlineRequest();
$captureResponse = $initilaize->captureRequest($hash_in);
$message = XmlParser::getAttribute($captureResponse, 'litleOnlineResponse', 'response');
$this->assertEquals('0', $message);
}
示例3: test_surchargeAmount_optional
public function test_surchargeAmount_optional()
{
$hash_in = array('litleTxnId' => '3', 'id' => 'id', 'amount' => '2', 'payPalNotes' => 'notes');
$mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
$mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<amount>2<\\/amount><payPalNotes>notes<\\/payPalNotes>.*/'));
$litleTest = new LitleOnlineRequest();
$litleTest->newXML = $mock;
$litleTest->captureRequest($hash_in);
}
示例4: 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'));
}
示例5: array
function test_5_auth()
{
$auth_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();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));
$this->assertEquals('55555 ', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('32', XmlParser::getNode($authorizationResponse, 'avsResult'));
$this->assertEquals('N', XmlParser::getNode($authorizationResponse, 'cardValidationResult'));
//test 5A
$capture_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($authorizationResponse, 'litleTxnId'), 'reportGroup' => 'planets');
$initilaize = new LitleOnlineRequest();
$captureResponse = $initilaize->captureRequest($capture_hash);
$this->assertEquals('001', XmlParser::getNode($captureResponse, 'response'));
$this->assertEquals('Transaction Received', XmlParser::getNode($captureResponse, 'message'));
//test 5B
$credit_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($captureResponse, '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: captureRequest
/**
* Make a capture API request.
*
* This method wraps the LitleOnlineRequest.
*
* @param array $hash_in
* The request data.
*
* @return DOMDocument|SimpleXMLElement
* The response.
*/
public function captureRequest($hash_in)
{
return $this->request->captureRequest($hash_in);
}
示例7: test_35
public function test_35()
{
$auth_hash = array('id' => '1211', 'orderId' => '35', 'amount' => '40040', 'orderSource' => 'ecommerce', 'billToAddress' => array('name' => 'Bob Black', 'addressLine1' => '4 Main St.', 'city' => 'Laurel', 'state' => 'MD', 'zip' => '20708', 'country' => 'US'), 'card' => array('number' => '375001000000005', 'expDate' => '0412', 'type' => 'AX'));
$initilaize = new LitleOnlineRequest();
$authorizationResponse = $initilaize->authorizationRequest($auth_hash);
$this->assertEquals('000', XmlParser::getNode($authorizationResponse, 'response'));
$this->assertEquals('Approved', XmlParser::getNode($authorizationResponse, 'message'));
$this->assertEquals('44444', XmlParser::getNode($authorizationResponse, 'authCode'));
$this->assertEquals('12', XmlParser::getNode($authorizationResponse, 'avsResult'));
//test 35A
$capture_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($authorizationResponse, 'litleTxnId'), 'reportGroup' => 'planets', 'amount' => '20020');
$initilaize = new LitleOnlineRequest();
$captureResponse = $initilaize->captureRequest($capture_hash);
$this->assertEquals('001', XmlParser::getNode($captureResponse, 'response'));
$this->assertEquals('Transaction Received', XmlParser::getNode($captureResponse, 'message'));
//test35B
$authReversal_hash = array('id' => '1211', 'litleTxnId' => XmlParser::getNode($authorizationResponse, 'litleTxnId'), 'reportGroup' => 'planets', 'amount' => '20020');
$initilaize = new LitleOnlineRequest();
$authReversalResponse = $initilaize->authReversalRequest($authReversal_hash);
$this->assertEquals('001', XmlParser::getNode($authReversalResponse, 'response'));
$this->assertEquals('Transaction Received', XmlParser::getNode($authReversalResponse, 'message'));
}