public function testisIpnDuplicate_IsNot()
 {
     $di = new \Box_Di();
     $dbMock = $this->getMockBuilder('\\Box_Database')->getMock();
     $dbMock->expects($this->atLeastOnce())->method('getAll')->willReturn(array(array('id' => 1)));
     $di['db'] = $dbMock;
     $adapter = new Payment_Adapter_PayPalEmail($this->defaultConfig);
     $adapter->setDi($di);
     $ipn = array('txn_id' => '1A2D3F4G5G6B7X8Z9C', 'payment_status' => 'Completed', 'txn_type' => 'web_accept', 'mc_gross' => '5.45');
     $result = $adapter->isIpnDuplicate($ipn);
     $this->assertFalse($result);
 }
Esempio n. 2
0
 public function testGatewayTestmodeUrl()
 {
     $config = array();
     $config['email'] = '*****@*****.**';
     $config['test_mode'] = true;
     $config['return_url'] = 'http://www.google.com?q=return';
     $config['cancel_url'] = 'http://www.google.com?q=cancel';
     $config['notify_url'] = 'http://www.google.com?q=notify';
     $adapter = new Payment_Adapter_PayPalEmail($config);
     $adapter->setDi($this->di);
     $form = $adapter->getHtml($this->api_admin, 1, false);
     $this->assertRegExp('/action="https:\\/\\/www\\.sandbox\\.paypal\\.com\\/cgi-bin\\/webscr"/', $form);
 }