Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
IframeConfigProvider Class Reference
Inheritance diagram for IframeConfigProvider:
ConfigProviderInterface

Public Member Functions

 __construct (PaymentHelper $paymentHelper, UrlInterface $urlBuilder)
 
 getConfig ()
 

Protected Member Functions

 getFrameActionUrl ($code)
 

Protected Attributes

 $methodCodes
 
 $methods = []
 
 $paymentHelper
 
 $urlBuilder
 

Detailed Description

Definition at line 12 of file IframeConfigProvider.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( PaymentHelper  $paymentHelper,
UrlInterface  $urlBuilder 
)
Parameters
PaymentHelper$paymentHelper
UrlInterface$urlBuilder

Definition at line 42 of file IframeConfigProvider.php.

45  {
46  $this->paymentHelper = $paymentHelper;
47  $this->urlBuilder = $urlBuilder;
48 
49  foreach ($this->methodCodes as $code) {
50  $this->methods[$code] = $this->paymentHelper->getMethodInstance($code);
51  }
52  }
$code
Definition: info.phtml:12

Member Function Documentation

◆ getConfig()

getConfig ( )

{Retrieve assoc array of checkout configuration

Returns
array
}

Implements ConfigProviderInterface.

Definition at line 57 of file IframeConfigProvider.php.

58  {
59  $config = [
60  'payment' => [
61  'paypalIframe' => [],
62  ],
63  ];
64  foreach ($this->methodCodes as $code) {
65  if ($this->methods[$code]->isAvailable()) {
66  $config['payment']['paypalIframe']['actionUrl'][$code] = $this->getFrameActionUrl($code);
67  }
68  }
69 
70  return $config;
71  }
$config
Definition: fraud_order.php:17
$code
Definition: info.phtml:12

◆ getFrameActionUrl()

getFrameActionUrl (   $code)
protected

Get frame action URL

Parameters
string$code
Returns
string

Definition at line 79 of file IframeConfigProvider.php.

80  {
81  $url = '';
82  switch ($code) {
84  $url = $this->urlBuilder->getUrl('paypal/payflowadvanced/form', ['_secure' => true]);
85  break;
87  $url = $this->urlBuilder->getUrl('paypal/payflow/form', ['_secure' => true]);
88  break;
90  $url = $this->urlBuilder->getUrl('paypal/hostedpro/redirect', ['_secure' => true]);
91  break;
92  }
93 
94  return $url;
95  }
$code
Definition: info.phtml:12

Field Documentation

◆ $methodCodes

$methodCodes
protected

◆ $methods

$methods = []
protected

Definition at line 26 of file IframeConfigProvider.php.

◆ $paymentHelper

$paymentHelper
protected

Definition at line 31 of file IframeConfigProvider.php.

◆ $urlBuilder

$urlBuilder
protected

Definition at line 36 of file IframeConfigProvider.php.


The documentation for this class was generated from the following file: