mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Hide bancontact from PayPal buttons
This commit is contained in:
parent
1628f86d4c
commit
86acc00f85
3 changed files with 16 additions and 8 deletions
|
@ -73,8 +73,9 @@ class Orders {
|
|||
$url = trailingslashit( $this->host ) . 'v2/checkout/orders';
|
||||
|
||||
$default_headers = array(
|
||||
'Authorization' => 'Bearer ' . $bearer->token(),
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => 'Bearer ' . $bearer->token(),
|
||||
'Content-Type' => 'application/json',
|
||||
'PayPal-Request-Id' => uniqid( 'ppcp-', true ),
|
||||
);
|
||||
$headers = array_merge(
|
||||
$default_headers,
|
||||
|
|
|
@ -129,15 +129,11 @@ class BancontactGateway extends WC_Payment_Gateway {
|
|||
'application_context' => array(
|
||||
'locale' => 'en-BE',
|
||||
'return_url' => $this->get_return_url( $wc_order ),
|
||||
'cancel_url' => $this->get_return_url( $wc_order ),
|
||||
'cancel_url' => wc_get_checkout_url(),
|
||||
),
|
||||
);
|
||||
|
||||
$headers = array(
|
||||
'PayPal-Request-Id' => uniqid( 'ppcp-', true ),
|
||||
);
|
||||
|
||||
$response = $this->orders_endpoint->create( $request_body, $headers );
|
||||
$response = $this->orders_endpoint->create( $request_body );
|
||||
$body = json_decode( $response['body'] );
|
||||
|
||||
$payer_action = '';
|
||||
|
|
|
@ -53,5 +53,16 @@ class LocalAlternativePaymentMethodsModule implements ModuleInterface {
|
|||
$payment_method_registry->register( $c->get( 'ppcp-local-apms.bancontact.payment-method' ) );
|
||||
}
|
||||
);
|
||||
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_localized_script_data',
|
||||
function ( array $data ) {
|
||||
$default_disable_funding = $data['url_params']['disable-funding'] ?? '';
|
||||
$disable_funding = array_merge( array( 'bancontact' ), array_filter( explode( ',', $default_disable_funding ) ) );
|
||||
$data['url_params']['disable-funding'] = implode( ',', array_unique( $disable_funding ) );
|
||||
|
||||
return $data;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue