Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceandy committed Sep 15, 2021
1 parent 6cd945c commit 1155b94
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,24 @@ To query order statuses to Selcom, simply run:

```php
use Bryceandy\Selcom\Facades\Selcom;
use Illuminate\Support\Facades\DB;

Selcom::orderStatus($orderId);
$status = Selcom::orderStatus($orderId);

// With this fetched you can update the database record
DB::table('selcom_payments')->where('order_id', $orderId)
->update(array_merge(
'payment_status' => $status['payment_status'],
($status['payment_status'] === 'COMPLETED'
? [
'selcom_transaction_id' => $status['transid'],
'channel' => $status['channel'],
'reference' => $status['reference'],
'msisdn' => $status['msisdn'],
]
: []
)
));
```

### List orders
Expand Down

0 comments on commit 1155b94

Please sign in to comment.