Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreymcmahon/9269703 to your computer and use it in GitHub Desktop.
Save coreymcmahon/9269703 to your computer and use it in GitHub Desktop.
<?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