mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
Add gateway features support
This commit is contained in:
parent
d840296a25
commit
17fd6886ff
2 changed files with 17 additions and 1 deletions
|
@ -12,6 +12,7 @@ registerPaymentMethod({
|
||||||
canMakePayment: () => {return true},
|
canMakePayment: () => {return true},
|
||||||
supports: {
|
supports: {
|
||||||
showSavedCards: true,
|
showSavedCards: true,
|
||||||
showSaveOption: true
|
showSaveOption: true,
|
||||||
|
features: config.supports
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,6 +13,9 @@ use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodTyp
|
||||||
use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface;
|
use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface;
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
|
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AdvancedCardPaymentMethod
|
||||||
|
*/
|
||||||
class AdvancedCardPaymentMethod extends AbstractPaymentMethodType {
|
class AdvancedCardPaymentMethod extends AbstractPaymentMethodType {
|
||||||
/**
|
/**
|
||||||
* The URL of this module.
|
* The URL of this module.
|
||||||
|
@ -42,6 +45,14 @@ class AdvancedCardPaymentMethod extends AbstractPaymentMethodType {
|
||||||
*/
|
*/
|
||||||
private $smart_button;
|
private $smart_button;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AdvancedCardPaymentMethod constructor.
|
||||||
|
*
|
||||||
|
* @param string $module_url The URL of this module.
|
||||||
|
* @param string $version The assets version.
|
||||||
|
* @param CreditCardGateway $gateway Credit card gateway.
|
||||||
|
* @param SmartButtonInterface|callable $smart_button The smart button script loading handler.
|
||||||
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $module_url,
|
string $module_url,
|
||||||
string $version,
|
string $version,
|
||||||
|
@ -55,6 +66,9 @@ class AdvancedCardPaymentMethod extends AbstractPaymentMethodType {
|
||||||
$this->smart_button = $smart_button;
|
$this->smart_button = $smart_button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
public function initialize() {}
|
public function initialize() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,6 +104,7 @@ class AdvancedCardPaymentMethod extends AbstractPaymentMethodType {
|
||||||
'title' => $this->gateway->title,
|
'title' => $this->gateway->title,
|
||||||
'description' => $this->gateway->description,
|
'description' => $this->gateway->description,
|
||||||
'scriptData' => $script_data,
|
'scriptData' => $script_data,
|
||||||
|
'supports' => $this->gateway->supports,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue