PluginProbe
HyperPay Payments / trunk
HyperPay Payments vtrunk
6.6.0 trunk 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.5 4.0.0 4.0.2 All 34 releases
hyperpay-gateways / src / Brands / ClickToPay.php

ClickToPay.php in HyperPay Payments trunk, at src/Brands/ClickToPay.php

70 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Hyperpay\Gateways\Brands;
3
4 use Hyperpay\Gateways\App\DefaultGateway;
5 use Hyperpay\Gateways\Main;
6 use WC_Order;
7
8
9 class ClickToPay extends DefaultGateway
10 {
11 public $trans_mode = 'EXTERNAL';
12
13 /**
14 * should be lower case and unique
15 * @var string $id
16 */
17 public $id = 'hyperpay_clicktopay';
18
19 /**
20 * The title which appear next to gateway on setting page
21 * @var string $method_title
22 */
23 public $method_title = 'Click To Pay Gateway';
24
25 /**
26 * Description of gateways which will appear next to title
27 * @var string $method_description
28 */
29 public $method_description = 'Click To Pay Plugin for Woocommerce';
30
31 /**
32 *
33 * the Brands supported by the gateway
34 * @var array $supported_brands
35 */
36 protected $supported_brands = [
37 'MASTER' => 'Master Card',
38 'VISA' => 'Visa',
39 'AMEX' => 'American Express',
40 'JCB' => 'Japan Credit Bureau',
41 'CLICK_TO_PAY' => 'Click to pay',
42 ];
43
44 public function boot()
45 {
46
47 $this->blackBins = require_once(Main::ROOT_PATH . '/includes/blackBins.php');
48 $this->brands = \array_keys($this->supported_brands);
49 unset($this->form_fields['hyper_pay_brands']);
50 }
51
52 public function renderPaymentForm(WC_Order $order, $result)
53 {
54 parent::renderPaymentForm($order,$result);
55 wp_enqueue_script('CLICK_TO_PAY_JS', HYPERPAY_PLUGIN_DIR . '/src/assets/js/click_to_pay.js', ['jquery'], '1.0.0', true);
56 wp_localize_script('CLICK_TO_PAY_JS', 'hyperpay_dataObj_click_to_pay', ["email" => $order->get_billing_email()]);
57 }
58
59 public function iconSrc()
60 {
61 $img = HYPERPAY_PLUGIN_DIR . '/src/assets/images/default.png';
62 if (file_exists(Main::ROOT_PATH . '/assets/images/click-to-pay.png'))
63 $img = HYPERPAY_PLUGIN_DIR . '/src/assets/images/click-to-pay.png';
64
65 return [$img];
66 }
67
68
69 }
70