Example #1
0
<?php

$obj_feespayment = new Smgt_feespayment();
$p = new Smgt_paypal_class();
// paypal class
//$p->admin_mail 	= GMS_EMAIL_ADD; // set notification email
$action = $_REQUEST["fees_pay_id"];
$feepaydata = $obj_feespayment->smgt_get_single_fee_payment($fees_pay_id);
$user_id = $feepaydata->student_id;
$user_info = get_userdata($feepaydata->student_id);
$this_script = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$p->add_field('business', get_option('smgt_paypal_email'));
// Call the facilitator eaccount
$p->add_field('cmd', '_cart');
// cmd should be _cart for cart checkout
$p->add_field('upload', '1');
$p->add_field('return', home_url() . '/?dashboard=user&page=feepayment&action=success');
// return URL after the transaction got over
$p->add_field('cancel_return', home_url() . '/?dashboard=user&page=feepayment&action=cancel');
// cancel URL if the trasaction was cancelled during half of the transaction
$p->add_field('notify_url', home_url() . '/?dashboard=user&page=feepayment&action=ipn');
// Notify URL which received IPN (Instant Payment Notification)
$p->add_field('currency_code', 'USD');
$p->add_field('invoice', date("His") . rand(1234, 9632));
$p->add_field('item_name_1', get_fees_term_name($feepaydata->fees_id));
$p->add_field('item_number_1', 4);
$p->add_field('quantity_1', 1);
//$p->add_field('amount_1', get_membership_price(get_user_meta($user_id,'membership_id',true)));
$p->add_field('amount_1', $_POST['amount']);
//$p->add_field('amount_1', 1);//Test purpose
$p->add_field('first_name', $user_info->first_name);
Example #2
0
<?php

$obj_feespayment = new Smgt_feespayment();
$trasaction_id = $_POST["txn_id"];
$custom_array = explode("_", $_POST['custom']);
$feedata['fees_pay_id'] = $custom_array[1];
$feedata['amount'] = $_POST['[mc_gross_1'];
$feedata['payment_method'] = 'paypal';
$feedata['trasaction_id'] = $trasaction_id;
$obj_feespayment->add_feespayment_history($feedata);