Fixes for blank currency_id in manually created payments

This commit is contained in:
David Bomba 2022-02-02 19:51:29 +11:00
parent 8918431b51
commit c1081f46ce
2 changed files with 9 additions and 1 deletions

View File

@ -58,11 +58,16 @@ class CreditCard
public function paymentView(array $data) public function paymentView(array $data)
{ {
$description = $this->stripe->decodeUnicodeString(ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number')) . " for client {$this->stripe->client->present()->name()}";
$payment_intent_data = [ $payment_intent_data = [
'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->stripe->decodeUnicodeString(ctrans('texts.invoices') . ': ' . collect($data['invoices'])->pluck('invoice_number')), 'description' => $description,
'metadata' => [ 'metadata' => [
'payment_hash' => $this->stripe->payment_hash->hash, 'payment_hash' => $this->stripe->payment_hash->hash,
'gateway_type_id' => GatewayType::CREDIT_CARD, 'gateway_type_id' => GatewayType::CREDIT_CARD,

View File

@ -211,6 +211,9 @@ class PaymentRepository extends BaseRepository {
$payment->currency_id = $client_currency; $payment->currency_id = $client_currency;
} }
$payment->currency_id = $company_currency;
return $payment; return $payment;
} }