· 6 years ago · Feb 01, 2019, 03:32 PM
1//activate match category------------------------------------
2
3
4
5 if(isset($matchActivate)){
6
7 //set Stripe key
8
9require_once('stripe-php-6.28.0/init.php');
10
11$stripe = [
12 "secret_key" => "sk_test_xxxx",
13 "publishable_key" => "pk_test_xxxx",
14];
15
16\Stripe\Stripe::setApiKey($stripe['secret_key']);
17
18echo 'stripe key: ' . $stripe['secret_key'];
19
20
21 echo "<p>You are about to ADD the Match Category.</p>" . "<p>A<b> SEPARATE CHARGE for $3/monthly</b> will show on your statement for this category</p>" . "<p>Press ADD button, below, to complete, or return to your <a href=https://onlinedateshare.com/Account-Details>Account Details page.</a></p>";
22
23?>
24<form id="mactivatenow" name="mactivatenow" action="" method="post"<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>>
25
26 <input type="hidden" name="matchactivatenow" id="matchactivatenow" value="true">
27
28
29<script
30 src="https://checkout.stripe.com/checkout.js" class="stripe-button"
31 data-key="pk_test_xxxx"
32 data-amount=$pricetotal
33 data-name="OnlineDateShare.com"
34 data-description="OnDaSh Category Subscription(s)"
35 data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
36 data-locale="auto"
37 data-currency="usd"
38 data-billing-address="true"
39 data-zip-code="true"
40 data-label="Add Match Category ($3/monthly)"
41 data-panel-label="Add Match Category ($3/monthly)">
42 </script>
43
44<?php
45
46}
47if($matchAtivatenow == true){
48 // Retrieve the request's body and parse it as JSON:
49
50require_once('stripe-php-6.28.0/init.php');
51
52$input = @file_get_contents('php://input');
53$event_json = json_decode($input);
54
55// Do something with $event_json
56
57http_response_code(200); // PHP 5.4 or greater
58
59
60
61$session = $_SESSION['ondashsession'];
62
63
64//get stripe token for add category transactions----------------
65
66
67 $token = $_POST['stripeToken'];
68 $email = $_POST['stripeEmail'];
69
70if(empty($_POST['stripeToken'])){
71 exit();
72 echo 'NO token';
73}else{