Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TransactionType.php
Go to the documentation of this file.
1 <?php
7 
8 use Braintree\Transaction;
10 
15 {
19  protected $options;
20 
26  public function toOptionArray()
27  {
28  if ($this->options !== null) {
29  return $this->options;
30  }
31 
32  $types = $this->getAvailableTransactionTypes();
33  foreach ($types as $typeCode => $typeName) {
34  $this->options[$typeCode]['label'] = $typeName;
35  $this->options[$typeCode]['value'] = $typeCode;
36  }
37 
38  return $this->options;
39  }
40 
44  private function getAvailableTransactionTypes()
45  {
46  // @codingStandardsIgnoreStart
47  return [
48  Transaction::SALE => __(Transaction::SALE),
49  Transaction::CREDIT => __(Transaction::CREDIT)
50  ];
51  // @codingStandardsIgnoreEnd
52  }
53 }
__()
Definition: __.php:13