本文整理汇总了PHP中new_smarty函数的典型用法代码示例。如果您正苦于以下问题:PHP new_smarty函数的具体用法?PHP new_smarty怎么用?PHP new_smarty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了new_smarty函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config, $db;
$amount = sprintf("%d", $price * 100);
$parm = "merchant_id=" . $this->config["merchant"] . " merchant_country=fr amount={$amount} currency_code=978";
$parm .= " pathfile=" . $this->config["pathfile"] . " transaction_id={$payment_id}";
$parm .= " normal_return_url={$config['root_url']}/thanks.php";
$parm .= " cancel_return_url={$config['root_url']}/cancel.php";
$parm = "{$parm} automatic_response_url={$config['root_url']}/plugins/payment/webaffair/ipn.php";
$result = exec($this->config["path_bin"] . " {$parm}");
$tableau = explode("!", "{$result}");
$code = $tableau[1];
$error = $tableau[2];
$message = $tableau[3];
$t =& new_smarty();
if ($code == "" && $error == "") {
$output = "<BR><CENTER>erreur appel request</CENTER><BR>executable request non trouve " . $this->config["path_bin"];
} elseif ($code != 0) {
$output = "<center><b><h2>Erreur appel API de paiement.</h2></center></b><br><br><br>message erreur : {$error} <br>";
} else {
$output = "<br><br>{$error}<br>{$message} <br>";
}
$t->assign('output', $output);
$t->display(dirname(__FILE__) . '/webaffair.html');
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:26,代码来源:webaffair.inc.php
示例2: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config, $db, $plugin_config;
$payment = $db->get_payment($payment_id);
$member = $db->get_user($member_id);
$product =& get_product($product_id);
$this_config = $plugin_config['payment']['gate2shop'];
if ($this_config['testing']) {
// currently HTTP POST requests use version=3.0.0 while HTTP GET requests use version=1.0.0
$version = '1.0.0';
} else {
$version = '3.0.0';
}
$time_stamp = gmdate("Y-m-d.H:i:s");
// current GMT time in the following format: YYYY-MM-DD.HH:MM:SS
$vars = array('version' => $version, 'merchant_id' => $this_config['merchant_id'], 'merchant_site_id' => $this_config['site_id'], 'currency' => $product->config['gate2shop_currency'] ? $product->config['gate2shop_currency'] : 'USD', 'numberofitems' => '1', 'item_name_1' => $product->config['title'], 'item_amount_1' => $product->config['price'], 'item_quantity_1' => 1, 'total_amount' => $price, 'time_stamp' => $time_stamp, 'total_tax' => $payment['data']['TAX_AMOUNT'], 'productId' => $product_id, 'merchantLocale' => 'en_US', 'userid' => $member['member_id'], 'first_name' => $member['name_f'], 'last_name' => $member['name_l'], 'address1' => $member['street'], 'city' => $member['city'], 'state' => $member['state'], 'country' => $member['country'], 'zip' => $member['zip'], 'email' => $member['email'], 'invoice_id' => $payment['payment_id'] . "-" . $this->get_rand(3), 'customField1' => $payment['payment_id'], 'customData' => $payment['payment_id']);
$vars['checksum'] = md5($this_config['secret'] . $vars['merchant_id'] . $vars['currency'] . $vars['total_amount'] . $vars['item_name_1'] . $vars['item_amount_1'] . $vars['item_quantity_1'] . $vars['time_stamp']);
if ($this_config['method'] == 'GET') {
$this->encode_and_redirect('https://secure.Gate2Shop.com/ppp/purchase.do', $vars);
exit;
} else {
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(str_replace("c:\\", '/', dirname(__FILE__) . '/form.html'));
exit;
}
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:27,代码来源:gate2shop.inc.php
示例3: do_rebill
function do_rebill($vars)
{
global $config;
$d = strftime($config['date_format'], strtotime($vars['date']));
$d1 = strftime($config['date_format'], strtotime($vars['date1']));
$d2 = strftime($config['date_format'], strtotime($vars['date2']));
$ds = date('Y-m-d', strtotime($vars['date']));
$t = new_smarty();
$t->display('admin/header.inc.html');
print "<h1>Running Rebill for [{$d}], please wait patiently...</h1>";
print "<p>Rebilling dates from [{$d1}] to [{$d2}].</p>";
ob_end_flush();
cc_core_rebill($vars['paysys_id'], $vars['date'], $from_cron = false);
/// next
$vars['date'] = date('Y-m-d', strtotime($vars['date']) + 3600 * 24);
if ($vars['date'] > $vars['date2']) {
print "<font size=3>Rebilling Finished! <a href='rebill.php'>Back to the form</a></font>";
$t->display('admin/footer.inc.html');
return;
}
$d = strftime($config['date_format'], strtotime($vars['date']));
print <<<CUT
\t<form method=post>
\t<input type=submit name=confirm value="Process next date[{$d}]" />
\t<input type=hidden name=date value='{$vars['date']}' />
\t<input type=hidden name=date1 value='{$vars['date1']}' />
\t<input type=hidden name=date2 value='{$vars['date2']}' />
\t<input type=hidden name=paysys_id value='{$vars['paysys_id']}' />
\t</form>
CUT;
$t->display('admin/footer.inc.html');
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:32,代码来源:rebill.php
示例4: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config, $db;
$payment = $db->get_payment($payment_id);
$products = array();
if (is_array($product_ids = $payment['data'][0]['BASKET_PRODUCTS'])) {
foreach ($product_ids as $pid) {
$pr = $db->get_product($pid);
$pr['price'] = $payment['data'][0]['BASKET_PRICES'][$pid];
$products[] = $pr;
}
} else {
$products = array($db->get_product($product_id));
}
$t =& new_smarty();
$t->template_dir = dirname(__FILE__);
$t->assign('product', $products[0]);
$t->assign('products', $products);
$t->assign('payment', $payment);
$t->assign('member', $db->get_user($member_id));
$t->assign('price', $price);
$t->assign('begin_date', $begin_date);
$t->assign('expire_date', $expire_date);
$t->assign('vars', $vars);
$t->assign('config', $config);
$t->display("offline.html");
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:28,代码来源:offline.inc.php
示例5: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $db, $config, $plugin_config;
$t =& new_smarty();
$t->assign(array('this_config' => $this->config, 'member' => $db->get_user($member_id), 'payment' => $pm = $db->get_payment($payment_id), 'product' => $db->get_product($pm['product_id'])));
$t->display(dirname(__FILE__) . '/paycom.html');
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:8,代码来源:paycom.inc.php
示例6: do_bill
function do_bill($amount, $title, $products, $member, $invoice)
{
global $config, $db;
$product =& get_product($products[0]['product_id']);
$vars = array('SITE_ID' => $this->config['site_id'], 'PRICING_ID' => $product->config['zombaio_id'], 'LANG' => $this->config['lang'], 'FirstName' => $member['name_f'], 'LastName' => $member['name_l'], 'Address' => $member['street'], 'Postal' => $member['zip'], 'City' => $member['city'], 'Email' => $member['email'], 'Username' => $member['login'], 'Password' => $member['pass'], 'INVOICE' => $invoice);
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(dirname(__FILE__) . '/zombaio.html');
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:9,代码来源:zombaio.inc.php
示例7: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config;
global $db;
$product =& get_product($product_id);
$vars = array('MERCHKEY' => $this->config['merchkey'], 'TRANPAGE' => $this->config['tranpage'], 'TRANTYPE' => 'AUTHPOST', 'AMT' => sprintf("%.2f", $price), 'CURR' => $this->config['currency'], 'INVOICE' => $payment_id, 'TRANID' => "AMEMBER" . $payment_id, 'URLAPPROVED' => $config['root_url'] . "/thanks.php?member_id={$member_id}&{$product_id}={$product_id}&paysys_id=4cs&res=#RC#&fres=#FC#&ac=#APP#&ref=#REF#&tran=#TRANID#&payment_id=#INVOICE#&err=#EM#", 'URLOTHER' => $config['root_url'] . "/plugins/payment/4cs/cancel.php");
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(dirname(__FILE__) . '/iframe.html');
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:10,代码来源:4cs.inc.php
示例8: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config, $db, $plugin_config;
$payment = $db->get_payment($payment_id);
$member = $db->get_user($member_id);
$product =& get_product($product_id);
$this_config = $plugin_config['payment']['gtbill'];
$vars = array('merchant_id' => $this_config['merchant_id'], 'site_id' => $this_config['site_id'], 'price_id' => $product->config['gtbill_price_id'], 'currency_id' => $product->config['gtbill_currency'] ? $product->config['gtbill_currency'] : 'USD', 'name_f' => $member['name_f'], 'name_l' => $member['name_l'], 'street' => $member['street'], 'city' => $member['city'], 'state' => $member['state'], 'country' => $member['country'], 'zip' => $member['zip'], 'email' => $member['email'], 'login' => $member['login'] . '-' . $this->get_rand(3), 'pass' => $member['pass'], 'payment_id' => $payment['payment_id']);
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(str_replace("c:\\", '/', dirname(__FILE__) . '/form.html'));
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:13,代码来源:gtbill.inc.php
示例9: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $db, $config, $plugin_config;
$t =& new_smarty();
$t->template_dir = dirname(__FILE__);
$page_id = $this->config['page_id'];
if (isset($vars['action']) && $vars['action'] == 'renew') {
$page_id = $this->config['page_id2'];
}
$t->assign(array('header' => $config['root_dir'] . '/templates/header.html', 'footer' => $config['root_dir'] . '/templates/footer.html', 'this_config' => $this->config, 'page_id' => $page_id, 'member' => $db->get_user($member_id), 'payment' => $pm = $db->get_payment($payment_id), 'product' => $db->get_product($pm['product_id'])));
$t->display('multicards.html');
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:13,代码来源:multicards.inc.php
示例10: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config;
global $db;
$product =& get_product($product_id);
$member = $db->get_user($member_id);
if (!$product->config['icepay_currency']) {
$product->config['icepay_currency'] = "GBP";
}
$vars = array('merchant' => $this->config['merchkey'], 'amount' => intval($price * 100), 'currency' => $product->config['icepay_currency'], 'ic_country' => $member['country'], 'orderid' => $payment_id, 'reference' => "AMEMBER" . $payment_id, 'description' => $product->config['title'], 'visa_checksum' => sha1($this->config['secret'] . "|" . $this->config['merchkey'] . "|" . intval($price * 100) . "|" . $product->config['icepay_currency'] . "|" . $payment_id . "|CREDITCARD|VISA"), 'master_checksum' => sha1($this->config['secret'] . "|" . $this->config['merchkey'] . "|" . intval($price * 100) . "|" . $product->config['icepay_currency'] . "|" . $payment_id . "|CREDITCARD|MASTER"), 'amex_checksum' => sha1($this->config['secret'] . "|" . $this->config['merchkey'] . "|" . intval($price * 100) . "|" . $product->config['icepay_currency'] . "|" . $payment_id . "|CREDITCARD|AMEX"), 'urlcompleted' => $config['root_url'] . "/plugins/payment/icepay/thanks.php");
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(dirname(__FILE__) . '/icepay.html');
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:14,代码来源:icepay.inc.php
示例11: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config, $db;
$product = $db->get_product($product_id);
$vars = array('psb' => 'psb', 'biz' => $this->config['merchant_id'], 'inv' => $payment_id, 'itm' => substr($product['title'], 0, 200), 'amt' => $price, 'reqURL' => $config['root_url'] . "/plugins/payment/paysbuy/ipn.php", 'postURL' => $config['root_url'] . "/plugins/payment/paysbuy/thanks.php");
if ($this->config['currency']) {
$vars['currencyCode'] = $this->config['currency'];
}
//$db->log_error("PaySbuy SENT: " . paysbuy_get_dump($vars));
$t =& new_smarty();
$t->template_dir = dirname(__FILE__);
$t->assign('vars', $vars);
$t->display('paysbuy.html');
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:15,代码来源:paysbuy.inc.php
示例12: do_bill
function do_bill($amount, $title, $products, $u, $invoice)
{
global $config, $db, $plugin_config;
$product = $products[0];
$payment = $db->get_payment($invoice);
$this_config = $plugin_config['payment']['realex_redirect'];
$vars = array('merchant_id' => $this_config['merchant_id'], 'order_id' => $invoice, 'account' => $this_config['account'], 'amount' => $amount, 'currency' => $product['realex_redirect_currency'] ? $product['realex_redirect_currency'] : 'USD', 'timestamp' => date("YmdHis"), 'comment1' => $product['title'], 'cust_num' => $payment['member_id'], 'auto_settle_flag' => '1');
$hash = $vars['timestamp'] . "." . $vars['merchant_id'] . "." . $vars['order_id'] . "." . $vars['amount'] . "." . $vars['currency'];
$hash = md5($hash);
$hash = $hash . "." . $this_config['secret'];
$hash = md5($hash);
$vars['md5hash'] = $hash;
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(str_replace("c:\\", '/', dirname(__FILE__) . '/form.html'));
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:17,代码来源:realex_redirect.inc.php
示例13: do_payment
function do_payment($payment_id, $member_id, $product_id, $price, $begin_date, $expire_date, &$vars)
{
global $config;
global $db;
$orig_product_id = $product_id;
if (is_array($product_id)) {
$product_id = $product_id[0];
}
$product =& get_product($product_id);
if (count($orig_product_id) > 1) {
$product->config['title'] = $config['multi_title'];
}
$vars = array('merchant_id' => $this->config['merchant_id'], 'amount' => sprintf("%.2f", $price), 'currency' => $this->config['currency'], 'language' => 'en', 'display_text' => $product->config['title'], 'token' => md5(strtolower($this->config['merchant_id'] . ":" . sprintf("%.2f", $price) . ":" . $this->config['currency'] . ":") . $this->config['secret']), 'txt1' => $product->config['title'], 'txt2' => $payment_id, 'test_mode' => $this->config['testing']);
$t =& new_smarty();
$t->assign('vars', $vars);
$t->display(dirname(__FILE__) . '/cashu.html');
exit;
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:18,代码来源:cashu.inc.php
示例14: process_postback
function process_postback($vars)
{
global $db, $t;
$payment_id = $vars['payment_id'];
// if (!preg_match('/secure\.paymentclearing\.com/', $r=$_SERVER['HTTP_REFERER']))
// $this->postback_error("Bad Refering URL - $r");
// process payment
$err = $db->finish_waiting_payment($payment_id, $this->get_plugin_name(), $invoice, $amount = '', $vars);
if ($err) {
$this->postback_error("finish_waiting_payment error: {$err}");
}
$t =& new_smarty();
$pm = $db->get_payment($payment_id);
$t->assign('payment', $pm);
$t->assign('product', $pr);
$t->assign('member', $db->get_user($pm['member_id']));
$t->display("thanks.html");
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:18,代码来源:itransact.inc.php
示例15: cc_bill
function cc_bill($cc_info, $member, $amount, $currency, $product_description, $charge_type, $invoice, $payment)
{
global $config, $db;
$log = array();
if (!$this->config["notification"]) {
$this->config["notification"] = 3;
}
if ($this->config["notification"] == 1 || $this->config["notification"] == 3) {
$this->manual_cc_mail($cc_info, $member, $payment, $charge_type);
}
if ($this->config["notification"] == 2 || $this->config["notification"] == 3) {
if ($charge_type != CC_CHARGE_TYPE_RECURRING) {
save_cc_info($cc_info, $member, $payment['paysys_id']);
}
}
if ($charge_type != CC_CHARGE_TYPE_RECURRING) {
$t =& new_smarty();
$product = $db->get_product($payment['product_id']);
$t->assign('payment', $payment);
$t->assign('product', $product);
$t->assign('user', $member);
if (!($prices = $payment['data'][0]['BASKET_PRICES'])) {
$prices = array($payment['product_id'] => $payment['amount']);
}
$pr = array();
$subtotal = 0;
foreach ($prices as $product_id => $price) {
$v = $db->get_product($product_id);
$subtotal += $v['price'];
$pr[$product_id] = $v;
}
$t->assign('subtotal', $subtotal);
$t->assign('total', array_sum($prices));
$t->assign('products', $pr);
$t->display($config['root_dir'] . "/plugins/payment/manual_cc/thanks.html");
exit;
}
return array(CC_RESULT_IGNORE, "", "", array());
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:39,代码来源:manual_cc.inc.php
示例16: new_smarty
*
* Author: Alex Scott
* Email: [email protected]
* Web: http://www.cgi-central.net
* Details: Affiliate commission
* FileName $RCSfile$
* Release: 3.1.8PRO ($Revision: 2029 $)
*
* Please direct bug reports,suggestions or feedback to the cgi-central forums.
* http://www.cgi-central.net/forum/
*
* aMember PRO is a commercial software. Any distribution is strictly prohibited.
*
*/
include "../config.inc.php";
$t = new_smarty();
include "login.inc.php";
admin_check_permissions('affiliates');
$vars = get_input_vars();
function display_banners()
{
global $db, $t, $config;
/////
$links = array();
foreach ((array) $config['aff']['links'] as $i => $l) {
$l['url'] = aff_make_url($l['url'], 'l' . $i, -1);
$l['code'] = "<a href=\"{$l['url']}\">{$l['title']}</a>";
$links[$i] = $l;
}
$t->assign('links', $links);
/////////
开发者ID:subashemphasize,项目名称:test_site,代码行数:31,代码来源:aff_banners.php
示例17: ideal_error
if (!$result->isAuthenticated()) {
//Transaction failed, inform the consumer
print "Uw bestelling is helaas niet betaald, probeer het nog eens";
print "<br /><a href=\"javascript:location.reload();\">Please reload this page to update a payment status.</a>";
} else {
print "<br />Bedankt voor uw bestelling";
$transactionID = $result->getTransactionID();
//Here you should retrieve the order from the database, mark it as "payed"
//and display the result to your customer.
print "<br />De bestelling is betaald en wordt naar u opgestuurd";
// process payment
$err = $db->finish_waiting_payment($invoice, 'ideal', $txn_id, $payment_gross, $vars);
if ($err) {
ideal_error("finish_waiting_payment error: {$err}");
}
$t =& new_smarty();
if ($payment_id) {
$pm = $db->get_payment($payment_id);
$t->assign('payment', $pm);
if ($pm) {
$t->assign('product', $db->get_product($pm['product_id']));
$t->assign('member', $db->get_user($pm['member_id']));
}
if (!($prices = $pm['data'][0]['BASKET_PRICES'])) {
$prices = array($pm['product_id'] => $pm['amount']);
}
$pr = array();
$subtotal = 0;
foreach ($prices as $product_id => $price) {
$v = $db->get_product($product_id);
// $v['price'] = $price;
开发者ID:subashemphasize,项目名称:test_site,代码行数:31,代码来源:thanks.php
示例18: handle_cancel
function handle_cancel($vars, $mid = 0)
{
global $db, $config;
settype($vars['payment_id'], 'integer');
$mid = intval($mid);
if (!$vars['payment_id']) {
fatal_error("Payment_id empty");
}
$payment = $db->get_payment($vars['payment_id']);
if (!$mid) {
$mid = $_SESSION['_amember_id'];
}
if ($payment['member_id'] != $mid) {
fatal_error(_PLUG_PAY_CC_CORE_FERROR4);
}
$p = $db->get_payment($vars['payment_id']);
$member = $db->get_user($p['member_id']);
$url = "https://api.clickbank.com/rest/1.2/tickets/" . $p['receipt_id'];
$post = "type=cncl&reason=ticket.type.cancel.7&comment=cancellation%20request%20from%20aMember%20user%20(" . $member['login'] . ")";
$url = $url . "?" . $post;
$headers = array();
$headers[] = "Accept: application/xml";
$headers[] = "Authorization: " . $this->config['developer_key'] . ":" . $this->config['clerk_user_key'];
$res = $this->get_url($url, $headers);
$res_body = $res;
if (preg_match("/\r\n\r\n(.*)/i", $res, $matches)) {
$res_body = $matches[1];
}
$msg = _PLUG_PAY_CC_CORE_SBSCNCL2;
$title = _PLUG_PAY_CC_CORE_SBSCNCL;
if (!preg_match("/HTTP\\/1\\.1 200 OK/i", $res)) {
$msg = "An error occured while cancellation request.";
if ($res_body) {
$msg .= "<br /><font color=red><b>" . $res_body . "</b></font>";
}
$title = "Subscription cancellation ERROR";
} else {
$xml = $this->parse_xml($res_body);
$p['data'][] = $xml;
$db->update_payment($p['payment_id'], $p);
$response = array();
if ($xml['ticketid']) {
$response[] = "Ticket: " . $xml['ticketid'];
}
if ($xml['type']) {
$response[] = "Type: " . $xml['type'];
}
if ($xml['action']) {
$response[] = "Action: " . $xml['action'];
}
$response = implode("<br />", $response);
if ($response) {
$msg .= "<br /><b>Response from Clickbank</b><br />" . $response;
}
}
$t =& new_smarty();
$member = $db->get_user($p['member_id']);
// email to member if configured
if ($config['mail_cancel_admin']) {
$t->assign('user', $member);
$t->assign('payment', $p);
$t->assign('product', $db->get_product($p['product_id']));
$et =& new aMemberEmailTemplate();
$et->name = "mail_cancel_admin";
mail_template_admin($t, $et);
}
if ($config['mail_cancel_member']) {
$t->assign('user', $member);
$t->assign('payment', $p);
$t->assign('product', $db->get_product($p['product_id']));
$et =& new aMemberEmailTemplate();
$et->name = "mail_cancel_member";
mail_template_user($t, $et, $member);
}
$t =& new_smarty();
$t->assign('title', $title);
$t->assign('msg', $msg);
$t->display("msg_close.html");
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:79,代码来源:clickbank.inc.php
示例19: process_return
function process_return($vars)
{
global $db, $config;
$token = $vars['token'];
if ($token == '') {
$this->postback_error(_PLUG_PAY_PAYPALPRO_ERROR);
}
$details = $this->getExpressCheckoutDetails($token);
$invoice = $_SESSION[_amember_payment_id];
$payment = $db->get_payment($invoice);
if (!$payment) {
$this->postback_error(sprintf(_PLUG_PAY_PAYPALPRO_ERROR2, $invoice));
}
if ($vars['confirm'] <= 0) {
list($amount, $title, $products, $u, $invoicex) = $this->get_payment_params($invoice);
$t = new_smarty();
$t->assign('payment', $payment);
$t->assign('member', $u);
$t->assign('products', $products);
$subtotal = 0;
foreach ($products as $i => $p) {
$pr = $db->get_product($p['product_id']);
$products[$i]['price'] = $pr['price'];
$subtotal += $pr['price'];
}
$t->assign('subtotal', $subtotal);
$t->assign('total', $payment['amount']);
$t->display(dirname(__FILE__) . "/confirm.html");
exit;
}
if ($details['AMT'] == 0) {
list($txn_id, $amt) = array("Free Trial", 0);
} else {
list($txn_id, $amt) = $this->doExpressCheckout($invoice, $details);
}
if ($txn_id != '') {
$err = $db->finish_waiting_payment($invoice, $this->get_plugin_name(), $txn_id, $amt, $vars = array());
if ($err) {
fatal_error($err);
return false;
} else {
$this->createRecurringBillingProfiles($invoice, $details['TOKEN'], '', $details);
header("Location: {$config['root_url']}/thanks.php?payment_id={$invoice}");
return true;
}
} else {
fatal_error(_PLUG_PAY_PAYPALPRO_FERROR8);
return false;
}
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:50,代码来源:paypal_pro.inc.php
示例20: member_send_zero_autoresponder
function member_send_zero_autoresponder($payment_id, $member_id = 0)
{
global $db, $config;
$p = $db->get_payment($payment_id);
$member_id = $p['member_id'];
$pr = $db->get_product($p['product_id']);
$t = new_smarty();
$et =& new aMemberEmailTemplate();
$et->name = "mail_autoresponder";
$et->product_id = $pr['product_id'];
$pl[0] = $pr;
$pl[0]['autoresponder'] = array_filter($et->find_days(), 'keep_only_zeroes');
// set global responder
if ($config['mail_autoresponder']) {
$et =& new aMemberEmailTemplate();
$et->name = "mail_autoresponder";
$days = $et->find_days();
if ($days) {
$pl[] = array('product_id' => -1, 'autoresponder' => array_filter($days, 'keep_only_zeroes'), 'autoresponder_renew' => $config['autoresponder_renew']);
}
}
foreach ($pl as $pr) {
$t =& new_smarty();
if (!$pr['autoresponder']) {
continue;
}
// if (!preg_match_all('/^\s*(\d+)\s*\-\s*(.+?)\s*$/m', $pr['autoresponder'], $regs))
//continue;
if ($pr['product_id'] > 0) {
$product_where = "AND p.product_id={$pr['product_id']}";
} else {
$product_where = "";
}
foreach ($pr['autoresponder'] as $days) {
$dat = date('Y-m-d', time() - $days * 3600 * 24);
$today = date('Y-m-d');
if ($pr['autoresponder_renew']) {
$q = $db->query($s = "SELECT m.*\n FROM {$db->config['prefix']}payments p\n LEFT JOIN {$db->config['prefix']}members m USING (member_id)\n WHERE m.member_id = '{$member_id}' and p.begin_date='{$dat}' AND p.completed>0\n {$product_where}\n GROUP BY m.member_id ");
} else {
$q = $db->query($s = "SELECT m.*\n FROM {$db->config['prefix']}members m\n LEFT JOIN {$db->config['prefix']}payments p USING (member_id)\n WHERE m.member_id = '{$member_id}' and p.completed > 0\n AND p.begin_date <= '{$today}' {$product_where}\n GROUP BY m.member_id\n HAVING\n SUM(to_days(if(p.expire_date>'{$today}', '{$today}', p.expire_date)) - to_days(p.begin_date)) = {$days}\n AND\n MAX(p.expire_date) >= '{$today}'\n ");
}
$et =& new aMemberEmailTemplate();
$et->name = "mail_autoresponder";
$et->product_id = $pr['product_id'] > 0 ? $pr['product_id'] : null;
$et->day = $days;
while ($u = mysql_fetch_assoc($q)) {
$u['data'] = $db->decode_data($u['data']);
$t->assign('user', $u);
$t->assign('product', $pr);
$t->assign('login', $u['login']);
$t->assign('pass', $u['pass']);
$t->assign('name_f', $u['name_f']);
$t->assign('name_l', $u['name_l']);
if ($u['unsubscribed']) {
continue;
}
mail_template_user($t, $et, $u, true);
}
}
}
}
开发者ID:subashemphasize,项目名称:test_site,代码行数:61,代码来源:member.inc.php
注:本文中的new_smarty函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论