Esempio n. 1
0
 */
 $reasonCode = $resArray["PAYMENTINFO_0_REASONCODE"];
 // Add javascript to close Digital Goods frame. You may want to add more javascript code to
 // display some info message indicating status of purchase in the parent window
 $txn = new RJDGPPTXN();
 if ($txn->loadBy('token', $token)) {
     $txn->payer_id = $payerID;
     $txn->transaction_id = $transactionId;
     $txn->transaction_type = $transactionType;
     $txn->price = $amt;
     $txn->payment_type = $paymentType;
     $txn->payment_status = $paymentStatus;
     $txn->currency_code = $currencyCode;
     $txn->order_time = $orderTime;
     $txn->server_order_time = date('Y-m-d H:i:s');
     $txn->session_expire = RJSES::expireDateTime();
     //			$txn->session_id=session_id();
     $txn->pending_reason = $pendingReason;
     $txn->reason_code = $reasonCode;
     $txn->fee_amount = $feeAmt;
     $txn->tax_amount = $taxAmt;
     $txn->exchange_rate = $exchangeRate;
     $txn->save();
     //send an email to the client
     try {
         $item = new RJDGSHOP($txn->shop_id);
         if ($txn->isComplete($item)) {
             $email_sent = RJDGPP::sendEmail($txn, $item);
         }
         unset($item);
     } catch (Exception $e) {
Esempio n. 2
0
 *   Author URI: http://www.myminipin.com/
 *
 *   an exclusive file for downloads
 *   
 *   depends: RJSES
 *   		  RJDL
 *   		  RJSHOP
 *   	      RJDGTXN
 */
include dirname(__FILE__) . '/../../../../wp-load.php';
$ar = wp_parse_args($_REQUEST);
$dl = false;
if (empty($ar['i']) || !is_numeric($ar['i'])) {
    //	session_id()
} else {
    RJSES::start();
    $i = new RJDGSHOP($ar['i']);
    $txn = new RJDGPPTXN();
    //$txn->loadByShopObj($i);
    if ($txn->loadBy('transaction_id', $ar['txn_id']) && $i->isLoaded()) {
        if ($txn->isComplete($i)) {
            status_header(200);
            //show pdf
            if (RJDL::http($i->pathname)) {
                $dl = true;
            }
        } else {
            status_header(404);
            $a = $txn->getStatus($i);
            array_walk($a, create_function('&$i,$k', '$i="<li>$i</li>";'));
            get_header();