mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Check if payment source is not null
This commit is contained in:
parent
7832d7f9ac
commit
f94273c477
1 changed files with 2 additions and 4 deletions
|
@ -145,10 +145,8 @@ class ApproveOrderEndpoint implements EndpointInterface {
|
|||
|
||||
$order = $this->api_endpoint->order( $data['order_id'] );
|
||||
|
||||
$payment_source = $order->payment_source();
|
||||
assert( $payment_source instanceof PaymentSource );
|
||||
|
||||
if ( $payment_source->name() === 'card' ) {
|
||||
$payment_source = $order->payment_source() ?? null;
|
||||
if ( $payment_source && $payment_source->name() === 'card' ) {
|
||||
if ( $this->settings->has( 'disable_cards' ) ) {
|
||||
$disabled_cards = (array) $this->settings->get( 'disable_cards' );
|
||||
$card = strtolower( $payment_source->properties()->brand ?? '' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue