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(); }
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); }
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()); }
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]); }
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]); }
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(); } }
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']); }
public function setUp() { parent::setUp(); $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); // Configure enough to pass validation. $this->creditCardSaleOptions = ['ReferenceNumber' => '566f2ecb0780c']; }
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'); }
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'))); }
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)); }
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]); }
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]); }
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' => '*****@*****.**'), 'accessToken' => 'STAGE_ca4cf9c5d2d4623d18dae0fc47b908f2d17b47654eecb1fc55bc8652945927cd', 'returnUrl' => 'http://localhost.dev/wepay/complete.php')); }
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'); }
public function setUp() { parent::setUp(); $this->request = new RestCreateCardRequest($this->getHttpClient(), $this->getHttpRequest()); $card = $this->getValidCard(); $this->card = new CreditCard($card); $this->request->initialize(array('card' => $card)); }
public function setUp() { parent::setUp(); $client = $this->getHttpClient(); $request = $this->getHttpRequest(); $this->request = new RestCompletePurchaseRequest($client, $request); $this->request->initialize(array()); }
public function setUp() { parent::setUp(); $this->stub = new CompletePurchaseRequestStub(); $stub = $this->stub; $httpRequest = new HttpRequest([], ['ik_co_id' => $stub->purse, 'ik_trn_id' => $stub->transactionId, 'ik_desc' => $stub->description, 'ik_am' => $stub->amount, 'ik_cur' => $stub->currency, 'ik_inv_prc' => $stub->time, 'ik_sign' => $stub->sign, 'ik_inv_st' => $stub->state]); $this->request = new CompletePurchaseRequest($this->getHttpClient(), $httpRequest); $this->request->initialize(['purse' => $stub->purse, 'signAlgorithm' => $stub->signAlgorithm, 'signKey' => $stub->signKey]); }
public function setUp() { parent::setUp(); $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest()); $this->gateway->setTerminalId('0019410000000000000001'); $this->gateway->setRegKey('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'); $this->gateway->setTestMode(1); $this->transaction_id = 6040; // Tem que mudar o id, ou modificar e mock os requests }
public function setUp() { parent::setUp(); $class = new \ReflectionObject($this); $directory = dirname($class->getFileName()); $sslFile = realpath($directory . '/../Certificate/webmoney.pem'); $sslKey = realpath($directory . '/../Certificate/webmoney.key'); $this->request = new PayoutRequest($this->getHttpClient(), $this->getHttpRequest()); $this->request->initialize(array('webMoneyId' => '811333344777', 'merchantPurse' => 'Z123428476799', 'secretKey' => '226778888', 'sslFile' => $sslFile, 'sslKey' => $sslKey, 'transactionId' => '1444111666', 'requestNumber' => '111222333', 'customerPurse' => 'Z123428476700', 'protectionPeriod' => '60', 'protectionCode' => 'xyZ123', 'invoiceId' => '12345678', 'onlyAuth' => false, 'description' => 'Payout', 'amount' => '12.46')); }
public function setUp() { parent::setUp(); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($this->getMockHttpResponse('FetchTransactionSuccess.txt')); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new FetchTransactionRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('webMoneyId' => '811333344777', 'merchantPurse' => 'Z123428476799', 'secretKey' => '226778888', 'transactionId' => '1444212666')); }
public function setUp() { parent::setUp(); $httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt'); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($httpResponse); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new PurchaseRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('username' => 'SOAP_USERNAME', 'password' => 'oJ2rHLBVSbD5iGfT', 'clientIp' => '127.0.0.1', 'returnUrl' => 'https://www.foodstore.com/success.html?parameter=somedata', 'cancelUrl' => 'https://www.foodstore.com/failure.html?parameter=somedata', 'notifyUrl' => 'https://www.foodstore.com/notify.html?parameter=somedata', 'subId' => 'shop1', 'shopId' => '2568-B415rh_785', 'shopLabel' => 'www.foodstore.com', 'countryRestrictions' => array('FR', 'ES'), 'minAgeRestriction' => 18, 'minKycLevelRestriction' => 'SIMPLE', 'language' => 'de', 'locale' => 'de_de', 'clientMerchantId' => 'client123', 'transactionId' => 'TX9997888', 'amount' => '14.65', 'currency' => 'EUR')); }
public function setUp() { parent::setUp(); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($this->getMockHttpResponse('RefundSuccess.txt')); $mockPlugin->addResponse($this->getMockHttpResponse('RefundFailure.txt')); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new RefundRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('transactionReference' => '670902310', 'refundReason' => 'Just because', 'amount' => '25.50', 'applicationFee' => '2.13')); }
public function setUp() { parent::setUp(); $httpResponse = $this->getMockHttpResponse('FetchTransactionSuccess.txt'); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($httpResponse); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new FetchTransactionRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('username' => 'SOAP_USERNAME', 'password' => 'oJ2rHLBVSbD5iGfT', 'subId' => 'shop1', 'transactionId' => 'TX9997888', 'currency' => 'EUR')); }
public function setUp() { parent::setUp(); $httpResponse = $this->getMockHttpResponse('ValidatePayoutSuccess.txt'); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($httpResponse); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new ValidatePayoutRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('username' => 'SOAP_USERNAME', 'password' => 'oJ2rHLBVSbD5iGfT', 'subId' => 'shop1', 'email' => '*****@*****.**', 'firstName' => 'John', 'lastName' => 'Doe', 'birthday' => '30.12.1976', 'utcOffset' => '+02:00', 'clientMerchantId' => 'client123', 'transactionId' => 'TX9997888', 'amount' => '14.65', 'currency' => 'EUR')); }
public function setUp() { parent::setUp(); $httpResponse = new Response(200, null, $this->response); $tmpRequest = $this->getMock('Guzzle\\Http\\Message\\Request', ['send'], ['POST', '']); $tmpRequest->expects($this->any())->method('send')->will($this->returnValue($httpResponse)); $httpClient = $this->getMock('Guzzle\\Http\\Client', ['setConfig', 'post']); $httpClient->expects($this->any())->method('post')->will($this->returnValue($tmpRequest)); $httpRequest = new HttpRequest([], ['business' => $this->purse, 'payment_gross' => $this->amount, 'item_name' => $this->description, 'mc_currency' => $this->currency, 'payer_email' => $this->payer, 'payment_date' => $this->time, 'item_number' => $this->transactionId, 'txn_id' => $this->transactionReference]); $this->request = new CompletePurchaseRequest($httpClient, $httpRequest); $this->request->initialize(['purse' => $this->purse, 'secret' => $this->secret, 'testMode' => $this->testMode]); }
public function setUp() { parent::setUp(); $mock = new \Guzzle\Plugin\Mock\MockPlugin(); $mock->addResponse($this->getMockHttpResponse('TokenPurchaseFailure.txt')); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mock); $this->request = new TokenPurchaseRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('card' => $this->getValidCard(), 'token' => 'Y2RkZDdjN2EtNjFmZS00ZGYzLWI4NmEtNGZhMjI3NmExMzQ0', 'transactionId' => '123456', 'currency' => 'USD', 'amount' => '20.5')); $this->request->setAccountNumber('801290261'); $this->request->setTestMode(true); $this->request->setPrivateKey('5F876A36-D506-4E1F-8EE9-DA2358500F9C'); }
public function setUp() { parent::setUp(); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($this->getMockHttpResponse('CancelSuccess.txt')); $mockPlugin->addResponse($this->getMockHttpResponse('CancelFailure.txt')); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new CancelRequest($httpClient, $this->getHttpRequest()); $this->request->initialize(array('transactionReference' => '670902310', 'cancelReason' => 'We needed to')); $this->request2 = new CancelRequest($httpClient, $this->getHttpRequest()); $this->request2->initialize(array('transactionReference' => '670902310', 'refundReason' => 'Just because')); }
public function setUp() { parent::setUp(); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($this->getMockHttpResponse('PurchaseSuccess.txt')); $mockPlugin->addResponse($this->getMockHttpResponse('PurchaseFailure.txt')); $mockPlugin->addResponse($this->getMockHttpResponse('CustomCheckoutPurchaseSuccess.txt')); $httpClient = $this->getHttpClient(); $httpClient->addSubscriber($mockPlugin); $this->request = new PurchaseRequest($httpClient, $this->getHttpRequest()); $this->request2 = new PurchaseRequest($httpClient, $this->getHttpRequest()); $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' => '*****@*****.**'), 'accessToken' => 'STAGE_ca4cf9c5d2d4623d18dae0fc47b908f2d17b47654eecb1fc55bc8652945927cd', 'returnUrl' => 'http://localhost.dev/wp-content/plugins/omnipaywp/complete.php')); $this->request2->initialize(array('transactionId' => '12345', 'amount' => '25.50', 'currency' => 'USD', 'token' => '3827187391', 'description' => 'A vacation home rental', 'feePayer' => 'payee', 'accountId' => '783276130', 'type' => 'goods', 'card' => array('firstName' => 'Agbonghama', 'lastName' => 'Collins', 'email' => '*****@*****.**'), 'accessToken' => 'STAGE_ca4cf9c5d2d4623d18dae0fc47b908f2d17b47654eecb1fc55bc8652945927cd')); }
public function setUp() { parent::setUp(); $httpCompletePurchaseResponse = $this->getMockHttpResponse('CompletePurchaseSuccess.txt'); $httpFetchTransactionResponse = $this->getMockHttpResponse('FetchTransactionPending.txt'); $mockPlugin = new \Guzzle\Plugin\Mock\MockPlugin(); $mockPlugin->addResponse($httpFetchTransactionResponse); $mockPlugin->addResponse($httpCompletePurchaseResponse); $httpClient = new HttpClient(); $httpClient->addSubscriber($mockPlugin); $httpRequest = new HttpRequest(array('mtid' => 'TX9997888', 'subid' => 'shop1', 'amount' => '1.00', 'currency' => 'EUR')); $this->request = new CompletePurchaseRequest($httpClient, $httpRequest); $this->request->initialize(array('username' => 'SOAP_USERNAME', 'password' => 'oJ2rHLBVSbD5iGfT')); }