diff --git a/app/PaymentDrivers/GoCardless/ACH.php b/app/PaymentDrivers/GoCardless/ACH.php
index 055a313563..7aafa628d8 100644
--- a/app/PaymentDrivers/GoCardless/ACH.php
+++ b/app/PaymentDrivers/GoCardless/ACH.php
@@ -160,11 +160,11 @@ class ACH implements MethodInterface
*/
public function paymentResponse(PaymentResponseRequest $request)
{
- $token = ClientGatewayToken::find(
- $this->decodePrimaryKey($request->source)
- )->firstOrFail();
+ // $token = ClientGatewayToken::find(
+ // $this->decodePrimaryKey($request->source)
+ // )->firstOrFail();
- $this->go_cardless->ensureMandateIsReady($token);
+ $this->go_cardless->ensureMandateIsReady($request->source);
try {
$payment = $this->go_cardless->gateway->payments()->create([
@@ -175,7 +175,7 @@ class ACH implements MethodInterface
'payment_hash' => $this->go_cardless->payment_hash->hash,
],
'links' => [
- 'mandate' => $token->token,
+ 'mandate' => $request->source,
],
],
]);
@@ -201,7 +201,6 @@ class ACH implements MethodInterface
public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = [])
{
$data = [
- 'payment_method' => $data['token'],
'payment_type' => PaymentType::ACH,
'amount' => $this->go_cardless->payment_hash->data->amount_with_fee,
'transaction_reference' => $payment->id,
diff --git a/app/PaymentDrivers/GoCardless/DirectDebit.php b/app/PaymentDrivers/GoCardless/DirectDebit.php
index 2929e081bf..7e915f5f8f 100644
--- a/app/PaymentDrivers/GoCardless/DirectDebit.php
+++ b/app/PaymentDrivers/GoCardless/DirectDebit.php
@@ -190,7 +190,6 @@ class DirectDebit implements MethodInterface
public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = [])
{
$data = [
- 'payment_method' => $data['token'],
'payment_type' => PaymentType::DIRECT_DEBIT,
'amount' => $this->go_cardless->payment_hash->data->amount_with_fee,
'transaction_reference' => $payment->id,
diff --git a/app/PaymentDrivers/GoCardless/SEPA.php b/app/PaymentDrivers/GoCardless/SEPA.php
index 35ffef5b91..6a9bfb3426 100644
--- a/app/PaymentDrivers/GoCardless/SEPA.php
+++ b/app/PaymentDrivers/GoCardless/SEPA.php
@@ -160,11 +160,7 @@ class SEPA implements MethodInterface
*/
public function paymentResponse(PaymentResponseRequest $request)
{
- $token = ClientGatewayToken::find(
- $this->decodePrimaryKey($request->source)
- )->firstOrFail();
-
- $this->go_cardless->ensureMandateIsReady($token);
+ $this->go_cardless->ensureMandateIsReady($request->source);
try {
$payment = $this->go_cardless->gateway->payments()->create([
@@ -175,13 +171,13 @@ class SEPA implements MethodInterface
'payment_hash' => $this->go_cardless->payment_hash->hash,
],
'links' => [
- 'mandate' => $token->token,
+ 'mandate' => $request->source,
],
],
]);
if ($payment->status === 'pending_submission') {
- return $this->processPendingPayment($payment, ['token' => $token->hashed_id]);
+ return $this->processPendingPayment($payment, ['token' => $request->source]);
}
return $this->processUnsuccessfulPayment($payment);
@@ -200,7 +196,6 @@ class SEPA implements MethodInterface
public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = [])
{
$data = [
- 'payment_method' => $data['token'],
'payment_type' => PaymentType::SEPA,
'amount' => $this->go_cardless->payment_hash->data->amount_with_fee,
'transaction_reference' => $payment->id,
diff --git a/resources/views/portal/ninja2020/gateways/gocardless/ach/pay.blade.php b/resources/views/portal/ninja2020/gateways/gocardless/ach/pay.blade.php
index 98dd992b5b..eb29b41515 100644
--- a/resources/views/portal/ninja2020/gateways/gocardless/ach/pay.blade.php
+++ b/resources/views/portal/ninja2020/gateways/gocardless/ach/pay.blade.php
@@ -20,10 +20,10 @@
@if (count($tokens) > 0)
@foreach ($tokens as $token)
@endforeach
@endisset
diff --git a/resources/views/portal/ninja2020/gateways/gocardless/direct_debit/pay.blade.php b/resources/views/portal/ninja2020/gateways/gocardless/direct_debit/pay.blade.php
index cb0620ad1c..da00715475 100644
--- a/resources/views/portal/ninja2020/gateways/gocardless/direct_debit/pay.blade.php
+++ b/resources/views/portal/ninja2020/gateways/gocardless/direct_debit/pay.blade.php
@@ -20,10 +20,10 @@
@if (count($tokens) > 0)
@foreach ($tokens as $token)
@endforeach
@endisset
diff --git a/resources/views/portal/ninja2020/gateways/gocardless/sepa/pay.blade.php b/resources/views/portal/ninja2020/gateways/gocardless/sepa/pay.blade.php
index 7f506a51cc..25b3c6a870 100644
--- a/resources/views/portal/ninja2020/gateways/gocardless/sepa/pay.blade.php
+++ b/resources/views/portal/ninja2020/gateways/gocardless/sepa/pay.blade.php
@@ -20,10 +20,10 @@
@if (count($tokens) > 0)
@foreach ($tokens as $token)
@endforeach
@endisset