mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add bic field for iDeal gateway and local apms to allowed refund list
This commit is contained in:
parent
9e8ee47ecb
commit
23f9bb246c
3 changed files with 28 additions and 2 deletions
|
@ -119,6 +119,13 @@ class IDealGateway extends WC_Payment_Gateway {
|
|||
'desc_tip' => true,
|
||||
'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce-paypal-payments' ),
|
||||
),
|
||||
'bic' => array(
|
||||
'title' => __( 'BIC', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'text',
|
||||
'default' => '',
|
||||
'desc_tip' => true,
|
||||
'description' => __( 'Business identification number (BIC) to identify the specific bank.', 'woocommerce-paypal-payments' ),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -139,7 +146,10 @@ class IDealGateway extends WC_Payment_Gateway {
|
|||
'country_code' => $wc_order->get_billing_country(),
|
||||
'name' => $wc_order->get_billing_first_name() . ' ' . $wc_order->get_billing_last_name(),
|
||||
);
|
||||
// TODO get "bic" from gateway settings.
|
||||
$bic = $this->get_option( 'bic' ) ?? '';
|
||||
if ( $bic ) {
|
||||
$payment_source['bic'] = $bic;
|
||||
}
|
||||
|
||||
$request_body = array(
|
||||
'intent' => 'CAPTURE',
|
||||
|
|
|
@ -178,6 +178,18 @@ class LocalAlternativePaymentMethodsModule implements ModuleInterface {
|
|||
10,
|
||||
2
|
||||
);
|
||||
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_allowed_refund_payment_methods',
|
||||
function( array $payment_methods ) use ( $c ): array {
|
||||
$local_payment_methods = $c->get( 'ppcp-local-apms.payment-methods' );
|
||||
foreach ( $local_payment_methods as $payment_method ) {
|
||||
$payment_methods[] = $payment_method['id'];
|
||||
}
|
||||
|
||||
return $payment_methods;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue