This commit is contained in:
David Remer 2020-09-18 12:02:27 +03:00
parent 1537ae6540
commit 8478a7e18a
2 changed files with 9 additions and 3 deletions

View file

@ -686,7 +686,7 @@ class SmartButton implements SmartButtonInterface {
}
$params['disable-funding'] = implode( ',', array_unique( $disable_funding ) );
$smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' );
$smart_button_url = add_query_arg( $params, 'https://www.paypal.com/sdk/js' );
return $smart_button_url;
}

View file

@ -54,6 +54,11 @@ class ApproveOrderEndpoint implements EndpointInterface {
*/
private $threed_secure;
/**
* The settings.
*
* @var Settings
*/
private $settings;
/**
@ -63,6 +68,7 @@ class ApproveOrderEndpoint implements EndpointInterface {
* @param OrderEndpoint $order_endpoint The order endpoint.
* @param SessionHandler $session_handler The session handler.
* @param ThreeDSecure $three_d_secure The 3d secure helper object.
* @param Settings $settings The settings.
*/
public function __construct(
RequestData $request_data,
@ -116,8 +122,8 @@ class ApproveOrderEndpoint implements EndpointInterface {
if ( $order->payment_source() && $order->payment_source()->card() ) {
if (
$this->settings->has('disable_cards')
&& in_array( strtolower($order->payment_source()->card()->brand()), (array) $this->settings->get( 'disable_cards' ), true )
$this->settings->has( 'disable_cards' )
&& in_array( strtolower( $order->payment_source()->card()->brand() ), (array) $this->settings->get( 'disable_cards' ), true )
) {
throw new RuntimeException(
__(