Ejemplo n.º 1
0
    switch ($idata->q) {
        case 'status':
            $t = new RJDGPPTXN();
            if ($t->loadBy('session_id', session_id())) {
                if ($t->isComplete()) {
                    $i = new RJDGSHOP($t->shop_id);
                    if ($i->id) {
                        $url = $i->getDownloadLink();
                        $odata['data']['link'] = $url;
                    }
                }
            }
            break;
        case 'helper':
            if ($idata->txn_id) {
                $txn = new RJDGPPTXN();
                $txn->loadBy('transaction_id', $idata->txn_id);
                if ($txn->isLoaded()) {
                    $file = new RJDGSHOP($txn->shop_id);
                    if ($file->isLoaded() && $txn->isValid()) {
                        $odata['data'] = array('name' => $file->name, 'link' => RJDGPP::getDownloadLink($file) . '&txn_id=' . $txn->transaction_id, 'txn_price' => $txn->price, 'item_price' => $file->price, 'txn_stat' => $txn->payment_status, 'txn_id' => $txn->transaction_id);
                        $odata['response'] = 'success';
                    }
                }
            }
            break;
        default:
    }
}
//idata->q
echo json_encode($odata);