Skip to content

Undefined Index: on card_verification, Logic should be improved. #313

@vijayhardaha

Description

@vijayhardaha

if ( 'error' === $result['card_verification'] ) {
WC_Checkoutcom_Utility::wc_add_notice_self( __( 'Unable to add payment method to your account.', 'checkout-com-unified-payments-api' ), 'error' );
wp_redirect( $result['redirection_url'] );
exit;
}
// Redirect to my-account/payment-method if card verification successful.
// show notice to customer.
if ( 'Card Verified' === $result['status'] && isset( $result['metadata']['card_verification'] ) ) {
$this->save_token( get_current_user_id(), $result );
WC_Checkoutcom_Utility::wc_add_notice_self( __( 'Payment method successfully added.', 'checkout-com-unified-payments-api' ), 'notice' );
wp_redirect( $result['metadata']['redirection_url'] );
exit;
}

Line 565 with if ( 'error' === $result['card_verification'] ), created an notice error Undefined index: card_verification

So what should be actually checked here? $result['card_verification'] or $result['metadata']['card_verification'] ? OR both?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions