mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add ACSS or USD option for ACSS transfers
This commit is contained in:
parent
5b290a99b4
commit
500f289647
@ -56,8 +56,8 @@ class PaymentMethodController extends Controller
|
||||
|
||||
$data['gateway'] = $gateway;
|
||||
|
||||
/** @var \App\Models\ClientContact auth()->user() **/
|
||||
$client_contact = auth()->user();
|
||||
/** @var \App\Models\ClientContact auth()->guard('contact')->user() **/
|
||||
$client_contact = auth()->guard('contact')->user();
|
||||
$data['client'] = $client_contact->client;
|
||||
|
||||
return $gateway
|
||||
@ -77,8 +77,8 @@ class PaymentMethodController extends Controller
|
||||
{
|
||||
$gateway = $this->getClientGateway();
|
||||
|
||||
/** @var \App\Models\ClientContact auth()->user() **/
|
||||
$client_contact = auth()->user();
|
||||
/** @var \App\Models\ClientContact auth()->guard('contact')->user() **/
|
||||
$client_contact = auth()->guard('contact')->user();
|
||||
|
||||
return $gateway
|
||||
->driver($client_contact->client)
|
||||
@ -103,8 +103,8 @@ class PaymentMethodController extends Controller
|
||||
public function verify(ClientGatewayToken $payment_method)
|
||||
{
|
||||
|
||||
/** @var \App\Models\ClientContact auth()->user() **/
|
||||
$client_contact = auth()->user();
|
||||
/** @var \App\Models\ClientContact auth()->guard('contact')->user() **/
|
||||
$client_contact = auth()->guard('contact')->user();
|
||||
|
||||
return $payment_method->gateway
|
||||
->driver($client_contact->client)
|
||||
@ -114,8 +114,8 @@ class PaymentMethodController extends Controller
|
||||
|
||||
public function processVerification(Request $request, ClientGatewaytoken $payment_method)
|
||||
{
|
||||
/** @var \App\Models\ClientContact auth()->user() **/
|
||||
$client_contact = auth()->user();
|
||||
/** @var \App\Models\ClientContact auth()->guard('contact')->user() **/
|
||||
$client_contact = auth()->guard('contact')->user();
|
||||
|
||||
return $payment_method->gateway
|
||||
->driver($client_contact->client)
|
||||
@ -131,7 +131,7 @@ class PaymentMethodController extends Controller
|
||||
*/
|
||||
public function destroy(ClientGatewayToken $payment_method)
|
||||
{
|
||||
/** @var \App\Models\ClientContact auth()->user() **/
|
||||
/** @var \App\Models\ClientContact auth()->guard('contact')->user() **/
|
||||
$client_contact = auth()->guard('contact')->user();
|
||||
|
||||
if ($payment_method->gateway()->exists()) {
|
||||
@ -171,8 +171,8 @@ class PaymentMethodController extends Controller
|
||||
|
||||
private function getClientGateway()
|
||||
{
|
||||
/** @var \App\Models\ClientContact auth()->user() **/
|
||||
$client_contact = auth()->user();
|
||||
/** @var \App\Models\ClientContact auth()->guard('contact')->user() **/
|
||||
$client_contact = auth()->guard('contact')->user();
|
||||
|
||||
if (request()->query('method') == GatewayType::CREDIT_CARD) {
|
||||
return $client_contact->client->getCreditCardGateway();
|
||||
|
@ -661,7 +661,8 @@ class Client extends BaseModel implements HasLocalePreference
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->currency()->code == 'CAD' && in_array(GatewayType::ACSS, array_column($pms, 'gateway_type_id'))) {
|
||||
if (in_array($this->currency()->code, ['CAD','USD']) && in_array(GatewayType::ACSS, array_column($pms, 'gateway_type_id'))) {
|
||||
// if ($this->currency()->code == 'CAD' && in_array(GatewayType::ACSS, array_column($pms, 'gateway_type_id'))) {
|
||||
foreach ($pms as $pm) {
|
||||
if ($pm['gateway_type_id'] == GatewayType::ACSS) {
|
||||
$cg = CompanyGateway::query()->find($pm['company_gateway_id']);
|
||||
|
@ -63,7 +63,7 @@ class ACSS implements LivewireMethodInterface
|
||||
'customer' => $data['customer'],
|
||||
'payment_method_options' => [
|
||||
'acss_debit' => [
|
||||
'currency' => 'cad',
|
||||
'currency' => strtolower($this->stripe->client->currency()->code),
|
||||
'mandate_options' => [
|
||||
'payment_schedule' => 'combined',
|
||||
'interval_description' => 'On any invoice due date',
|
||||
@ -183,7 +183,7 @@ class ACSS implements LivewireMethodInterface
|
||||
'customer' => $data['customer'],
|
||||
'payment_method_options' => [
|
||||
'acss_debit' => [
|
||||
'currency' => 'cad',
|
||||
'currency' => strtolower($this->stripe->client->currency()->code),
|
||||
'mandate_options' => [
|
||||
'payment_schedule' => 'combined',
|
||||
'interval_description' => 'On any invoice due date',
|
||||
|
Loading…
x
Reference in New Issue
Block a user