function rjdgshop_get_by_related_tags($content) { global $post; if (is_single() && !empty($post)) { $items = RJDGPP::getTagList($post->ID); ob_start(); require_once dirname(__FILE__) . '/views/bytags.php'; $content .= ob_get_clean(); } return $content; }
creds['api_sig']=$('#api_sig').val(); url='<?php echo RJDGPP::getRPC(); ?> '; creds['rjaction']='setCred'; creds['id']=0; $.getJSON(url,creds).success(function(d){ $('#msgs').mesfad(d.response); }); }; $.fn.getCred=function(){ url='<?php echo RJDGPP::getRPC(); ?> '; $.getJSON(url,{rjaction:'getCred',id:0}).success(function(d){ if(d && d.creds){ if(typeof d.creds.api_user !='undefined'){ $('#api_user').val(d.creds.api_user); } if(typeof d.creds.api_pass !='undefined'){ $('#api_pass').val(d.creds.api_pass); } if(typeof d.creds.api_sig !='undefined'){ $('#api_sig').val(d.creds.api_sig); } } });
<?php /** * paypal startflow * assignments must be made on this page */ require_once dirname(__FILE__) . '/../../../../wp-load.php'; require_once 'paypalfunctions.php'; $url = RJDGPP::getURI('/paypal'); ?> <html><body><?php $paymentAmount = $_REQUEST['price']; $item_name = $_REQUEST['item_name']; $item_id = $_REQUEST['item_id']; $s = $_REQUEST['s']; //prepare txn $txn = new RJDGPPTXN(); $txn->shop_id = $item_id; $txn->name = $item_name; $txn->session_id = $s; $PaymentOption = "PayPal"; if ($PaymentOption == "PayPal" && !empty($paymentAmount) && !empty($item_name)) { $currencyCodeType = "USD"; $paymentType = "Sale"; $returnURL = $url . "/return.php"; $cancelURL = $url . "/cancel.php"; $items = array(); $items[] = array('name' => $item_name, 'amt' => $paymentAmount, 'qty' => 1, 'item_id' => $item_id); $resArray = SetExpressCheckoutDG($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $items); $ack = strtoupper($resArray["ACK"]); if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") {
?> rjdgpp-data-src="<?php echo $i->thumbnail; ?> " <?php } ?> ><?php echo $i->name; ?> </span> <?php if (!empty($i->description)) { ?> <p><?php echo $i->description; ?> </p><?php } ?> <div class="rjdgshop_pp_button"><?php echo RJDGPP::getButton($i); ?> </div> </div><!-- .rjdgshop_item --> <?php } ?> </div><!-- .rjdgshop --> <?php }
$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) { rjdump($e); } } //loadBy ?> <html> <script> alert("Payment Successful"); // add relevant message above or remove the line if not required window.onload = function(){ /* if(window.opener){
*/ ?> <noscript>Javascript is required for this widget</noscript> <label title="Input your transaction ID if you are having trouble with the Shop Flow">Transaction ID</label> <input type="text" title="your Transaction ID then click ok" name="txn_id" id="txn_id" maxlength="18" value="" /> <input type="submit" class="txn_helper_button" value="ok" /> <div id="txn_result" class="txn_res"></div> <script> (function($){ $('.txn_helper_button').first().click(function(){ $('.txn_res').addClass('loading'); var t=$('#txn_id'); if(t.data('txn')){$('#txn_result').html('still processing... please wait'); return ;} if(!t.get(0)) {return;} url='<?php echo RJDGPP::getURI('/JSON.php'); ?> '; txn_id=t.val(); txn_id=txn_id.trim(); t.data('txn',true); $.ajax({ url:url, data:JSON.stringify({'txn_id':txn_id,'q':'helper'}), dataType:'json', type:'post', async:'true' }).success(function(d){ if(d && d.response=='success' && typeof d.data.link!='undefined'){ $('#txn_result').html('<span><a href="'+d.data.link+'" target="_blank">' + d.data.name +'</a><span>');
<?php require_once dirname(__FILE__) . '/../../../../wp-load.php'; /** * * Process the problems internals here * update shopping cart, get token. * */ ?> <html><head><?php wp_head(); ?> </head><body style="background:none"> <div id="show_loading" style="height:30px;width:30px;margin:auto;content:'';display:block;position:relative;background:url(<?php echo RJDGPP::getURI('/img/loading_wheel.gif'); ?> ) no-repeat 0 0;"></div> <script> window.onload = function(){ if(window.opener){ window.close(); } else{ if(top.dg.isOpen() == true){ top.dg.closeFlow(); return true; } } }; jQuery('#show_loading').remove();
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);
/******************************************** PayPal API Module Defines all the global variables and the wrapper functions ********************************************/ $PROXY_HOST = '127.0.0.1'; $PROXY_PORT = '808'; $SandboxFlag = RJDGPP::isSandbox(); $API_UserName = "******"; $API_Password = "******"; $API_Signature = "AORAj1v8XSqDVtzLwF3tm-9gDM.xA85nEntMpgQ74Zm4Uv9hZAkgYkjE"; if ($SandboxFlag == false) { $API_UserName = RJDGPP::getApiUser(); $API_Password = RJDGPP::getApiPass(); $API_Signature = RJDGPP::getApiPass(); } // BN Code is only applicable for partners $sBNCode = "PP-ECWizard"; /* ' Define the PayPal Redirect URLs. ' This is the URL that the buyer is first sent to do authorize payment with their paypal account ' change the URL depending if you are testing on the sandbox or the live PayPal site ' ' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token= ' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token= */ $API_Endpoint = "https://api-3t.paypal.com/nvp"; $PAYPAL_URL = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="; $PAYPAL_DG_URL = "https://www.paypal.com/incontext?token="; if ($SandboxFlag == true) {
$r = new RJDGSHOP(); if ($r->deleteMeta($idata['id'], $idata['meta'])) { $odata['id'] = $idata['id']; $odata['response'] = 'success'; } break; case 'sandbox': if (isset($idata['value']) && $idata['value'] == 1) { $odata['response'] = RJDGPP::setSandbox(1); } if (isset($idata['value']) && $idata['value'] == 0) { $odata['response'] = RJDGPP::setSandbox(0); } $odata['sandbox'] = RJDGPP::isSandbox(); break; case 'setCred': if (isset($idata['api_user']) && isset($idata['api_pass']) && isset($idata['api_sig'])) { if (RJDGPP::setCred($idata['api_user'], $idata['api_pass'], $idata['api_sig'])) { $odata['response'] = 'success'; } } else { $odata['response'] = 'invalid entries'; } break; case 'getCred': $odata['response'] = 'success'; $odata['creds'] = RJDGPP::getCred(); default: } } echo json_encode($odata);