Configs
8 months ago
Paypal
8 months ago
GatewayBase.php
9 months ago
GatewayFactory.php
11 months ago
PaypalGateway.php
1 year ago
PaypalGateway.php
93 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Payment gateway concrete class |
| 4 | * |
| 5 | * @package Tutor\Ecommerce |
| 6 | * @author Themeum |
| 7 | * @link https://themeum.com |
| 8 | * @since 3.0.0 |
| 9 | */ |
| 10 | |
| 11 | namespace Tutor\PaymentGateways; |
| 12 | |
| 13 | use Ollyo\PaymentHub\Payments\Paypal\Paypal; |
| 14 | use Tutor\PaymentGateways\Configs\PaypalConfig; |
| 15 | |
| 16 | /** |
| 17 | * Paypal payment gateway class |
| 18 | */ |
| 19 | class PaypalGateway extends GatewayBase { |
| 20 | |
| 21 | /** |
| 22 | * Payment gateway root dir name |
| 23 | * |
| 24 | * @since 3.0.0 |
| 25 | * |
| 26 | * @var string |
| 27 | */ |
| 28 | private $dir_name = 'Paypal'; |
| 29 | |
| 30 | /** |
| 31 | * Payment gateway config class |
| 32 | * |
| 33 | * @since 3.0.0 |
| 34 | * |
| 35 | * @var string |
| 36 | */ |
| 37 | private $config_class = PaypalConfig::class; |
| 38 | |
| 39 | /** |
| 40 | * Payment core class |
| 41 | * |
| 42 | * @since 3.0.0 |
| 43 | * |
| 44 | * @var string |
| 45 | */ |
| 46 | private $payment_class = Paypal::class; |
| 47 | |
| 48 | /** |
| 49 | * Root dir name of payment gateway src |
| 50 | * |
| 51 | * @since 3.0.0 |
| 52 | * |
| 53 | * @return string |
| 54 | */ |
| 55 | public function get_root_dir_name():string { |
| 56 | return $this->dir_name; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Payment class from payment hub |
| 61 | * |
| 62 | * @since 3.0.0 |
| 63 | * |
| 64 | * @return string |
| 65 | */ |
| 66 | public function get_payment_class():string { |
| 67 | return $this->payment_class; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Payment config class |
| 72 | * |
| 73 | * @since 3.0.0 |
| 74 | * |
| 75 | * @return string |
| 76 | */ |
| 77 | public function get_config_class():string { |
| 78 | return $this->config_class; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Return autoload file |
| 83 | * |
| 84 | * @since 3.0.0 |
| 85 | * |
| 86 | * @return string |
| 87 | */ |
| 88 | public static function get_autoload_file() { |
| 89 | return tutor()->path . 'ecommerce/PaymentGateways/Paypal/vendor/autoload.php'; |
| 90 | } |
| 91 | } |
| 92 | |
| 93 |