Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created October 4, 2016 20:13
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 dancameron/0198549305b80dcedd5c96a9f6e2a3f7 to your computer and use it in GitHub Desktop.
Save dancameron/0198549305b80dcedd5c96a9f6e2a3f7 to your computer and use it in GitHub Desktop.
Sprout Payment
$invoice_id = 559 ;
$invoice = SI_Invoice::get_instance( $invoice_id );
//print_r($invoice);
$amount = 100 ;
$transaction_id = '1' ;
$date = '2011-12-22 12:00:00';
$notes = 'CASH' ;
$number = '';
$payment_id = SI_Payment::new_payment( array(
'payment_method' => SI_Admin_Payment::get_payment_method(),
'invoice' => $invoice_id,
'amount' => $amount,
'transaction_id' => $number,
'data' => array(
'amount' => $amount,
'check_number' => $number,
'date' => strtotime( $date ),
'notes' => $notes
),
), SI_Payment::STATUS_COMPLETE );
if ( !$payment_id ) {
return FALSE;
}
do_action( 'admin_payment', $payment_id, $invoice );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment