本文整理汇总了PHP中instantiate_plugin函数的典型用法代码示例。如果您正苦于以下问题:PHP instantiate_plugin函数的具体用法?PHP instantiate_plugin怎么用?PHP instantiate_plugin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了instantiate_plugin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCancelLink
static function getCancelLink(Payment $payment)
{
$paysys = $this->getDi()->paysystemList->get($payment->paysys_id);
if ($paysys && $paysys->isRecurring() && ($pay_plugin =& instantiate_plugin('payment', $v['paysys_id'])) && method_exists($pay_plugin, 'get_cancel_link') && ($product = $payment->getProduct(false) && $product->isRecurring())) {
return $pay_plugin->get_cancel_link($v['payment_id']);
}
}
示例2: instantiate_plugin
<?php
/*
*
*
* Author: Alex Scott
* Email: alex@cgi-central.net
* Web: http://www.cgi-central.net
* FileName $RCSfile: ipn.php,v $
* Release: 3.1.8PRO ($Revision: 1.2 $)
*
* 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.
*
*
*/
require_once "../../../config.inc.php";
$pl =& instantiate_plugin('payment', 'zombaio');
$vars = get_input_vars();
$pl->handle_postback($vars);
示例3: instantiate_plugin
<?php
/*
*
*
* Author: Alex Scott
* Email: alex@cgi-central.net
* Web: http://www.cgi-central.net
* Details: Revecom Payment Plugin IPN
* FileName $RCSfile: ipn.php,v $
* Release: 3.1.9PRO ($Revision: 1.1.2.1 $)
*
* 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.
*
*
*/
require_once "../../../config.inc.php";
$pl =& instantiate_plugin('payment', 'itransact');
$pl->handle_postback(get_input_vars());
示例4: config_set_notebook_comment
* Web: http://www.cgi-central.net
* Details: google checkout payment plugin config
* FileName $RCSfile$
* Release: 3.2.3PRO ($Revision: 5000 $)
*
* 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.
*/
global $config;
$notebook_page = "Google Checkout";
config_set_notebook_comment($notebook_page, $notebook_page . ' configuration');
if (file_exists($rm = dirname(__FILE__) . "/readme.txt")) {
config_set_readme($notebook_page, $rm);
}
$features = array('title' => '', 'description' => '');
$pl =& instantiate_plugin('payment', 'google_checkout');
if (is_object($pl)) {
$features = $pl->get_plugin_features();
}
add_config_field('payment.google_checkout.merchant_id', 'Google Checkout Default Merchant Identifier', 'text', "Your default Google Checkout Merchant Identifier (usually a number, e.g. 123456).", $notebook_page, '');
add_config_field('payment.google_checkout.merchant_key', 'Google Checkout Default Merchant Key', 'text', "Your default Google Checkout Merchant Key.", $notebook_page, '');
add_config_field('payment.google_checkout.currency', 'Currency', 'text', "Your default Google Checkout Currency.<br />Technical limitations of the current service: USD (US dollars) is the only valid currency.", $notebook_page, '', '', '', array('default' => 'USD'));
add_config_field('payment.google_checkout.sandbox', 'Sandbox testing', 'select', "Set to No after you complete testing.", $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.google_checkout.debug', 'Test Mode Enabled', 'select', 'will log all IPN postback messages to aMember CP -> Error/Debug Log', $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field('payment.google_checkout.allow_create', 'Allow create new accounts', 'select', 'aMember will create member (if not exists) when <new-order-notification> received', $notebook_page, '', '', '', array('options' => array(0 => 'No', 1 => 'Yes')));
add_config_field("payment.google_checkout.title", "Payment system title", 'text', "to be displayed on signup.php and member.php pages", $notebook_page, '', '', '', array('default' => $features['title']));
add_config_field("payment.google_checkout.description", "Payment system description", 'text', "to be displayed on signup page", $notebook_page, '', '', '', array('default' => $features['description']));
add_config_field("payment.google_checkout.reattempt", 'Reattempt on Failure', 'text', "Enter list of days to reattempt failed credit card charge, for example: 3,8<br />\n <br />\n The reattempting failed payments option allows you to reattempt failed<br />\n payments before cancelling the subscription. Scheduled payments may fail<br /> \n due to several reasons, including insufficient funds. Payments will be<br />\n reattempted 3 days after the failure date. If it fails again, we will try once<br />\n more 5 days later (it is for sample above: 3,8). Failure on this last attempt<br />\n leads to cancellation of the subscription.<br />\n <br />\n NOTE: this time user will have FREE access to your site. If it is not acceptable<br />\n for your site, please don't enable this feature", $notebook_page, '', '', '', array('options' => array('' => 'No', 1 => 'Yes')));
add_config_field('payment.google_checkout.resend_postback', 'Resend Postback', 'textarea', "all IPN posts will be resent to specified URL,<br />\n you may need it for third-party affiliate script, for example<br />\n DON'T ENTER URL OF aMember Google checkout script HERE!<br />\n KEEP IT BLANK IF YOU DON'T UNDERSTAND WHAT IT MEANS", $notebook_page, '', '', '', array('default' => "", 'cols' => 40));
示例5: instantiate_plugin
<?php
/*
*
*
* Author: Alex Scott
* Email: alex@cgi-central.net
* Web: http://www.cgi-central.net
* FileName $RCSfile: ipn.php,v $
* Release: 3.1.9PRO ($Revision: 1.2 $)
*
* 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.
*
*
*/
require_once "../../../config.inc.php";
$pl =& instantiate_plugin('payment', 'clickbank');
$vars = get_input_vars();
$pl->handle_cancel($vars);
示例6: hexdec
// hopefully conform to the spec, mark this as a "random" type
// lets handle the version byte as a number
$byte = hexdec(substr($workid, 12, 2));
$byte = $byte & hexdec("0f");
$byte = $byte | hexdec("40");
$workid = substr_replace($workid, strtoupper(dechex($byte)), 12, 2);
// hopefully conform to the spec, mark this common variant
// lets handle the "variant"
$byte = hexdec(substr($workid, 16, 2));
$byte = $byte & hexdec("3f");
$byte = $byte | hexdec("80");
$workid = substr_replace($workid, strtoupper(dechex($byte)), 16, 2);
// build a human readable version
$wid = substr($workid, 0, 8) . '-' . substr($workid, 8, 4) . '-' . substr($workid, 12, 4) . '-' . substr($workid, 16, 4) . '-' . substr($workid, 20, 12);
return $wid;
}
function GetUtc8601($time)
{
$offset = date("Z");
$time = $time - $offset;
return date("Y-m-d\\TH:i:s\\Z", $time);
}
/*
function GetUtc8601(DateTime $time) {
$tTime = clone $time;
$tTime->setTimezone(new DateTimeZone("UTC"));
return $tTime->format("Y-m-d\TH:i:s\Z");
}
*/
instantiate_plugin('payment', 'bidpay');
示例7: save_cc_info
function save_cc_info($cc_info, $member, $paysys_id)
{
global $t, $db, $config;
// get a plugin config
$plugin =& instantiate_plugin('payment', $paysys_id);
if (!method_exists($plugin, 'cc_bill')) {
fatal_error("This plugin ({$paysys_id}) is not handled by cc_core!");
}
if (method_exists($plugin, 'save_cc_info')) {
$plugin->save_cc_info($cc_info, $member);
} else {
$features = $plugin->get_plugin_features();
$member['data']['cc-hidden'] = amember_crypt(preg_replace('/\\D+/', '', $cc_info['cc_number']));
$member['data']['cc'] = get_visible_cc_number($cc_info['cc_number']);
$member['data']['cc-expire'] = sprintf('%02d%02d', $cc_info['cc_expire_Month'], substr($cc_info['cc_expire_Year'], 2, 2));
if ($features['maestro_solo_switch']) {
$member['data']['cc_startdate'] = sprintf('%02d%02d', $cc_info['cc_startdate_Month'], substr($cc_info['cc_startdate_Year'], 2, 2));
$member['data']['cc_issuenum'] = $cc_info['cc_issuenum'];
}
if ($features['type_options']) {
$member['data']['cc_type'] = $cc_info['cc_type'];
}
if ($features['code'] > 1) {
$member['data']['cc_code'] = $cc_info['cc_code'];
}
if ($features['name']) {
$member['data']['cc_name'] = $cc_info['cc_name'];
}
if ($features['name_f']) {
$member['data']['cc_name_f'] = $cc_info['cc_name_f'];
$member['data']['cc_name_l'] = $cc_info['cc_name_l'];
}
if ($features['company']) {
$member['data']['cc_company'] = $cc_info['cc_company'];
}
if ($features['phone']) {
$member['data']['cc_phone'] = $cc_info['cc_phone'];
}
if ($features['housenumber']) {
$member['data']['cc_housenumber'] = $cc_info['cc_housenumber'];
}
$member['data']['cc_street'] = $cc_info['cc_street'];
$member['data']['cc_city'] = $cc_info['cc_city'];
$member['data']['cc_state'] = $cc_info['cc_state'];
if ($features['province_outside_of_us']) {
$member['data']['cc_province'] = $cc_info['cc_province'];
}
$member['data']['cc_zip'] = $cc_info['cc_zip'];
$member['data']['cc_country'] = $cc_info['cc_country'];
$db->update_user($member['member_id'], $member);
}
}
示例8: die
<?php
if (!defined('INCLUDED_AMEMBER_CONFIG')) {
die("Direct access to this location is not allowed");
}
$notebook_page = 'ikobo.Com';
config_set_notebook_comment($notebook_page, 'ikobo.Com plugin configuration');
if (file_exists($rm = dirname(__FILE__) . "/readme.txt")) {
config_set_readme($notebook_page, $rm);
}
add_config_field('payment.ikobo.account_id', 'iKobo account ID', 'text', "you may find it on the first page when you login to<br />\n iKobo merchant interface, example:<br />\n iKobo account : SA353157EN", $notebook_page, '');
add_config_field('payment.ikobo.postback_pass', 'iKobo postback password', 'text', "you have to set it into the same value here and at <br />\n iKobo.Com -> Login -> Sell -> Instant Payment Notification<br />\n see readme below for details", $notebook_page, '');
if (class_exists('payment_ikobo')) {
$pl =& instantiate_plugin('payment', 'ikobo');
$pl->add_config_items($notebook_page);
}
add_config_field('payment.ikobo.resend_postback', 'Resend Postback', 'textarea', "URL List to resend PostBack<br />\n please discuss your situation with CGI-Central support<br />\n before use this feature. It is better to keep this field blank", $notebook_page, '', '', '', array('default' => "", 'cols' => 40));
示例9: get_input_vars
<?php
require_once '../../../config.inc.php';
$vars = get_input_vars();
$pl =& instantiate_plugin('payment', 'manual_euro_bank');
$pl->submit($vars);
class AccountCheck
{
var $Bankname;
var $PRZ;
function ILVX_WS_ASCII_MODE_VERIFY($vBLZ, $vKonto, $vMode, $vAccess, $vSessionID, $vTimeStamp)
{
$a_vResult[VerifyProject] = "ilvx";
$a_vResult[VerifyMode] = $vMode;
$a_vResult[VerifySID] = $vSessionID;
$a_vResult[VerifyAccount] = $vKonto;
$a_vResult[VerifyBLZ] = $vBLZ;
$a_vResult[VerifyResult] = "129";
return $a_vResult;
}
function csv_query($blz)
{
$cdata = -1;
$fp = fopen('blz.csv', 'r');
while ($data = fgetcsv($fp, 1024, ";")) {
if ($data[0] == $blz) {
$cdata = array('blz' => $data[0], 'bankname' => $data[1], 'prz' => $data[2]);
break;
}
}
return $cdata;
示例10: array
$p[1] = $p[3];
$t[1] = $t[3];
}
$taxes = array();
foreach (array(1, 2, 3) as $k) {
if ($terms[$k]) {
$taxes[$k] = $terms[$k]->tax;
}
}
return array($a, $p, $t, $rebill_times, $taxes);
}
function init()
{
parent::init();
add_product_field('worldpay_currency', 'WorldPay Currency', 'select', 'currency for WorldPay gateway', '', array('options' => array('' => 'USD', 'GBP' => 'GBP', 'EUR' => 'EUR', 'JPY' => 'JPY', 'AUD' => 'AUD')));
}
function parse_period($days, $field = '')
{
list($c, $u) = parse_period($days);
if ($u == 'error') {
fatal_error(sprintf(_PLUG_PAY_WORLDPAY_FERROR4, $field, $days));
}
if ($u == 'fixed') {
fatal_error(sprintf(_PLUG_PAY_WORLDPAY_FERROR4, $field, $days));
}
$tr = array('d' => 1, 'm' => 3, 'y' => 4);
return array($c, $tr[$u]);
}
}
instantiate_plugin('payment', 'worldpay');
示例11: curl_setopt
curl_setopt($cs, CURLOPT_RETURNTRANSFER, true);
// receive returned characters
$answer = curl_exec($cs);
curl_close($cs);
if (strtoupper($answer) != "OK") {
$db->log_error("Confirmation OK - Capture failed, {$answer}");
return "Confirmation - Capture failed";
}
$vars += $vt_xml;
$err = $db->finish_waiting_payment($vt_xml["ORDERID"], 'saferpay', $vt_xml['ID'], $payment['amount'], $vars);
//print_r($vars);
if ($err) {
$db->log_error("Finish_waiting_payment error: {$err}");
return "Finish_waiting_payment error: {$err}";
}
$member = $db->get_user($payment['member_id']);
$member['data']['saferpay_user_pan'] = $vt_xml['CARDREFID'];
$member['data']['saferpay_user_expmonth'] = $vt_xml['EXPIRYMONTH'];
$member['data']['saferpay_user_expyear'] = $vt_xml['EXPIRYYEAR'];
$db->update_user($member['member_id'], $member);
}
function init()
{
parent::init();
add_member_field('saferpay_user_pan', '', 'hidden');
add_member_field('saferpay_user_expmonth', '', 'hidden');
add_member_field('saferpay_user_expyear', '', 'hidden');
}
}
$pl =& instantiate_plugin('payment', 'saferpay');
示例12: validate_thanks
return $ret;
}
function validate_thanks(&$vars)
{
$payment_id = intval($_GET['payment_id']);
$varsx = array('CustomerID' => $this->config['customer_id'], 'UserName' => $this->config['username'], 'AccessPaymentCode' => $vars['AccessPaymentCode']);
$this->result = $this->postToEWAY($payment_id, $this->get_result_url(), $varsx);
if ($this->result['RESPONSECODE'] != '00') {
return _TPL_CC_DECLINED_TITLE . " : " . $this->result['ERRORMESSAGE'];
}
}
function process_thanks(&$vars)
{
global $db;
$payment_id = intval($_GET['payment_id']);
$err = $db->finish_waiting_payment($payment_id, 'eway_international', $this->result['TRXNNUMBER'], $this->result['RETURNAMOUNT'], $vars);
if ($err) {
return _TPL_THX_ERROR_ERROR . " : " . $err;
}
}
function init()
{
parent::init();
if (!$this->config['country']) {
$this->config['country'] = 'UK';
}
add_product_field('eway_currency', 'EWAY Currency', 'select', '', '', array('options' => array('GBP' => 'GBP')));
}
}
instantiate_plugin('payment', 'eway_international');
示例13: array
global $config, $db;
$product = $products[0];
$vars = array('id' => $this->config['seller_id'], 'amount' => $amount, 'currency' => $product['dotpay_currency'] ? $product['dotpay_currency'] : 'PLN', 'description' => $title, 'lang' => $this->config['lang'], 'control' => $invoice, 'URL' => $config['root_url'] . "/plugins/payment/dotpay/thanks.php", 'type' => '0', 'URLC' => $config['root_url'] . "/plugins/payment/dotpay/ipn.php", 'firstname' => $u['name_f'], 'lastname' => $u['name_l'], 'email' => $u['email'], 'street' => $u['street'], 'state' => $u['state'], 'city' => $u['city'], 'postcode' => $u['zip'], 'country' => $u['country']);
$count_recurring = 0;
foreach ($products as $p) {
if ($p['is_recurring']) {
$count_recurring++;
}
}
if ($count_recurring > 1) {
fatal_error(_PLUG_PAY_PAYPALR_FERROR8);
}
$vars1 = array();
foreach ($vars as $kk => $vv) {
$v = urlencode($vv);
$k = urlencode($kk);
$vars1[] = "{$k}={$v}";
}
$vars = join('&', $vars1);
//$db->log_error("DotPay DEBUG: https://ssl.dotpay.eu?$vars");
header("Location: https://ssl.dotpay.eu?{$vars}");
exit;
}
function init()
{
parent::init();
add_product_field('dotpay_currency', 'DotPay Currency', 'select', 'currency for DotPay gateway', '', array('options' => array('PLN' => 'PLN', 'EUR' => 'EUR', 'USD' => 'USD', 'GBP' => 'GBP', 'JPY' => 'JPY')));
}
}
instantiate_plugin('payment', 'dotpay');
示例14: usort
usort($payments, 'rcmp_begin_date');
$now = date('Y-m-d');
$member_active = $member_paid = 0;
foreach ($payments as $k => $v) {
$payments[$k]['is_active'] = $v['expire_date'] >= $now && $v['begin_date'] <= $now ? 1 : 0;
if ($payments[$k]['is_active']) {
$member_active++;
}
if ($v['completed']) {
$member_paid++;
}
// try to display "Cancel" Link
if ($payments[$k]['expire_date'] >= date('Y-m-d')) {
$paysys = get_paysystem($v['paysys_id']);
$product = $db->get_product($v['product_id']);
if ($paysys['recurring'] && ($pay_plugin =& instantiate_plugin('payment', $v['paysys_id'])) && $product['is_recurring'] && method_exists($pay_plugin, 'get_cancel_link')) {
$payments[$k]['cancel_url'] = $pay_plugin->get_cancel_link($v['payment_id']);
}
}
}
$t->assign('payments', $payments);
///////////////////////////////////////////////////
$member_products = $_SESSION['_amember_products'];
foreach ((array) $member_products as $k => $pr) {
$member_products[$k]['url'] = add_password_to_url($pr['url']);
foreach ((array) $pr['add_urls'] as $u => $kk) {
$uu = add_password_to_url($u, $member_login_pw);
unset($member_products[$k]['add_urls'][$u]);
$member_products[$k]['add_urls'][$uu] = $kk;
}
}
示例15: trim
$member['data']['cc_city'] = $vars['AddressCity'];
}
if (!$member['data']['cc_street'] && $vars['AddressStreet1']) {
$member['data']['cc_street'] = trim($vars['AddressStreet1'] . " " . $vars['AddressStreet2']);
}
if (!$member['data']['cc_phone'] && $vars['CustomerPhone']) {
$member['data']['cc_phone'] = $vars['CustomerPhone'];
}
$db->update_user($member['member_id'], $member);
if (!$p['completed']) {
$err = $db->finish_waiting_payment($invoice, $this->get_plugin_name(), $vars['OrderReference'], '', $vars);
if ($err) {
$this->postback_error("finish_waiting_payment error: {$err}");
}
}
}
function init()
{
parent::init();
add_product_field('fastspring_id', 'FastSpring Product ID', 'text', "You can get an ID from your FastSpring account -> Product Pages -> Option 1: View Product Detail Page \n <br />For example ID is 'testmembership' for an URL http://sites.fastspring.com/your_company/product/testmembership", 'validate_fastspring_id');
}
}
function validate_fastspring_id(&$p, $field)
{
if ($p->config[$field] == '') {
return "You MUST enter FastSpring Product ID while you're using FastSpring Plugin";
}
return '';
}
$pl =& instantiate_plugin('payment', 'fastspring');