Cleanly force payment and verification of ach payments

This commit is contained in:
David Bomba 2023-07-26 13:50:56 +10:00
parent c507129657
commit 0d067cad7d
3 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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(

View File

@ -23,7 +23,6 @@ class SendEmail
/**
* Builds the correct template to send.
* @return void
*/
public function run()
{