Example #1
0
 public function testAuthorizeWithBaseCurrency()
 {
     $payment = $this->getMockBuilder('\\Magento\\Sales\\Model\\Order\\Payment')->disableOriginalConstructor()->setMethods(array('__wakeup'))->getMock();
     $order = $this->getMockBuilder('Magento\\Sales\\Model\\Order')->disableOriginalConstructor()->setMethods(array('__wakeup'))->getMock();
     $order->setBaseCurrencyCode('USD');
     $payment->setOrder($order);
     $this->_model->authorize($payment, 10.0);
     $this->assertEquals($order->getBaseCurrencyCode(), $this->_apiNvpMock->getCurrencyCode());
 }
Example #2
0
 /**
  * @magentoDataFixture Magento/Sales/_files/quote_with_customer.php
  * @magentoDataFixture Magento/Paypal/_files/billing_agreement.php
  */
 public function testAssignData()
 {
     /** @var \Magento\Quote\Model\Resource\Quote\Collection $collection */
     $collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Quote\\Model\\Resource\\Quote\\Collection');
     /** @var \Magento\Quote\Model\Quote $quote */
     $quote = $collection->getFirstItem();
     /** @var \Magento\Payment\Model\Info $info */
     $info = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Payment\\Model\\Info')->setQuote($quote);
     $this->_model->setData('info_instance', $info);
     $billingAgreement = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Paypal\\Model\\Resource\\Billing\\Agreement\\Collection')->getFirstItem();
     $data = [AbstractAgreement::TRANSPORT_BILLING_AGREEMENT_ID => $billingAgreement->getId()];
     $this->_model->assignData($data);
     $this->assertEquals('REF-ID-TEST-678', $info->getAdditionalInformation(AbstractAgreement::PAYMENT_INFO_REFERENCE_ID));
 }