PluginProbe
MultiSafepay plugin for WooCommerce / trunk
MultiSafepay plugin for WooCommerce vtrunk
6.11.1 6.12.0 6.13.0 6.2.0 6.2.1 6.3.0 6.3.1 6.4.0 6.4.1 6.4.2 6.4.3 6.5.0 6.5.1 6.6.0 6.6.1 6.6.2 6.7.0 6.7.1 6.7.2 6.7.3 6.8.0 6.8.1 6.8.2 6.8.3 6.9.0 All 84 releases
multisafepay / src / PaymentMethods / Base / BaseBrandedPaymentMethod.php

BaseBrandedPaymentMethod.php in MultiSafepay plugin for WooCommerce trunk, at src/PaymentMethods/Base/BaseBrandedPaymentMethod.php

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php declare( strict_types=1 );
2
3 namespace MultiSafepay\WooCommerce\PaymentMethods\Base;
4
5 use MultiSafepay\Api\PaymentMethods\PaymentMethod;
6 use MultiSafepay\WooCommerce\Services\PaymentMethodService;
7
8 /**
9 * Class BaseGiftCardPaymentMethod
10 *
11 * @package MultiSafepay\WooCommerce\PaymentMethods\Base
12 */
13 class BaseBrandedPaymentMethod extends BasePaymentMethod {
14
15 /**
16 * @var array
17 */
18 protected $brand;
19
20 /**
21 * @param PaymentMethod $payment_method
22 * @param array $brand
23 */
24 public function __construct( PaymentMethod $payment_method, array $brand ) {
25 $this->brand = $brand;
26 parent::__construct( $payment_method );
27 }
28
29 /**
30 * @return string
31 */
32 public function get_payment_method_gateway_code(): string {
33 return $this->payment_method->getId();
34 }
35
36 /**
37 * @return string
38 */
39 public function get_payment_method_title(): string {
40 return $this->brand['name'];
41 }
42
43 /**
44 * @return string
45 */
46 public function get_payment_method_icon(): string {
47 return $this->brand['icon_urls']['large'];
48 }
49
50 /**
51 * @return string
52 */
53 public function get_payment_method_id(): string {
54 return PaymentMethodService::get_legacy_woocommerce_payment_gateway_ids( $this->brand['id'] );
55 }
56
57
58 }
59