mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 05:54:34 -04:00
Fixes for translation of direct debit / bank transfer
This commit is contained in:
parent
eefc67078d
commit
37b2a38c20
@ -144,7 +144,7 @@ class GatewayType extends StaticModel
|
||||
case self::ACSS:
|
||||
return ctrans('texts.acss');
|
||||
case self::DIRECT_DEBIT:
|
||||
return ctrans('texts.payment_type_direct_debit');
|
||||
return ctrans('texts.bank_transfer') . " / " . ctrans('texts.payment_type_direct_debit');
|
||||
case self::INSTANT_BANK_PAY:
|
||||
return ctrans('texts.payment_type_instant_bank_pay');
|
||||
case self::FPX:
|
||||
|
@ -74,6 +74,7 @@ class PaymentType extends StaticModel
|
||||
const KLARNA = 47;
|
||||
const Interac_E_Transfer = 48;
|
||||
const BACS = 49;
|
||||
const STRIPE_BANK_TRANSFER = 50;
|
||||
|
||||
public array $type_names = [
|
||||
self::CREDIT => 'payment_type_Credit',
|
||||
@ -115,6 +116,7 @@ class PaymentType extends StaticModel
|
||||
self::FPX => 'fpx',
|
||||
self::KLARNA => 'payment_type_Klarna',
|
||||
self::Interac_E_Transfer => 'payment_type_Interac E Transfer',
|
||||
self::STRIPE_BANK_TRANSFER => 'bank_transfer',
|
||||
];
|
||||
|
||||
public static function parseCardType($cardName)
|
||||
|
@ -153,16 +153,16 @@ class BankTransfer
|
||||
public function formatDataForUk(PaymentIntent $pi): array
|
||||
{
|
||||
return [
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->account_holder_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->account_number,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->sort_code,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->account_holder_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->account_number,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->sort_code,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
|
||||
];
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -174,16 +174,16 @@ class BankTransfer
|
||||
public function formatDataforMx(PaymentIntent $pi): array
|
||||
{
|
||||
return [
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->bank_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->bank_code,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->clabe,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->bank_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->bank_code,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->clabe,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
|
||||
];
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -245,7 +245,7 @@ class BankTransfer
|
||||
|
||||
$data = [
|
||||
'payment_method' => $payment_intent->payment_method,
|
||||
'payment_type' => PaymentType::DIRECT_DEBIT,
|
||||
'payment_type' => PaymentType::STRIPE_BANK_TRANSFER,
|
||||
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||
'transaction_reference' => $payment_intent->id,
|
||||
'gateway_type_id' => GatewayType::DIRECT_DEBIT,
|
||||
|
Loading…
x
Reference in New Issue
Block a user