mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:07:33 -05:00 
			
		
		
		
	Archive payment token, instead of deleting it.
This commit is contained in:
		
							parent
							
								
									133c49595f
								
							
						
					
					
						commit
						7dbb9bd60a
					
				@ -51,6 +51,7 @@ use App\PaymentDrivers\Stripe\SOFORT;
 | 
				
			|||||||
use App\PaymentDrivers\Stripe\UpdatePaymentMethods;
 | 
					use App\PaymentDrivers\Stripe\UpdatePaymentMethods;
 | 
				
			||||||
use App\PaymentDrivers\Stripe\Utilities;
 | 
					use App\PaymentDrivers\Stripe\Utilities;
 | 
				
			||||||
use App\PaymentDrivers\Stripe\iDeal;
 | 
					use App\PaymentDrivers\Stripe\iDeal;
 | 
				
			||||||
 | 
					use App\Repositories\ClientGatewayTokenRepository;
 | 
				
			||||||
use App\Utils\Traits\MakesHash;
 | 
					use App\Utils\Traits\MakesHash;
 | 
				
			||||||
use Exception;
 | 
					use Exception;
 | 
				
			||||||
use Google\Service\ServiceConsumerManagement\CustomError;
 | 
					use Google\Service\ServiceConsumerManagement\CustomError;
 | 
				
			||||||
@ -769,12 +770,14 @@ class StripePaymentDriver extends BaseDriver
 | 
				
			|||||||
                };
 | 
					                };
 | 
				
			||||||
                return response()->json([], 200);
 | 
					                return response()->json([], 200);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            elseif ($request->data['object']['status'] === "inactive"){
 | 
					            elseif ($request->data['object']['status'] === "inactive" && $request->data['object']['payment_method']){
 | 
				
			||||||
                // Deactivate payment method
 | 
					                // Delete payment method
 | 
				
			||||||
                $clientgateway = ClientGatewayToken::query()
 | 
					                // $clientgateway = ClientGatewayToken::query()
 | 
				
			||||||
                    ->where('token', $request->data['object']['payment_method'])
 | 
					                //    ->where('token', $request->data['object']['payment_method'])
 | 
				
			||||||
                    ->first();
 | 
					                //    ->first();
 | 
				
			||||||
                $clientgateway->delete();
 | 
					                // $clientgateway->delete();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                (new ClientGatewayTokenRepository)->archive($request->data['object']['payment_method']);
 | 
				
			||||||
                return response()->json([], 200);
 | 
					                return response()->json([], 200);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            elseif ($request->data['object']['status'] === "pending"){
 | 
					            elseif ($request->data['object']['status'] === "pending"){
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user