/
functions.php
38 lines (34 loc) · 1.06 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
function callout($content,$width=null){
if($width==null){$w='200';}else{$w=$width;}
$callout .= '<div class="callout border-callout" style="text-align: center; width: '.$w.'px;">';
$callout .= $content;
$callout .= '<b class="border-notch notch"></b>';
$callout .= '<b class="notch"></b>';
$callout .= '</div>';
echo $callout;
}
function stripeCreatePlan(){
require_once('./lib/Stripe.php');
Stripe::setApiKey("mDZRJuHrjeG3sSKJdmumEZdbGtr1TLDW");
Stripe_Plan::create(array(
"amount" => 2000,
"interval" => "month",
"name" => "Amazing Gold Plan",
"currency" => "usd",
"id" => "gold")
);
}
function stripeSubscribeCustomer(){
// set your secret key: remember to change this to your live secret key in production
// see your keys here https://manage.stripe.com/account
Stripe::setApiKey("mDZRJuHrjeG3sSKJdmumEZdbGtr1TLDW");
// get the credit card details submitted by the form
$token = $_POST['stripeToken'];
$customer = Stripe_Customer::create(array(
"card" => $token,
"plan" => "gold",
"email" => "payinguser@example.com")
);
}
?>