mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01: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()),
|
||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||
'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';
|
||||
|
@ -48,7 +48,10 @@ class SOFORT
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'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;
|
||||
|
@ -634,4 +634,14 @@ class StripePaymentDriver extends BaseDriver
|
||||
|
||||
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…
Reference in New Issue
Block a user