-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsubmit.php
176 lines (157 loc) · 4.7 KB
/
submit.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
require('config.php');
if (isset($_POST['stripeToken'])) {
\Stripe\Stripe::setVerifySslCerts(false);
$token = $_POST['stripeToken'];
$intent = \Stripe\PaymentIntent::create([
"amount" => 500,
"currency" => "inr",
"description" => "Payment for session on stay free",
"payment_method_data" => [
"type" => "card",
"card" => [
"token" => $token,
],
],
]);
try {
$intent->confirm();
// echo "<pre>";
// print_r($intent);
echo "$intent->id";
// include 'payment_success.php';
} catch (\Stripe\Exception\CardException $e) {
// Handle card processing error
echo "Error: " . $e->getMessage();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment Success</title>
<!-- <link rel="stylesheet" href="style.css"> -->
<!-- Add Font Awesome icons -->
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f3f7; /* Pastel blue background */
}
.container {
text-align: center;
max-width: 400px;
padding: 20px;
border: 1px solid #ccc;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
margin-top: 0;
color: #5f6e86; /* Pastel gray */
}
p {
margin-bottom: 10px;
color: #6e7d97; /* Slightly darker pastel gray */
}
#transactionId {
font-weight: bold;
color: #2d4053; /* Darker pastel blue */
}
.success-icon {
font-size: 60px;
color: #34c759; /* Pastel green */
margin-bottom: 20px;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body>
<div class="container">
<i class="fas fa-check-circle success-icon"></i>
<h1>Payment successfully initiated</h1>
<p>Your transaction ID is: <?php
echo $intent->id; ?></p>
<p>Your payment is successfully initiated and will be completed in a short time.</p>
<p>Thanks for trusting us and being a part of Stay Free family!</p>
</div>
</body>
</html>
<!-- Stripe\PaymentIntent Object
(
[id] => pi_3NbmtrSH4xbKCq8E1Ae2w08O
[object] => payment_intent
[amount] => 500
[amount_capturable] => 0
[amount_details] => Stripe\StripeObject Object
(
[tip] => Array
(
)
)
[amount_received] => 0
[application] =>
[application_fee_amount] =>
[automatic_payment_methods] =>
[canceled_at] =>
[cancellation_reason] =>
[capture_method] => automatic
[client_secret] => pi_3NbmtrSH4xbKCq8E1Ae2w08O_secret_2FIFELnhXYlupfaEYpFlAUNfx
[confirmation_method] => automatic
[created] => 1691251219
[currency] => inr
[customer] =>
[description] => Payment for session on stay free
[invoice] =>
[last_payment_error] =>
[latest_charge] =>
[livemode] =>
[metadata] => Stripe\StripeObject Object
(
)
[next_action] => Stripe\StripeObject Object
(
[type] => use_stripe_sdk
[use_stripe_sdk] => Stripe\StripeObject Object
(
[source] => src_1NbmtsSH4xbKCq8EDeYbpOmd
[stripe_js] => https://hooks.stripe.com/redirect/authenticate/src_1NbmtsSH4xbKCq8EDeYbpOmd?client_secret=src_client_secret_cLZK2NnYvznGDqecfKdW2Ukz&source_redirect_slug=test_YWNjdF8xTmJGd1pTSDR4YktDcThFLF9PT2E0Y0xZVEp5ZWpVWTBpWDB0QkpWQTZvYVNzaUNF0100TiJHqikk
[type] => three_d_secure_redirect
)
)
[on_behalf_of] =>
[payment_method] => pm_1NbmtrSH4xbKCq8Ej6Jm7jSk
[payment_method_options] => Stripe\StripeObject Object
(
[card] => Stripe\StripeObject Object
(
[installments] =>
[mandate_options] =>
[network] =>
[request_three_d_secure] => automatic
)
)
[payment_method_types] => Array
(
[0] => card
)
[processing] =>
[receipt_email] =>
[review] =>
[setup_future_usage] =>
[shipping] =>
[source] =>
[statement_descriptor] =>
[statement_descriptor_suffix] =>
[status] => requires_action
[transfer_data] =>
[transfer_group] =>
) -->