mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Add improvements based on PR feedback
This commit is contained in:
parent
1523ee4dfb
commit
09ac019bd0
5 changed files with 5 additions and 5 deletions
|
@ -46,7 +46,7 @@ return function ( string $root_dir ): iterable {
|
|||
|
||||
if ( apply_filters(
|
||||
//phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
'woocommerce.deprecated-flags.woocommerce_paypal_payments.saved_payment_checker_enabled',
|
||||
'woocommerce.deprecated_flags.woocommerce_paypal_payments.saved_payment_checker_enabled',
|
||||
getenv( 'PCP_SAVED_PAYMENT_CHECKER_ENABLED' ) === '1'
|
||||
) ) {
|
||||
$modules[] = ( require "$modules_dir/ppcp-saved-payment-checker/module.php" )();
|
||||
|
|
|
@ -194,7 +194,7 @@ class OrderEndpoint {
|
|||
): Order {
|
||||
$bearer = $this->bearer->bearer();
|
||||
$data = array(
|
||||
'intent' => apply_filters( 'woocommerce_paypal_payments_saved_payment_subscription_intent', $this->intent ),
|
||||
'intent' => apply_filters( 'woocommerce_paypal_payments_order_intent', $this->intent ),
|
||||
'purchase_units' => array_map(
|
||||
static function ( PurchaseUnit $item ) use ( $shipping_preference ): array {
|
||||
$data = $item->to_array();
|
||||
|
|
|
@ -1554,7 +1554,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
|
||||
$intent = $this->settings->has( 'intent' ) ? $this->settings->get( 'intent' ) : 'capture';
|
||||
|
||||
return strtolower( apply_filters( 'woocommerce_paypal_payments_saved_payment_subscription_intent', $intent ) );
|
||||
return strtolower( apply_filters( 'woocommerce_paypal_payments_order_intent', $intent ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "woocommerce/ppcp-saved-payment-checked",
|
||||
"name": "woocommerce/ppcp-saved-payment-checker",
|
||||
"type": "dhii-mod",
|
||||
"description": "Saved payments checker module",
|
||||
"license": "GPL-2.0",
|
||||
|
|
|
@ -41,7 +41,7 @@ class SavedPaymentCheckerModule implements ModuleInterface {
|
|||
* Set authorize intent for vaulted subscriptions, so we can void if payment not saved.
|
||||
*/
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_saved_payment_subscription_intent',
|
||||
'woocommerce_paypal_payments_order_intent',
|
||||
function( string $intent ) use ( $c ) {
|
||||
$subscription_helper = $c->get( 'subscription.helper' );
|
||||
assert( $subscription_helper instanceof SubscriptionHelper );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue