Skip to content

Commit f89b157

Browse files
authored
Merge pull request #51 from Adtrex/master
2 parents 73f3255 + 55475b6 commit f89b157

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/getting-started/payment-implementation.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,25 @@ class FlutterwaveController extends Controller
9696
*/
9797
public function callback()
9898
{
99+
100+
$status = request()->status;
99101

102+
//if payment is successful
103+
if ($status == 'successful') {
104+
100105
$transactionID = Flutterwave::getTransactionIDFromCallback();
101106
$data = Flutterwave::verifyTransaction($transactionID);
102107

103108
dd($data);
109+
}
110+
elseif ($status == 'cancelled'){
111+
//Put desired action/code after transaction has been cancelled here
112+
}
113+
else{
114+
//Put desired action/code after transaction has failed here
115+
}
104116
// Get the transaction from your DB using the transaction reference (txref)
105117
// Check if you have previously given value for the transaction. If you have, redirect to your successpage else, continue
106-
// Confirm that the $data['data']['status'] is 'successful'
107118
// Confirm that the currency on your db transaction is equal to the returned currency
108119
// Confirm that the db transaction amount is equal to the returned amount
109120
// Update the db transaction record (including parameters that didn't exist before the transaction is completed. for audit purpose)

0 commit comments

Comments
 (0)