mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
Add option for sending billing data
This commit is contained in:
parent
fb0bd85da6
commit
8c77258828
5 changed files with 30 additions and 4 deletions
|
@ -867,6 +867,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
'single_product_buttons_enabled' => $this->settings->has( 'button_product_enabled' ) && $this->settings->get( 'button_product_enabled' ),
|
||||
'mini_cart_buttons_enabled' => $this->settings->has( 'button_mini-cart_enabled' ) && $this->settings->get( 'button_mini-cart_enabled' ),
|
||||
'basic_checkout_validation_enabled' => $this->basic_checkout_validation_enabled,
|
||||
'use_form_billing_data_for_cards' => $this->settings->has( 'use_form_billing_data_for_cards' ) && $this->settings->get( 'use_form_billing_data_for_cards' ),
|
||||
);
|
||||
|
||||
if ( $this->style_for_context( 'layout', 'mini-cart' ) !== 'horizontal' ) {
|
||||
|
|
|
@ -404,7 +404,10 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
$payer = $this->payer_factory->from_paypal_response( json_decode( wp_json_encode( $data['payer'] ) ) );
|
||||
}
|
||||
|
||||
if ( ! $payer && isset( $data['form'] ) ) {
|
||||
$use_form_billing_data_for_cards = $this->settings->has( 'use_form_billing_data_for_cards' ) &&
|
||||
(bool) $this->settings->get( 'use_form_billing_data_for_cards' );
|
||||
|
||||
if ( ! $payer && isset( $data['form'] ) && $use_form_billing_data_for_cards ) {
|
||||
$form_fields = $data['form'];
|
||||
|
||||
if ( is_array( $form_fields ) && isset( $form_fields['billing_email'] ) && '' !== $form_fields['billing_email'] ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue