本文整理汇总了PHP中litle\sdk\LitleOnlineRequest::saleRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP LitleOnlineRequest::saleRequest方法的具体用法?PHP LitleOnlineRequest::saleRequest怎么用?PHP LitleOnlineRequest::saleRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类litle\sdk\LitleOnlineRequest
的用法示例。
在下文中一共展示了LitleOnlineRequest::saleRequest方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_invalid_field
public function test_invalid_field()
{
$hash_in = array('paypal' => array("payerId" => '123', "token" => '12321312', "transactionId" => '123123'), 'id' => '1211', 'orderId' => '2111', 'nonexistant' => 'novalue', 'reportGroup' => 'Planets', 'orderSource' => 'ecommerce', 'amount' => '123');
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($hash_in);
$message = XmlParser::getNode($saleResponse, 'message');
$this->assertEquals('Approved', $message);
}
示例2: test_sale_with_applepay
public function test_sale_with_applepay()
{
$hash_in = array('applepay' => array('data' => 'string data here', 'header' => 'header stuff here', 'signature' => 'signature', 'version' => 'version 1'), 'orderId' => '2111', 'orderSource' => 'ecommerce', 'id' => '654', 'amount' => '123');
$mock = $this->getMock('litle\\sdk\\LitleXmlMapper');
$mock->expects($this->once())->method('request')->with($this->matchesRegularExpression('/.*<applepay><data>string data here.*<header>header stuff here.*<signature>signature.*<version>version 1.*/'));
$litleTest = new LitleOnlineRequest();
$litleTest->newXML = $mock;
$litleTest->saleRequest($hash_in);
}
示例3: test_advancedFraudChecks_withoutThreatMetrixSessionId
public function test_advancedFraudChecks_withoutThreatMetrixSessionId()
{
//In 8.23, threatMetrixSessionId is optional, but really should be required.
//It will be required in 8.24, so I'm making it required here in the schema.
//There is no good reason to send an advancedFraudChecks element without a threatMetrixSessionId.
$hash_in = array('card' => array('type' => 'VI', 'number' => '4100000000000001', 'expDate' => '1213'), 'orderId' => '12344', 'amount' => '2', 'orderSource' => 'ecommerce', 'debtRepayment' => 'true', 'advancedFraudChecks' => array());
$litleTest = new LitleOnlineRequest();
$this->setExpectedException('InvalidArgumentException', 'Missing Required Field: /threatMetrixSessionId/');
$retOb = $litleTest->saleRequest($hash_in);
}
示例4: 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'));
}
示例5: test_9_sale
public function test_9_sale()
{
$sale_hash = array('orderId' => '9', 'amount' => '90090', 'orderSource' => 'ecommerce', 'billToAddress' => array('name' => 'James Miller', 'addressLine1' => '9 Main St.', 'city' => 'Boston', 'state' => 'MA', 'zip' => '02134', 'country' => 'US'), 'card' => array('number' => '375001010000003', 'expDate' => '0912', 'cardValidationNum' => '0421', 'type' => 'AX'));
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($sale_hash);
$this->assertEquals('303', XmlParser::getNode($saleResponse, 'response'));
$this->assertEquals('Pick Up Card', XmlParser::getNode($saleResponse, 'message'));
$this->assertEquals('34', XmlParser::getNode($saleResponse, 'avsResult'));
}
示例6: test_pos_with_invalid_entryMode
public function test_pos_with_invalid_entryMode()
{
$hash_in = array('merchantId' => '101', 'version' => '8.8', 'reportGroup' => 'Planets', 'orderId' => '12344', 'amount' => '106', 'orderSource' => 'ecommerce', 'pos' => array('entryMode' => 'none', 'cardholderId' => 'pin', 'capability' => 'notused'), 'card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1210'));
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($hash_in);
$message = XmlParser::getAttribute($saleResponse, 'litleOnlineResponse', 'message');
$this->assertRegExp('/Error validating xml data against the schema/', $message);
}
示例7: saleRequest
/**
* Make a sale API request.
*
* This method wraps the LitleOnlineRequest.
*
* @param array $hash_in
* The request data.
*
* @return DOMDocument|SimpleXMLElement
* The response.
*/
public function saleRequest($hash_in)
{
return $this->request->saleRequest($hash_in);
}
示例8: test_simple_sale_with_AdvancedFraudCheckWithCustomAttribute
public function test_simple_sale_with_AdvancedFraudCheckWithCustomAttribute()
{
$hash_in = array('card' => array('type' => 'VI', 'number' => '4100000000000000', 'expDate' => '1213', 'cardValidationNum' => '1213'), 'id' => '654', 'orderId' => '2111', 'orderSource' => 'ecommerce', 'amount' => '123', 'advancedFraudChecks' => array('threatMetrixSessionId' => 'abc123', 'customAttribute1' => '1', 'customAttribute2' => '2', 'customAttribute3' => '3', 'customAttribute4' => '4', 'customAttribute5' => '5'));
$initilaize = new LitleOnlineRequest();
$saleResponse = $initilaize->saleRequest($hash_in);
$response = XmlParser::getNode($saleResponse, 'response');
$this->assertEquals('000', $response);
}