1: | <?php
2: | namespace Opencart\Catalog\Model\Extension\Opencart\Payment;
3: | /**
4: | * Class BankTransfer
5: | *
6: | * @package Opencart\Catalog\Model\Extension\Opencart\Payment
7: | */
8: | class BankTransfer extends \Opencart\System\Engine\Model {
9: | /**
10: | * Get Methods
11: | *
12: | * @param array<string, mixed> $address
13: | *
14: | * @return array<string, mixed>
15: | */
16: | public function getMethods(array $address = []): array {
17: | $this->load->language('extension/opencart/payment/bank_transfer');
18: |
19: | if ($this->cart->hasSubscription()) {
20: | $status = false;
21: | } elseif (!$this->config->get('config_checkout_payment_address')) {
22: | $status = true;
23: | } elseif (!$this->config->get('payment_bank_transfer_geo_zone_id')) {
24: | $status = true;
25: | } else {
26: | $this->load->model('localisation/geo_zone');
27: |
28: | $results = $this->model_localisation_geo_zone->getGeoZone((int)$this->config->get('payment_bank_transfer_geo_zone_id'), (int)$address['country_id'], (int)$address['zone_id']);
29: |
30: | if ($results) {
31: | $status = true;
32: | } else {
33: | $status = false;
34: | }
35: | }
36: |
37: | $method_data = [];
38: |
39: | if ($status) {
40: | $option_data['bank_transfer'] = [
41: | 'code' => 'bank_transfer.bank_transfer',
42: | 'name' => $this->language->get('heading_title')
43: | ];
44: |
45: | $method_data = [
46: | 'code' => 'bank_transfer',
47: | 'name' => $this->language->get('heading_title'),
48: | 'option' => $option_data,
49: | 'sort_order' => $this->config->get('payment_bank_transfer_sort_order')
50: | ];
51: | }
52: |
53: | return $method_data;
54: | }
55: | }
56: |

OpenCart API API documentation generated by ApiGen dev-master