Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PayflowConfig.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Paypal\Model;
7 
9 
14 class PayflowConfig extends Config
15 {
21  const TRXTYPE_AUTH_ONLY = 'A';
22 
23  const TRXTYPE_SALE = 'S';
24 
32  public function getTrxType()
33  {
34  switch ($this->getValue('payment_action')) {
38  return self::TRXTYPE_SALE;
39  default:
40  break;
41  }
42 
43  return null;
44  }
45 
52  public function getTransactionUrl($testMode = null)
53  {
54  $testMode = $testMode === null ? $this->getValue('sandbox_flag') : (bool)$testMode;
55  if ($testMode) {
56  return $this->methodInstance->getConfigData('transaction_url_test_mode');
57  }
58  return $this->methodInstance->getConfigData('transaction_url');
59  }
60 
66  public function getPaymentAction()
67  {
68  switch ($this->getValue('payment_action')) {
73  default:
74  break;
75  }
76  return null;
77  }
78 
87  public function isMethodActive($method)
88  {
89  return parent::isMethodActive(Config::METHOD_PAYMENT_PRO)
90  || parent::isMethodActive(Config::METHOD_PAYFLOWPRO);
91  }
92 
99  protected function _getSpecificConfigPath($fieldName)
100  {
101  if ($this->pathPattern) {
102  return sprintf($this->pathPattern, $this->_methodCode, $fieldName);
103  }
104 
105  return "payment/{$this->_methodCode}/{$fieldName}";
106  }
107 }
$method
Definition: info.phtml:13