Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PaymentType.php
Go to the documentation of this file.
1 <?php
7 
8 use Braintree\PaymentInstrumentType;
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->getAvailablePaymentTypes();
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 getAvailablePaymentTypes()
45  {
46  // @codingStandardsIgnoreStart
47  return [
48  PaymentInstrumentType::PAYPAL_ACCOUNT => __(PaymentInstrumentType::PAYPAL_ACCOUNT),
49  PaymentInstrumentType::COINBASE_ACCOUNT => __(PaymentInstrumentType::COINBASE_ACCOUNT),
50  PaymentInstrumentType::EUROPE_BANK_ACCOUNT => __(PaymentInstrumentType::EUROPE_BANK_ACCOUNT),
51  PaymentInstrumentType::CREDIT_CARD => __(PaymentInstrumentType::CREDIT_CARD),
52  PaymentInstrumentType::APPLE_PAY_CARD => __(PaymentInstrumentType::APPLE_PAY_CARD),
53  PaymentInstrumentType::ANDROID_PAY_CARD => __(PaymentInstrumentType::ANDROID_PAY_CARD)
54  ];
55  // @codingStandardsIgnoreEnd
56  }
57 }
__()
Definition: __.php:13