Esempio n. 1
0
 /**
  * @covers \Magento\Paypal\Model\Hostedpro::initialize
  * @magentoDataFixture Magento/Paypal/_files/order_hostedpro.php
  */
 public function testInitialize()
 {
     /** @var \Magento\Sales\Model\Order $order */
     $order = $this->objectManager->create(Order::class);
     $order->loadByIncrementId('100000001');
     $payment = $order->getPayment();
     $this->model->setInfoInstance($payment);
     $this->api->expects(static::once())->method('call')->willReturn(['EMAILLINK' => 'https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/']);
     $state = $this->objectManager->create(DataObject::class);
     $this->model->initialize(Config::PAYMENT_ACTION_AUTH, $state);
     static::assertEquals(Order::STATE_PENDING_PAYMENT, $state->getState());
     static::assertEquals(Order::STATE_PENDING_PAYMENT, $state->getStatus());
     static::assertFalse($state->getIsNotified());
 }
Esempio n. 2
0
 /**
  * Get peymet request data as array
  *
  * @param \Magento\Paypal\Model\Hostedpro $paymentMethod
  * @return array
  */
 protected function _getPaymentData(\Magento\Paypal\Model\Hostedpro $paymentMethod)
 {
     $request = array('paymentaction' => strtolower($paymentMethod->getConfigData('payment_action')), 'notify_url' => $paymentMethod->getNotifyUrl(), 'cancel_return' => $paymentMethod->getCancelUrl(), 'return' => $paymentMethod->getReturnUrl(), 'lc' => $paymentMethod->getMerchantCountry(), 'template' => 'templateD', 'showBillingAddress' => 'false', 'showShippingAddress' => 'true', 'showBillingEmail' => 'false', 'showBillingPhone' => 'false', 'showCustomerName' => 'false', 'showCardInfo' => 'true', 'showHostedThankyouPage' => 'false');
     return $request;
 }
Esempio n. 3
0
 /**
  * Get payment request data as array
  *
  * @param \Magento\Paypal\Model\Hostedpro $paymentMethod
  * @return array
  */
 protected function _getPaymentData(\Magento\Paypal\Model\Hostedpro $paymentMethod)
 {
     $request = ['paymentaction' => strtolower($paymentMethod->getConfigData('payment_action')), 'notify_url' => $paymentMethod->getNotifyUrl(), 'cancel_return' => $paymentMethod->getCancelUrl(), 'return' => $paymentMethod->getReturnUrl(), 'lc' => \Locale::getRegion($this->localeResolver->getLocale()), 'template' => 'mobile-iframe', 'showBillingAddress' => 'false', 'showShippingAddress' => 'true', 'showBillingEmail' => 'false', 'showBillingPhone' => 'false', 'showCustomerName' => 'false', 'showCardInfo' => 'true', 'showHostedThankyouPage' => 'false'];
     return $request;
 }