本文整理汇总了PHP中Omnipay\Tests\TestCase类的典型用法代码示例。如果您正苦于以下问题:PHP TestCase类的具体用法?PHP TestCase怎么用?PHP TestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
$this->request->initialize(array('merchantId' => '12345678', 'transactionId' => '654321', 'amount' => '15.24', 'currency' => 'EUR', 'testMode' => true, 'transactionDate' => '20090501193530', 'certificate' => '1122334455667788'));
$this->response = $this->request->send();
}
示例2: setUp
public function setUp()
{
parent::setUp();
$this->request = new EssentialPurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
$this->requestStub = array('clientId' => 'clientId', 'amount' => 10.0, 'currency' => 'GBP', 'orderId' => '1111', 'language' => ' en_US', 'blankParam' => null);
$this->request->initialize($this->requestStub);
}
示例3: setUp
public function setUp()
{
parent::setUp();
$this->getHttpRequest()->query->add(array('testGET' => true));
$this->getHttpRequest()->request->add(array('testPOST' => true));
$this->request = new EssentialCompletePurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
}
示例4: setUp
public function setUp()
{
parent::setUp();
$httpRequest = new HttpRequest([], ['LMI_MODE' => '1', 'LMI_PAYMENT_AMOUNT' => '14.65', 'LMI_PAYEE_PURSE' => 'Z123428476799', 'LMI_PAYMENT_NO' => '1444212666', 'LMI_PAYER_WM' => '404521188333', 'LMI_PAYER_PURSE' => 'Z366393600555', 'LMI_PAYER_COUNTRYID' => 'AZ', 'LMI_PAYER_IP' => '127.0.0.1', 'LMI_SYS_INVS_NO' => '897', 'LMI_SYS_TRANS_NO' => '892', 'LMI_SYS_TRANS_DATE' => '20151007 13:07:36', 'LMI_HASH' => '0B12E75431284D6FCC05D8AF02B90AC28A0788FB95C9FF6B655344022F0746E5', 'LMI_PAYMENT_DESC' => 'Test', 'LMI_LANG' => 'en-US', 'LMI_DBLCHK' => 'SMS']);
$this->request = new CompletePurchaseRequest($this->getHttpClient(), $httpRequest);
$this->request->initialize(['merchantPurse' => 'Z123428476799', 'secretKey' => '226778888', 'testMode' => true]);
}
示例5: setUp
public function setUp()
{
parent::setUp();
$httpRequest = new HttpRequest([], ['transaction_item_name' => $this->description, 'transaction_item_id' => $this->transactionId, 'transaction_amount' => $this->amount, 'transaction_status' => $this->status, 'transaction_currency' => $this->currency, 'test' => (int) $this->testMode, 'key' => $this->key]);
$this->request = new CompletePurchaseRequest($this->getHttpClient(), $httpRequest);
$this->request->initialize(['purse' => $this->purse, 'secret' => $this->secret, 'testMode' => $this->testMode]);
}
示例6: setUp
public function setUp()
{
parent::setUp();
$apiLoginId = getenv('AUTHORIZE_NET_API_LOGIN_ID');
$transactionKey = getenv('AUTHORIZE_NET_TRANSACTION_KEY');
// //todo: Remove this before final commit
$apiLoginId = '3wM8sJ9qR';
$transactionKey = '3K2e3z44EKz3g326';
if ($apiLoginId && $transactionKey) {
$logger = new \Monolog\Logger('authorizenet_cim');
$logger->pushHandler(new \Monolog\Handler\StreamHandler('/var/log/php/debug.log', \Monolog\Logger::DEBUG));
$logger->pushHandler(new \Monolog\Handler\FirePHPHandler());
$adapter = new PsrLogAdapter($logger);
$logPlugin = new LogPlugin($adapter, MessageFormatter::DEBUG_FORMAT);
$client = new Client();
$client->addSubscriber($logPlugin);
$this->gateway = new CIMGateway($client, $this->getHttpRequest());
$this->gateway->setDeveloperMode(true);
$this->gateway->setApiLoginId($apiLoginId);
$this->gateway->setTransactionKey($transactionKey);
} else {
// No credentials were found, so skip this test
$this->markTestSkipped();
}
}
示例7: setUp
protected function setUp()
{
parent::setUp();
/** @var AbstractRequest $request */
$this->request = $this->getMockBuilder('\\Omnipay\\Wirecard\\Message\\AbstractRequest')->setMethods(['buildData'])->disableOriginalConstructor()->getMock();
$this->request->initialize(['card' => $this->getValidCard(), 'transactionId' => 1234, 'transactionReference' => '30FWE6HR325GB0', 'amount' => 100.0, 'currency' => 'EUR', 'countryCode' => 'DE', 'token' => 'gqw5gwDWg$#%he&N4678iu3e56g1$5g']);
}
示例8: setUp
public function setUp()
{
parent::setUp();
$this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest());
// Configure enough to pass validation.
$this->creditCardSaleOptions = ['ReferenceNumber' => '566f2ecb0780c'];
}
示例9: setUp
public function setUp()
{
parent::setUp();
$this->request = new RefundRequest($this->getHttpClient(), $this->getHttpRequest());
$this->dataSuccess = array('response' => 'A', 'responsecode' => 'OP000', 'responsetext' => 'ApproveTEST', 'trans_id' => '1413976984');
$this->dataFailure = array('responsetext' => 'Invalid order_id', 'responsecode' => 'OP299', 'response' => 'E');
}
示例10: setUp
public function setUp()
{
parent::setUp();
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
$this->dataSuccess = array('order_id' => '51711614', 'order_total' => '15.00', 'test_transaction' => '1', 'order_datetime' => '2014-06-11 19:43:39', 'order_status' => 'Paid', 'cart' => array('item' => array(array('id' => '51945994', 'code' => '10', 'name' => 'Product 1 Desc', 'description' => array(), 'qty' => '2', 'digital' => '0', 'discount' => '0', 'predefined' => '0', 'unit_price' => '5.00'), array('id' => '51946004', 'code' => '12', 'name' => 'Shipping for Product 1', 'description' => array(), 'qty' => '1', 'digital' => '0', 'discount' => '0', 'predefined' => '0', 'unit_price' => '5.00'), array('id' => '51946014', 'code' => '12', 'name' => 'Promotion', 'description' => array(), 'qty' => '1', 'digital' => '0', 'discount' => '0', 'predefined' => '0', 'unit_price' => '0.00'))), 'transaction' => array('type' => 'sale', 'response' => 'A', 'response_code' => 'OP000', 'response_text' => 'ApproveTEST', 'trans_id' => '1413980404', 'account_id' => '635182'));
$this->dataFailure = array('errors' => array('error' => array('code' => 'OP812', 'text' => 'Card expired')));
}
示例11: setUp
public function setUp()
{
parent::setUp();
$httpRequest = new HttpRequest(array(), array('o_id' => '1234567890', 'transaction' => 'TX9997888', 'method' => 'CODE', 'amount' => '14.65', 'test' => '1', 'hash' => 'CE76828063B3A2E3793A23C21B603E93'));
$this->request = new CompletePurchaseRequest($this->getHttpClient(), $httpRequest);
$this->request->initialize(array('partnerId' => '12345', 'serviceId' => '67890', 'securityKey' => 'oJ2rHLBVSbD5iGfT', 'testMode' => true));
}
示例12: setUp
public function setUp()
{
parent::setUp();
$httpRequest = new HttpRequest([], ['ECM_HASH' => $this->hash, 'ECM_PURCH_DESC' => $this->description, 'ECM_PAYER_ID' => $this->payer, 'ECM_PAYEE_ID' => $this->purse, 'ECM_PAYMENT_AMOUNT' => $this->amount, 'ECM_ITEM_COST' => $this->amount, 'ECM_TRANS_DATE' => $this->timestamp, 'ECM_INV_NO' => $this->transactionId, 'ECM_TRANS_ID' => $this->transactionReference]);
$this->request = new CompletePurchaseRequest($this->getHttpClient(), $httpRequest);
$this->request->initialize(['purse' => $this->purse, 'secret' => $this->secret, 'testMode' => $this->testMode]);
}
示例13: setUp
public function setUp()
{
parent::setUp();
$this->stub = new PurchaseRequestStub();
$stub = $this->stub;
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
$this->request->initialize(['purse' => $stub->purse, 'signAlgorithm' => $stub->signAlgorithm, 'signKey' => $stub->signKey, 'testKey' => $stub->testKey, 'returnUrl' => $stub->returnUrl, 'returnMethod' => $stub->returnMethod, 'cancelUrl' => $stub->cancelUrl, 'cancelMethod' => $stub->cancelMethod, 'notifyUrl' => $stub->notifyUrl, 'notifyMethod' => $stub->notifyMethod, 'description' => $stub->description, 'transactionId' => $stub->transactionId, 'amount' => $stub->amount, 'currency' => $stub->currency]);
}
示例14: setUp
public function setUp()
{
parent::setUp();
$httpRequest = new HttpRequest(array('checkout_id' => '1902960209'));
$this->httpClient = $this->getHttpClient();
$this->request = new CompletePurchaseRequest($this->httpClient, $httpRequest);
$this->request->initialize(array('transactionId' => '12345', 'amount' => '25.50', 'currency' => 'USD', 'description' => 'A vacation home rental', 'feePayer' => 'payee', 'accountId' => '783276130', 'type' => 'goods', 'card' => array('firstName' => 'Agbonghama', 'lastName' => 'Collins', 'email' => 'me@w3guy.com'), 'accessToken' => 'STAGE_ca4cf9c5d2d4623d18dae0fc47b908f2d17b47654eecb1fc55bc8652945927cd', 'returnUrl' => 'http://localhost.dev/wepay/complete.php'));
}
示例15: setUp
public function setUp()
{
parent::setUp();
$mockHttpRequest = $this->getMockBuilder('\\Symfony\\Component\\HttpFoundation\\Request')->setConstructorArgs(array(array(), $this->getMockHttpResponse('FraudChangeNotificationFail.txt')->json()))->setMethods(null)->getMock();
$this->request = new NotificationRequest($this->getHttpClient(), $mockHttpRequest);
$this->request->setAccountNumber('901290261');
$this->request->setSecretWord('MzBjODg5YTUtNzcwMS00N2NlLWFkODMtNzQ2YzllZWRjMzBj');
}