mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Set previous failure behavior value if setting not saved yet
This commit is contained in:
parent
7d541812e8
commit
5d875487b0
1 changed files with 4 additions and 3 deletions
|
@ -143,12 +143,13 @@ class PaymentTokenChecker {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$subscription_behavior_when_fails = $this->settings->get( 'subscription_behavior_when_vault_fails' );
|
$subscription_behavior_when_fails = $this->settings->get( 'subscription_behavior_when_vault_fails' );
|
||||||
$wc_order->update_meta_data( self::VAULTING_FAILED_META_KEY, $subscription_behavior_when_fails );
|
|
||||||
$wc_order->save_meta_data();
|
|
||||||
} catch ( NotFoundException $exception ) {
|
} catch ( NotFoundException $exception ) {
|
||||||
return;
|
$subscription_behavior_when_fails = 'void_auth';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$wc_order->update_meta_data( self::VAULTING_FAILED_META_KEY, $subscription_behavior_when_fails );
|
||||||
|
$wc_order->save_meta_data();
|
||||||
|
|
||||||
switch ( $subscription_behavior_when_fails ) {
|
switch ( $subscription_behavior_when_fails ) {
|
||||||
case 'void_auth':
|
case 'void_auth':
|
||||||
$order = $this->order_repository->for_wc_order( $wc_order );
|
$order = $this->order_repository->for_wc_order( $wc_order );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue