Restructure Advanced Card Processing settings

This commit is contained in:
Pedro Silva 2024-03-01 15:05:17 +00:00
parent 7003639c85
commit b7d43d3c5b
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
5 changed files with 100 additions and 47 deletions

View file

@ -91,7 +91,7 @@ return array(
$connection_link = '<a href="' . $connection_url . '" style="pointer-events: auto">';
return $insert_after(
$fields,
'allow_card_button_gateway',
'digital_wallet_heading',
array(
'applepay_button_enabled' => array(
'title' => __( 'Apple Pay Button', 'woocommerce-paypal-payments' ),
@ -109,7 +109,7 @@ return array(
. '</p>',
'default' => 'yes',
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
'custom_attributes' => array(
'data-ppcp-display' => wp_json_encode(
@ -129,7 +129,7 @@ return array(
return $insert_after(
$fields,
'allow_card_button_gateway',
'digital_wallet_heading',
array(
'spacer' => array(
'title' => '',
@ -138,7 +138,7 @@ return array(
'class' => array(),
'classes' => array( 'ppcp-active-spacer' ),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_button_enabled' => array(
@ -155,7 +155,7 @@ return array(
. '</p>',
'default' => 'yes',
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
'custom_attributes' => array(
'data-ppcp-display' => wp_json_encode(
@ -194,7 +194,7 @@ return array(
'classes' => array( 'ppcp-field-indent' ),
'class' => array(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_button_domain_validation' => array(
@ -217,7 +217,7 @@ return array(
'classes' => array( 'ppcp-field-indent' ),
'class' => array(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_button_device_eligibility' => array(
@ -235,7 +235,7 @@ return array(
'classes' => array( 'ppcp-field-indent' ),
'class' => array(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_button_type' => array(
@ -252,7 +252,7 @@ return array(
'default' => 'pay',
'options' => PropertiesDictionary::button_types(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_button_color' => array(
@ -270,7 +270,7 @@ return array(
'default' => 'black',
'options' => PropertiesDictionary::button_colors(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_button_language' => array(
@ -287,7 +287,7 @@ return array(
'default' => 'en',
'options' => PropertiesDictionary::button_languages(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'applepay_checkout_data_mode' => array(
@ -301,7 +301,7 @@ return array(
'default' => PropertiesDictionary::BILLING_DATA_MODE_DEFAULT,
'options' => PropertiesDictionary::billing_data_modes(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
)

View file

@ -33,7 +33,7 @@ return array(
// Standard Payments tab fields.
return $insert_after(
$fields,
'vault_enabled',
'vault_enabled_dcc',
array(
'axo_enabled' => array(
'title' => __( 'Fastlane', 'woocommerce-paypal-payments' ),
@ -49,7 +49,7 @@ return array(
. '</p>',
'default' => 'yes',
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
'custom_attributes' => array(
'data-ppcp-display' => wp_json_encode(
@ -84,7 +84,7 @@ return array(
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'paypal',
'gateway' => 'dcc',
),
'axo_email_widget' => array(
'title' => __( 'Email Widget', 'woocommerce-paypal-payments' ),
@ -100,7 +100,7 @@ return array(
'default' => 'pay',
'options' => PropertiesDictionary::email_widget_options(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'axo_address_widget' => array(
@ -117,7 +117,7 @@ return array(
'default' => 'pay',
'options' => PropertiesDictionary::address_widget_options(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'axo_payment_widget' => array(
@ -135,7 +135,7 @@ return array(
'default' => 'black',
'options' => PropertiesDictionary::payment_widget_options(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
)

View file

@ -181,7 +181,7 @@ class AxoGateway extends WC_Payment_Gateway {
* @return array
*/
public function process_payment( $order_id ) {
$wc_order = wc_get_order( $order_id );
$wc_order = wc_get_order( $order_id );
$purchase_unit = $this->purchase_unit_factory->from_wc_order( $wc_order );
$nonce = 'tokencc_bh_vkjzxd_tgpd3n_qmjs7k_3vhxzg_p82';
@ -192,7 +192,7 @@ class AxoGateway extends WC_Payment_Gateway {
'checkout'
);
$payment_source_properties = new \stdClass();
$payment_source_properties = new \stdClass();
$payment_source_properties->single_use_token = $nonce;
$payment_source = new PaymentSource(

View file

@ -62,7 +62,7 @@ return array(
$connection_link = '<a href="' . $connection_url . '" style="pointer-events: auto">';
return $insert_after(
$fields,
'allow_card_button_gateway',
'digital_wallet_heading',
array(
'googlepay_button_enabled' => array(
'title' => __( 'Google Pay Button', 'woocommerce-paypal-payments' ),
@ -80,7 +80,7 @@ return array(
. '</p>',
'default' => 'yes',
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
'custom_attributes' => array(
'data-ppcp-display' => wp_json_encode(
@ -101,7 +101,7 @@ return array(
// Standard Payments tab fields.
return $insert_after(
$fields,
'allow_card_button_gateway',
'digital_wallet_heading',
array(
'googlepay_button_enabled' => array(
'title' => __( 'Google Pay Button', 'woocommerce-paypal-payments' ),
@ -117,7 +117,7 @@ return array(
. '</p>',
'default' => 'yes',
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
'custom_attributes' => array(
'data-ppcp-display' => wp_json_encode(
@ -149,7 +149,7 @@ return array(
'default' => 'pay',
'options' => PropertiesDictionary::button_types(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'googlepay_button_color' => array(
@ -167,7 +167,7 @@ return array(
'default' => 'black',
'options' => PropertiesDictionary::button_colors(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'googlepay_button_language' => array(
@ -184,7 +184,7 @@ return array(
'default' => 'en',
'options' => PropertiesDictionary::button_languages(),
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
'googlepay_button_shipping_enabled' => array(
@ -199,7 +199,7 @@ return array(
'label' => __( 'Enable Google Pay shipping callback', 'woocommerce-paypal-payments' ),
'default' => 'no',
'screens' => array( State::STATE_ONBOARDED ),
'gateway' => 'paypal',
'gateway' => 'dcc',
'requirements' => array(),
),
)

View file

@ -792,25 +792,6 @@ return array(
),
'gateway' => 'dcc',
),
'vault_enabled_dcc' => array(
'title' => __( 'Vaulting', 'woocommerce-paypal-payments' ),
'type' => 'checkbox',
'desc_tip' => true,
'label' => sprintf(
// translators: %1$s and %2$s are the opening and closing of HTML <a> tag.
__( 'Securely store your customers credit cards for a seamless checkout experience and subscription features. Payment methods are saved in the secure %1$sPayPal Vault%2$s.', 'woocommerce-paypal-payments' ),
'<a href="https://woocommerce.com/document/woocommerce-paypal-payments/#vaulting-saving-a-payment-method" target="_blank">',
'</a>'
),
'description' => __( 'Allow registered buyers to save Credit Card payments.', 'woocommerce-paypal-payments' ),
'default' => false,
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'dcc',
'input_class' => $container->get( 'wcgateway.helper.vaulting-scope' ) ? array() : array( 'ppcp-disabled-checkbox' ),
),
'3d_secure_heading' => array(
'heading' => __( '3D Secure', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-heading',
@ -867,6 +848,52 @@ return array(
),
'gateway' => 'dcc',
),
'saved_payments_heading' => array(
'heading' => __( 'Saved Payments', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-heading',
'description' => wp_kses_post(
sprintf(
// translators: %1$s and %2$s is a link tag.
__(
'PayPal can securely store your customers payment methods for
%1$sfuture payments and subscriptions%2$s, simplifying the checkout
process and enabling recurring transactions on your website.',
'woocommerce-paypal-payments'
),
'<a
rel="noreferrer noopener"
href="https://woo.com/document/woocommerce-paypal-payments/#vaulting-a-card"
>',
'</a>'
)
),
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(
'dcc',
),
'gateway' => 'dcc',
),
'vault_enabled_dcc' => array(
'title' => __( 'Vaulting', 'woocommerce-paypal-payments' ),
'type' => 'checkbox',
'desc_tip' => true,
'label' => sprintf(
// translators: %1$s and %2$s are the opening and closing of HTML <a> tag.
__( 'Securely store your customers credit cards for a seamless checkout experience and subscription features. Payment methods are saved in the secure %1$sPayPal Vault%2$s.', 'woocommerce-paypal-payments' ),
'<a href="https://woocommerce.com/document/woocommerce-paypal-payments/#vaulting-saving-a-payment-method" target="_blank">',
'</a>'
),
'description' => __( 'Allow registered buyers to save Credit Card payments.', 'woocommerce-paypal-payments' ),
'default' => false,
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => 'dcc',
'input_class' => $container->get( 'wcgateway.helper.vaulting-scope' ) ? array() : array( 'ppcp-disabled-checkbox' ),
),
'paypal_saved_payments' => array(
'heading' => __( 'Saved payments', 'woocommerce-paypal-payments' ),
'description' => sprintf(
@ -905,6 +932,32 @@ return array(
'gateway' => 'paypal',
'input_class' => $container->get( 'wcgateway.helper.vaulting-scope' ) ? array() : array( 'ppcp-disabled-checkbox' ),
),
'digital_wallet_heading' => array(
'heading' => __( 'Digital Wallet Services', 'woocommerce-paypal-payments' ),
'type' => 'ppcp-heading',
'description' => wp_kses_post(
sprintf(
// translators: %1$s and %2$s is a link tag.
__(
'PayPal supports digital wallet services like Apple Pay or Google Pay
to give your buyers more options to pay without a PayPal account.',
'woocommerce-paypal-payments'
),
'<a
rel="noreferrer noopener"
href="https://woo.com/document/woocommerce-paypal-payments/#vaulting-a-card"
>',
'</a>'
)
),
'screens' => array(
State::STATE_ONBOARDED,
),
'requirements' => array(
'dcc',
),
'gateway' => 'dcc',
),
);
if ( ! $subscription_helper->plugin_is_active() ) {