| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Modules\PaymentMethods\PromoGateways\Pro; |
| 4 |
|
| 5 |
use FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway; |
| 6 |
use FluentCart\App\Services\Payments\PaymentInstance; |
| 7 |
use FluentCart\App\Vite; |
| 8 |
|
| 9 |
class PaddlePromo extends AbstractPaymentGateway |
| 10 |
{ |
| 11 |
public array $supportedFeatures = []; |
| 12 |
|
| 13 |
public function __construct() |
| 14 |
{ |
| 15 |
$settings = new PromoGatewaySettings('paddle'); |
| 16 |
parent::__construct($settings); |
| 17 |
} |
| 18 |
|
| 19 |
public function meta(): array |
| 20 |
{ |
| 21 |
return [ |
| 22 |
'title' => 'Paddle', |
| 23 |
'route' => 'paddle', |
| 24 |
'slug' => 'paddle', |
| 25 |
'description' => 'Accept credit cards and PayPal payments securely with Paddle. Available in FluentCart Pro.', |
| 26 |
'logo' => Vite::getAssetUrl("images/payment-methods/paddle-logo.svg"), |
| 27 |
'icon' => Vite::getAssetUrl("images/payment-methods/paddle-logo.svg"), |
| 28 |
'brand_color' => '#7c3aed', |
| 29 |
'status' => false, |
| 30 |
'requires_pro' => true, |
| 31 |
'supported_features' => $this->supportedFeatures |
| 32 |
]; |
| 33 |
} |
| 34 |
|
| 35 |
public function makePaymentFromPaymentInstance(PaymentInstance $paymentInstance) |
| 36 |
{ |
| 37 |
// This will not be called since the gateway is not active |
| 38 |
return null; |
| 39 |
} |
| 40 |
|
| 41 |
public function handleIPN() |
| 42 |
{ |
| 43 |
// This will not be called since the gateway is not active |
| 44 |
} |
| 45 |
|
| 46 |
public function getOrderInfo(array $data) |
| 47 |
{ |
| 48 |
// This will not be called since the gateway is not active |
| 49 |
return null; |
| 50 |
} |
| 51 |
|
| 52 |
/** |
| 53 |
* Get Paddle-specific notice configuration |
| 54 |
*/ |
| 55 |
private function getNoticeConfig() |
| 56 |
{ |
| 57 |
return [ |
| 58 |
'title' => __('Paddle Payment Gateway', 'fluent-cart'), |
| 59 |
'description' => __('Accept credit cards and PayPal securely with Paddle. Complete checkout solution with built-in tax handling, invoicing, and subscription management.', 'fluent-cart'), |
| 60 |
'features' => [ |
| 61 |
__('Credit Card & PayPal payments', 'fluent-cart'), |
| 62 |
__('Recurring billing & subscriptions', 'fluent-cart'), |
| 63 |
__('Built-in tax & VAT handling', 'fluent-cart'), |
| 64 |
__('Automatic invoicing & refunds', 'fluent-cart') |
| 65 |
], |
| 66 |
'icon_path' => 'M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z', |
| 67 |
'upgrade_url' => 'https://fluentcart.com/pricing/' |
| 68 |
]; |
| 69 |
} |
| 70 |
|
| 71 |
/** |
| 72 |
* Generate upgrade to pro message |
| 73 |
*/ |
| 74 |
public function upgradeToProMessage() |
| 75 |
{ |
| 76 |
return $this->settings->generateUpgradeNotice($this->getNoticeConfig()); |
| 77 |
} |
| 78 |
|
| 79 |
public function fields() |
| 80 |
{ |
| 81 |
return [ |
| 82 |
'notice' => [ |
| 83 |
'value' => $this->upgradeToProMessage(), |
| 84 |
'label' => __('Paddle Payment Gateway', 'fluent-cart'), |
| 85 |
'type' => 'html_attr' |
| 86 |
], |
| 87 |
]; |
| 88 |
} |
| 89 |
} |
| 90 |
|