update email template
This commit is contained in:
@@ -57,15 +57,15 @@ class GetTransactionPayment implements ShouldQueue
|
||||
foreach ($history as $item) {
|
||||
if (empty($item->tracingType) && str_contains($item['description'], $this->message)) {
|
||||
$transaction = str_replace("\\BNK", "", $item['refNo']);
|
||||
$transCheck = Transaction::where('trans', $transaction)->first();
|
||||
if (!$transCheck) {
|
||||
Transaction::create(
|
||||
[
|
||||
'trans' => $transaction,
|
||||
'amount' => (int)$item['creditAmount'] ,
|
||||
'customer_id' => $this->user
|
||||
]
|
||||
);
|
||||
|
||||
// firstOrCreate is atomic against the unique(customer_id, trans, type) index —
|
||||
// a duplicate bank-statement poll (job retried, matched twice) cannot credit twice.
|
||||
$created = Transaction::firstOrCreate(
|
||||
['trans' => $transaction, 'customer_id' => $this->user],
|
||||
['amount' => (int) $item['creditAmount']]
|
||||
);
|
||||
|
||||
if ($created->wasRecentlyCreated) {
|
||||
Customer::find($this->user)->increment('credit', (int)$item['creditAmount']);
|
||||
Customer::find($this->user)->increment('total', (int)$item['creditAmount']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user