mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
map master_card to mastercard
This commit is contained in:
parent
8478a7e18a
commit
fed6df2578
1 changed files with 15 additions and 11 deletions
|
@ -121,17 +121,21 @@ class ApproveOrderEndpoint implements EndpointInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $order->payment_source() && $order->payment_source()->card() ) {
|
if ( $order->payment_source() && $order->payment_source()->card() ) {
|
||||||
if (
|
if ( $this->settings->has( 'disable_cards' ) ) {
|
||||||
$this->settings->has( 'disable_cards' )
|
$disabled_cards = (array) $this->settings->get( 'disable_cards' );
|
||||||
&& in_array( strtolower( $order->payment_source()->card()->brand() ), (array) $this->settings->get( 'disable_cards' ), true )
|
if ( in_array( 'mastercard', $disabled_cards, true ) ) {
|
||||||
) {
|
$disabled_cards[] = 'master_card';
|
||||||
throw new RuntimeException(
|
}
|
||||||
__(
|
$card = strtolower( $order->payment_source()->card()->brand() );
|
||||||
'Unfortunately, we do not accept this card.',
|
if ( in_array( $card, $disabled_cards, true ) ) {
|
||||||
'paypal-payments-for-woocommerce'
|
throw new RuntimeException(
|
||||||
),
|
__(
|
||||||
100
|
'Unfortunately, we do not accept this card.',
|
||||||
);
|
'paypal-payments-for-woocommerce'
|
||||||
|
),
|
||||||
|
100
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$proceed = $this->threed_secure->proceed_with_order( $order );
|
$proceed = $this->threed_secure->proceed_with_order( $order );
|
||||||
if ( ThreeDSecure::RETRY === $proceed ) {
|
if ( ThreeDSecure::RETRY === $proceed ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue