Changeset View
Changeset View
Standalone View
Standalone View
src/app/Jobs/PaymentEmail.php
<?php | <?php | ||||
namespace App\Jobs; | namespace App\Jobs; | ||||
use App\Payment; | use App\Payment; | ||||
use App\Providers\PaymentProvider; | |||||
use App\User; | use App\User; | ||||
use Illuminate\Bus\Queueable; | use Illuminate\Bus\Queueable; | ||||
use Illuminate\Contracts\Queue\ShouldQueue; | use Illuminate\Contracts\Queue\ShouldQueue; | ||||
use Illuminate\Foundation\Bus\Dispatchable; | use Illuminate\Foundation\Bus\Dispatchable; | ||||
use Illuminate\Queue\SerializesModels; | use Illuminate\Queue\SerializesModels; | ||||
use Illuminate\Queue\InteractsWithQueue; | use Illuminate\Queue\InteractsWithQueue; | ||||
class PaymentEmail implements ShouldQueue | class PaymentEmail implements ShouldQueue | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | public function handle() | ||||
if (empty($this->controller)) { | if (empty($this->controller)) { | ||||
$this->controller = $wallet->owner; | $this->controller = $wallet->owner; | ||||
} | } | ||||
if (empty($this->controller)) { | if (empty($this->controller)) { | ||||
return; | return; | ||||
} | } | ||||
if ($this->payment->status == PaymentProvider::STATUS_PAID) { | if ($this->payment->status == Payment::STATUS_PAID) { | ||||
$mail = new \App\Mail\PaymentSuccess($this->payment, $this->controller); | $mail = new \App\Mail\PaymentSuccess($this->payment, $this->controller); | ||||
$label = "Success"; | $label = "Success"; | ||||
} elseif ( | } elseif ( | ||||
$this->payment->status == PaymentProvider::STATUS_EXPIRED | $this->payment->status == Payment::STATUS_EXPIRED | ||||
|| $this->payment->status == PaymentProvider::STATUS_FAILED | || $this->payment->status == Payment::STATUS_FAILED | ||||
) { | ) { | ||||
$mail = new \App\Mail\PaymentFailure($this->payment, $this->controller); | $mail = new \App\Mail\PaymentFailure($this->payment, $this->controller); | ||||
$label = "Failure"; | $label = "Failure"; | ||||
} else { | } else { | ||||
return; | return; | ||||
} | } | ||||
list($to, $cc) = \App\Mail\Helper::userEmails($this->controller); | list($to, $cc) = \App\Mail\Helper::userEmails($this->controller); | ||||
Show All 21 Lines |