mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:47:32 -05:00 
			
		
		
		
	
						commit
						ceaa45f9a9
					
				@ -63,7 +63,7 @@ class CreditCard
 | 
				
			|||||||
            'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
 | 
					            'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
 | 
				
			||||||
            'currency' => $this->stripe->client->getCurrencyCode(),
 | 
					            'currency' => $this->stripe->client->getCurrencyCode(),
 | 
				
			||||||
            'customer' => $this->stripe->findOrCreateCustomer(),
 | 
					            'customer' => $this->stripe->findOrCreateCustomer(),
 | 
				
			||||||
            'description' => $this->decodeUnicodeString(ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number')),
 | 
					            'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number')),
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $payment_intent_data['setup_future_usage'] = 'off_session';
 | 
					        $payment_intent_data['setup_future_usage'] = 'off_session';
 | 
				
			||||||
 | 
				
			|||||||
@ -48,7 +48,10 @@ class SOFORT
 | 
				
			|||||||
        $intent = \Stripe\PaymentIntent::create([
 | 
					        $intent = \Stripe\PaymentIntent::create([
 | 
				
			||||||
            'amount' => $data['stripe_amount'],
 | 
					            'amount' => $data['stripe_amount'],
 | 
				
			||||||
            'currency' => 'eur',
 | 
					            'currency' => 'eur',
 | 
				
			||||||
            'payment_method_types' => ['sofort']
 | 
					            'payment_method_types' => ['sofort'],
 | 
				
			||||||
 | 
					            'customer' => $this->stripe->findOrCreateCustomer(),
 | 
				
			||||||
 | 
					            'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number')),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ]);
 | 
					        ]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $data['pi_client_secret'] = $intent->client_secret;
 | 
					        $data['pi_client_secret'] = $intent->client_secret;
 | 
				
			||||||
 | 
				
			|||||||
@ -634,4 +634,14 @@ class StripePaymentDriver extends BaseDriver
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return response()->json(['message' => 'success'], 200);
 | 
					        return response()->json(['message' => 'success'], 200);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function decodeUnicodeString($string)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return html_entity_decode($string, ENT_QUOTES, 'UTF-8');
 | 
				
			||||||
 | 
					        // return iconv("UTF-8", "ISO-8859-1//TRANSLIT", $this->decode_encoded_utf8($string));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function decode_encoded_utf8($string){
 | 
				
			||||||
 | 
					        return preg_replace_callback('#\\\\u([0-9a-f]{4})#ism', function($matches) { return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE"); }, $string);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user