mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 11:17:34 -04:00 
			
		
		
		
	More fixes
This commit is contained in:
		
							parent
							
								
									b679e4e349
								
							
						
					
					
						commit
						fda44f1552
					
				| @ -109,31 +109,31 @@ class BACS | |||||||
|         if ($state['payment_intent']->status == 'processing') { |         if ($state['payment_intent']->status == 'processing') { | ||||||
|             $this->stripe->logSuccessfulGatewayResponse(['response' => $state['payment_intent'], 'data' => $this->stripe->payment_hash], SystemLog::TYPE_STRIPE); |             $this->stripe->logSuccessfulGatewayResponse(['response' => $state['payment_intent'], 'data' => $this->stripe->payment_hash], SystemLog::TYPE_STRIPE); | ||||||
| 
 | 
 | ||||||
|             return $this->processSuccessfulPayment(); |             return $this->processSuccessfulPayment($state['payment_intent']); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return $this->processUnsuccessfulPayment(""); |         return $this->processUnsuccessfulPayment(""); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function processSuccessfulPayment() |     public function processSuccessfulPayment($payment_id) | ||||||
|     { |     { | ||||||
|         UpdateCustomer::dispatch($this->stripe->company_gateway->company->company_key, $this->stripe->company_gateway->id, $this->stripe->client->id); |         UpdateCustomer::dispatch($this->stripe->company_gateway->company->company_key, $this->stripe->company_gateway->id, $this->stripe->client->id); | ||||||
| 
 | 
 | ||||||
|         $data = [ |         $data = [ | ||||||
|             'payment_method' => $this->stripe->payment_hash->data->server_response->payment_method, |             'payment_method' => $payment_id['id'], | ||||||
|             'payment_type' => PaymentType::BACS, |             'payment_type' => PaymentType::BACS, | ||||||
|             'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->server_response->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), |             'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->server_response->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), | ||||||
|             'transaction_reference' => isset($this->stripe->payment_hash->data->payment_intent->latest_charge) ? $this->stripe->payment_hash->data->payment_intent->latest_charge : optional($this->stripe->payment_hash->data->payment_intent->charges->data[0])->id, |             'transaction_reference' => $payment_id['id'], | ||||||
|             'gateway_type_id' => GatewayType::BACS, |             'gateway_type_id' => GatewayType::BACS, | ||||||
|         ]; |         ]; | ||||||
| 
 | 
 | ||||||
|         $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['amount' => $data['amount']]); |         $this->stripe->payment_hash->data = array_merge((array) $payment_id, ['amount' => $data['amount']]); | ||||||
|         $this->stripe->payment_hash->save(); |         $this->stripe->payment_hash->save(); | ||||||
| 
 | 
 | ||||||
|         $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); |         $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); | ||||||
| 
 | 
 | ||||||
|         SystemLogger::dispatch( |         SystemLogger::dispatch( | ||||||
|             ['response' => $this->stripe->payment_hash->data->server_response, 'data' => $data], |             ['response' => $payment_id, 'data' => $data], | ||||||
|             SystemLog::CATEGORY_GATEWAY_RESPONSE, |             SystemLog::CATEGORY_GATEWAY_RESPONSE, | ||||||
|             SystemLog::EVENT_GATEWAY_SUCCESS, |             SystemLog::EVENT_GATEWAY_SUCCESS, | ||||||
|             SystemLog::TYPE_STRIPE, |             SystemLog::TYPE_STRIPE, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user