mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 02:57:33 -05:00 
			
		
		
		
	
						commit
						09babb4afe
					
				@ -204,9 +204,18 @@ class AuthorizeCreditCard
 | 
			
		||||
        $response = $data['response'];
 | 
			
		||||
        $amount = array_key_exists('amount_with_fee', $data) ? $data['amount_with_fee'] : 0;
 | 
			
		||||
 | 
			
		||||
        PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransId(), $this->authorize->client->company, $data['amount_with_fee']);
 | 
			
		||||
        $code = "Error";
 | 
			
		||||
        $description = "There was an error processing the payment";
 | 
			
		||||
 | 
			
		||||
        if ($response->getErrors() != null) {
 | 
			
		||||
            $code = $response->getErrors()[0]->getErrorCode();
 | 
			
		||||
            $description = $response->getErrors()[0]->getErrorText();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransId(), $this->authorize->client->company, $amount);
 | 
			
		||||
 | 
			
		||||
        throw new PaymentFailed($description, $code);
 | 
			
		||||
 | 
			
		||||
        throw new \Exception(ctrans('texts.error_title'));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private function formatGatewayResponse($data, $vars)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user