Last active
August 29, 2015 13:56
-
-
Save coreymcmahon/9269703 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// etc... | |
// find the payment if it already exists | |
$payment = Payment::where('txn_id', '=', Input::get('txn_id'))->get()->first(); | |
// if it doesn't exist, create the payment using all the fields in the POST | |
if (empty($payment)) $payment = Payment::create(Input::all()); | |
// if in debug mode, add the raw body of the request and also save it | |
if (Config::get('app.debug')) { | |
$payment->raw_request = print_r(Input::all(), true); | |
$payment->save(); | |
} | |
// etc... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment