diff --git a/app/Models/Client.php b/app/Models/Client.php index 0c7bbb3d84..48ce8d6c8c 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -529,17 +529,17 @@ class Client extends BaseModel implements HasLocalePreference } - if ($this->currency()->code == 'EUR' && in_array(GatewayType::SEPA, array_column($pms, 'gateway_type_id'))) { - foreach ($pms as $pm) { - if ($pm['gateway_type_id'] == GatewayType::SEPA) { - $cg = CompanyGateway::find($pm['company_gateway_id']); + // if ($this->currency()->code == 'EUR' && in_array(GatewayType::SEPA, array_column($pms, 'gateway_type_id'))) { + // foreach ($pms as $pm) { + // if ($pm['gateway_type_id'] == GatewayType::SEPA) { + // $cg = CompanyGateway::find($pm['company_gateway_id']); - if ($cg && $cg->fees_and_limits->{GatewayType::SEPA}->is_enabled) { - return $cg; - } - } - } - } + // if ($cg && $cg->fees_and_limits->{GatewayType::SEPA}->is_enabled) { + // return $cg; + // } + // } + // } + // } if ($this->country && $this->country->iso_3166_3 == 'GBR' && in_array(GatewayType::DIRECT_DEBIT, array_column($pms, 'gateway_type_id'))) { foreach ($pms as $pm) { diff --git a/app/PaymentDrivers/Stripe/SEPA.php b/app/PaymentDrivers/Stripe/SEPA.php index afa218097f..54578a0390 100644 --- a/app/PaymentDrivers/Stripe/SEPA.php +++ b/app/PaymentDrivers/Stripe/SEPA.php @@ -34,6 +34,12 @@ class SEPA public function authorizeView($data) { + $data['gateway'] = $this->stripe; + $data['payment_method_id'] = GatewayType::SEPA; + $data['client'] = $this->stripe->client; + $data['country'] = $this->stripe->client->country->iso_3166_2; + $data['currency'] = $this->stripe->client->currency(); + return render('gateways.stripe.sepa.authorize', $data); } diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index 4d14210d61..83cd30e3a8 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -101,13 +101,6 @@ class MarkPaid extends AbstractService $client->balance += $payment->amount * -1; $client->save(); - // $this->invoice - // ->client - // ->service() - // ->updateBalance($payment->amount * -1) - // ->updatePaidToDate($payment->amount) - // ->save(); - $this->invoice = $this->invoice ->service() ->workFlow()