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


PHP js::stripeToken方法代码示例

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


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

示例1: stripeDetails

 private function stripeDetails()
 {
     $cid = $this->company->id;
     $this->exportJS(js::stripeToken($this->getSetting('stripe_publish'), 'savecc'));
     $span = [];
     $fields = [];
     $fields[] = array('type' => 'input', 'text' => 'Name on Card', 'val' => null, 'var' => null, 'class' => 'card-name');
     $fields[] = array('type' => 'input', 'text' => 'Card Number', 'val' => null, 'var' => null, 'class' => 'card-number');
     $fields[] = array('type' => 'input', 'text' => 'CVC', 'labelnote' => '3 digits', 'val' => null, 'var' => null, 'comment' => 'Enter 3 or 4 digit code on back of your card', 'class' => 'card-cvc');
     $span[] = ['span' => 5, 'elements' => $fields];
     $fields = [];
     $fields[] = array('type' => 'input', 'text' => 'Expiration Month', 'val' => null, 'var' => null, 'comment' => 'Expiration Month in Two Digits', 'class' => 'card-expiry-month');
     $fields[] = array('type' => 'input', 'text' => 'Expiration Year', 'val' => null, 'var' => null, 'comment' => 'Expiration Year in Four Digits', 'class' => 'card-expiry-year');
     $fields[] = array('type' => 'input', 'text' => 'Billing Zip Code', 'val' => null, 'var' => null, 'class' => 'card-zip');
     $span[] = ['span' => 5, 'elements' => $fields];
     // Mask Inputs
     $this->exportJs(js::maskInput('card-expiry-month', "99"));
     $this->exportJs(js::maskInput('card-zip', "99999"));
     $this->exportJs(js::maskInput('card-expiry-year', "9999"));
     $form = form::init()->id('payment-form')->post('/billing/')->spanElements($span)->render();
     $data = "<p>You are about to add or update your credit card information. <b>This form will NOT charge your credit card</b>. This is merely updating our merchant with your new card details for monthly subscriptions or billable items.</p>";
     $saveCC = button::init()->text('Update Credit Card')->icon('arrow-right')->addStyle('savecc')->addStyle('btn-info')->render();
     if (isset($_GET['newcard'])) {
         $pre = base::alert('success', "Card Updated!", "Your new card has been updated and is ready for use!") . $pre;
     }
     $data .= $form;
     if ($this->company->company_stripeid) {
         $plan = $this->stripe_getCustomerPlan($this->company->id);
         if (!$plan) {
             $pdata = "<h4>No Subscription Found</h4>";
         } else {
             $items = [];
             $items[] = ['label' => 'Subscription Name:', 'content' => $plan['name']];
             $items[] = ['label' => 'Interval:', 'content' => "Every " . $plan['interval_count'] . " Month(s)"];
             $items[] = ['label' => 'Price:', 'content' => "\$" . number_format($plan['amount'] / 100, 2)];
             $pdata = base::itemPairs($items);
             $cancel = button::init()->text("Cancel Subscription")->addStyle('get')->url('/billing/cancel/')->addStyle('btn-danger')->icon('remove')->render();
         }
         $data .= $pdata . $cancel;
     }
     $data = widget::init()->span(8)->header("Update Credit Card")->content($data)->icon('credit-card')->footer($saveCC)->render();
     return $data;
 }
开发者ID:carriercomm,项目名称:atikit,代码行数:43,代码来源:billing.php

示例2: ccUpdateForm

 private function ccUpdateForm(&$ticket)
 {
     $cid = $ticket['company_id'];
     $this->exportJS(js::stripeToken($this->getSetting('stripe_publish'), 'savecc'));
     $span = [];
     $fields = [];
     $fields[] = array('type' => 'input', 'text' => 'Name on Card', 'val' => null, 'var' => null, 'class' => 'card-name');
     $fields[] = array('type' => 'input', 'text' => 'Card Number', 'val' => null, 'var' => null, 'class' => 'card-number');
     $fields[] = array('type' => 'input', 'text' => 'CVC', 'labelnote' => '3 digits', 'val' => null, 'var' => null, 'comment' => 'Enter 3 or 4 digit code on back of your card', 'class' => 'card-cvc');
     $span[] = ['span' => 6, 'elements' => $fields];
     $fields = [];
     $fields[] = array('type' => 'input', 'text' => 'Expiration Month', 'val' => null, 'var' => null, 'comment' => 'Expiration Month in Two Digits', 'class' => 'card-expiry-month');
     $fields[] = array('type' => 'input', 'text' => 'Expiration Year', 'val' => null, 'var' => null, 'comment' => 'Expiration Year in Four Digits', 'class' => 'card-expiry-year');
     $fields[] = array('type' => 'input', 'text' => 'Billing Zip Code', 'val' => null, 'var' => null, 'class' => 'card-zip');
     $fields[] = ['type' => 'hidden', 'var' => 'cid', 'val' => $ticket['company_id']];
     $fields[] = ['type' => 'hidden', 'var' => 'tid', 'val' => $ticket['id']];
     $span[] = ['span' => 6, 'elements' => $fields];
     // Mask Inputs
     $this->exportJs(js::maskInput('card-expiry-month', "99"));
     $this->exportJs(js::maskInput('card-zip', "99999"));
     $this->exportJs(js::maskInput('card-expiry-year', "9999"));
     $form = form::init()->id('payment-form')->post('/ticket/')->spanElements($span)->render();
     $pre = "<p>You are about to add or update your billing information. <b>This will not charge your credit card</b>. This is merely updating our merchant with your new card details.</p>";
     return $pre . $form;
 }
开发者ID:carriercomm,项目名称:atikit,代码行数:25,代码来源:ticket.php


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