diff --git a/app/Models/PaymentHash.php b/app/Models/PaymentHash.php index 555eae5e6558..875e412bd1c4 100644 --- a/app/Models/PaymentHash.php +++ b/app/Models/PaymentHash.php @@ -20,23 +20,14 @@ use Illuminate\Database\Eloquent\Model; * @property string $hash * @property string $fee_total * @property int|null $fee_invoice_id - * @property object $data + * @property object|array $data * @property int|null $payment_id * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property-read \App\Models\Invoice|null $fee_invoice * @property-read \App\Models\Payment|null $payment - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash newQuery() * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash query() - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereCreatedAt($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereData($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereFeeInvoiceId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereFeeTotal($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereHash($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash wherePaymentId($value) - * @method static \Illuminate\Database\Eloquent\Builder|PaymentHash whereUpdatedAt($value) * @mixin \Eloquent */ class PaymentHash extends Model diff --git a/app/PaymentDrivers/Stripe/ACH.php b/app/PaymentDrivers/Stripe/ACH.php index 10bb0e8c42a5..b68d4e120ed8 100644 --- a/app/PaymentDrivers/Stripe/ACH.php +++ b/app/PaymentDrivers/Stripe/ACH.php @@ -187,6 +187,16 @@ class ACH $intent = false; + if (count($data['tokens']) == 1) { + + $token = $data['tokens'][0]; + + $meta = $token->meta; + + if(isset($meta->state) && $meta->state == 'unauthorized') + return redirect()->route('client.payment_methods.show', $token->hashed_id); + } + if (count($data['tokens']) == 0) { $intent = $this->stripe->createPaymentIntent( diff --git a/app/Services/Payment/SendEmail.php b/app/Services/Payment/SendEmail.php index 6253911dac9c..8b9a56499562 100644 --- a/app/Services/Payment/SendEmail.php +++ b/app/Services/Payment/SendEmail.php @@ -23,7 +23,6 @@ class SendEmail /** * Builds the correct template to send. - * @return void */ public function run() {