当前位置: 首页>>代码示例>>PHP>>正文


PHP Stripe::setAPIVersion方法代码示例

本文整理汇总了PHP中Stripe::setAPIVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Stripe::setAPIVersion方法的具体用法?PHP Stripe::setAPIVersion怎么用?PHP Stripe::setAPIVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stripe的用法示例。


在下文中一共展示了Stripe::setAPIVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMProGateway_stripe

 /**
  * Stripe Class Constructor
  *
  * @since 1.4
  */
 function PMProGateway_stripe($gateway = NULL)
 {
     $this->gateway = $gateway;
     $this->gateway_environment = pmpro_getOption("gateway_environment");
     $this->loadStripeLibrary();
     Stripe::setApiKey(pmpro_getOption("stripe_secretkey"));
     Stripe::setAPIVersion("2015-07-13");
     return $this->gateway;
 }
开发者ID:srimai,项目名称:paid-memberships-pro,代码行数:14,代码来源:class.pmprogateway_stripe.php

示例2: __construct

 /**
  * Stripe Class Constructor
  *
  * @since 1.4
  */
 function __construct($gateway = NULL)
 {
     $this->gateway = $gateway;
     $this->gateway_environment = pmpro_getOption("gateway_environment");
     $this->dependencies();
     $this->loadStripeLibrary();
     Stripe::setApiKey(pmpro_getOption("stripe_secretkey"));
     Stripe::setAPIVersion("2015-07-13");
     return $this->gateway;
 }
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:15,代码来源:class.pmprogateway_stripe.php

示例3: send_gift_manual

    public function send_gift_manual()
    {
        global $wpdb, $ntm_mail;
        if (isset($_POST['send_gift'])) {
            $option = get_option('giftbit');
            if ($option['amount'] >= $_POST['gift_amount']) {
                $this->fa_lead_options = get_option('fa_lead_settings');
                Stripe::setApiKey($this->fa_lead_options['api_key']);
                Stripe::setAPIVersion("2015-07-13");
                $customer_id = get_user_meta(get_blog_option(get_current_blog_id(), 'agent_id'), "pmpro_stripe_customerid");
                $amount = $this->fa_lead_options['admin_fee'] * 100;
                $giftAmount = $this->fa_lead_options['init_gift'];
                $invoice_item = Stripe_InvoiceItem::create(array('customer' => $customer_id, 'amount' => $this->fa_lead_options['admin_fee'], 'currency' => 'usd', 'description' => 'One-time setup fee'));
                $invoice = Stripe_Invoice::create(array('customer' => $customer_id));
                $result = $invoice->pay();
                if (isset($result->object) && $result->object == 'invoice') {
                    $data = array('endorser_id' => $_POST['endorser_id'], 'amout' => $_POST['gift_amount'], 'agent_id' => get_current_user_id(), 'created' => date("Y-m-d H:i:s"));
                    $wpdb->insert($wpdb->prefix . "gift_transaction", $data);
                    $gift_id = $wpdb->insert_id;
                    $ntm_mail->send_gift_mail('get_manualgift_mail', $_POST['endorser_id'], $gift_id);
                    $option['amount'] = $option['amount'] - $_POST['gift_amount'];
                    update_option("giftbit", $option);
                    $message = "Gift send successfully!!";
                } else {
                    $message = "Error when payment";
                }
            } else {
                $message = "Error! Insufficient balance!";
            }
        }
        //print_r(get_users(array('role'=>'endorser')));
        ?>
		
		<script>
			jQuery(document).ready(function(){
				jQuery("#gift_amount").change(function(){
					if(jQuery("#gift_amount").val() <= jQuery("#poststuff").data('amount'))
						jQuery("#send_gift").show();
					else
					{
						alert("Insufficient balance");
						jQuery("#send_gift").hide();
					}
				});
			});
		</script>
		
		<div data-amount="<?php 
        echo get_option('giftbit')['amount'];
        ?>
" id="poststuff" class="wrap">
		<h2>Send Gift By Manual</h2>
		<?php 
        if (isset($message)) {
            ?>
		<div id="message" class="updated"><p><?php 
            echo $message;
            ?>
</p></div>
		<?php 
        }
        ?>
			<div class="postbox">
				<div class="inside group">
					<form name="myform" method="post" >
					<table id="country" class="form-table">
						<tr>
							<th scope="row"><label for="blogname">Endorser</label></th>
							<td>
								<select class="regular-text" name="endorser_id">
									<option value="">Select Endorser</option>
									<?php 
        foreach (get_users(array('role' => 'endorser')) as $res) {
            ?>
									<option value="<?php 
            _e($res->data->ID);
            ?>
"><?php 
            _e($res->data->user_login . ' - ' . $res->data->user_email);
            ?>
</option>
									<?php 
        }
        ?>
								</select>
							</td>
						</tr>
						<tr>
							<th scope="row"><label for="blogname">Gift Amount</label></th>
							<td>
								<select class="regular-text" id="gift_amount" name="gift_amount">
									<option value="5">5$</option>
									<option value="10">10$</option>
									<option value="25">25$</option>
									<option value="50">50$</option>
									<option value="100">100$</option>
									<option value="150">150$</option>
									<option value="200">200$</option>
								</select>
							</td>
//.........这里部分代码省略.........
开发者ID:vinogautam,项目名称:endorsement_plugin,代码行数:101,代码来源:ntm-admin.php


注:本文中的Stripe::setAPIVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。