-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
213 lines (190 loc) · 10 KB
/
index.html
File metadata and controls
213 lines (190 loc) · 10 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Global Payments - Developer Example</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://globalpayments-samples.github.io/css/styles.css">
</head>
<body>
<!-- Header -->
<header class="gp-header">
<div class="gp-container">
<div class="gp-header-content">
<div class="gp-logo">
<picture>
<source media="(min-width: 768px)" srcset="https://globalpayments-samples.github.io/assets/img/GP_logo.svg">
<img src="https://globalpayments-samples.github.io/assets/img/GP_favicon.svg" alt="Global Payments" style="height: 32px; width: auto;">
</picture>
</div>
<nav class="gp-header-nav">
<a href="https://developer.globalpayments.com/">Documentation</a>
<a href="https://developer.globalpayments.com/api/references-overview">API Reference</a>
<a href="https://developer.globalpayments.com/docs/integration-options/sdk/overview">SDKs</a>
</nav>
</div>
</div>
</header>
<div class="gp-container">
<!-- Page Title -->
<h1 class="gp-page-title">SDK Integration Examples</h1>
<p class="gp-page-subtitle">Explore comprehensive examples of Global Payments SDK implementations across different payment scenarios.</p>
<!-- Tabs -->
<div class="gp-tabs">
<div class="gp-tab-list">
<button class="gp-tab-button active" data-tab="payment-form">Payment Form</button>
<button class="gp-tab-button" data-tab="tokenization">Tokenization</button>
<button class="gp-tab-button" data-tab="webhooks">Webhooks</button>
<button class="gp-tab-button" data-tab="recurring">Recurring Payments</button>
</div>
<!-- Payment Form Tab -->
<div class="gp-tab-content active" id="payment-form">
<div class="gp-card">
<div class="gp-card-header">
<h2 class="gp-card-title">Credit Card Payment Form</h2>
<p class="gp-card-description">
Secure payment processing using Global Payments tokenization with client-side form validation.
</p>
</div>
<form id="payment-form" class="gp-form" action="/process-payment" method="POST">
<div class="gp-form-group">
<label for="amount" class="gp-label">Amount ($):</label>
<input type="number" id="amount" name="amount" class="gp-input" min="0.01" step="0.01" value="10.00" required>
</div>
<div class="gp-form-group">
<label for="billing_zip" class="gp-label">Billing Zip Code:</label>
<input type="text" id="billing_zip" name="billing_zip" class="gp-input" placeholder="12345" required>
</div>
<div class="gp-form-group">
<label class="gp-label">Credit Card Information:</label>
<div id="credit-card"></div>
</div>
<button type="submit" class="gp-button gp-button-primary gp-button-full">
Process Payment
</button>
</form>
</div>
</div>
<!-- Tokenization Tab -->
<div class="gp-tab-content" id="tokenization">
<div class="gp-card">
<div class="gp-card-header">
<h2 class="gp-card-title">Card Tokenization</h2>
<p class="gp-card-description">
Securely tokenize payment methods for future use without storing sensitive card data.
</p>
</div>
<div class="gp-alert gp-alert-info">
<strong>Info:</strong> Tokens can be stored securely and used for future transactions without handling raw card data.
</div>
<form id="tokenization-form" class="gp-form">
<div class="gp-form-group">
<label class="gp-label">Card Information for Tokenization:</label>
<div id="credit-card-token"></div>
</div>
<button type="submit" class="gp-button gp-button-primary gp-button-full">
Generate Token
</button>
</form>
<div id="token-result" class="gp-hidden">
<h3 class="gp-card-title gp-mt-lg">Generated Token:</h3>
<div class="gp-code-block" id="token-display"></div>
</div>
</div>
</div>
<!-- Webhooks Tab -->
<div class="gp-tab-content" id="webhooks">
<div class="gp-card">
<div class="gp-card-header">
<h2 class="gp-card-title">Webhook Integration</h2>
<p class="gp-card-description">
Configure and test webhook endpoints for real-time payment notifications.
</p>
</div>
<div class="gp-code-block">
// Example webhook handler
app.post('/webhook', (req, res) => {
const signature = req.headers['x-gp-signature'];
const payload = req.body;
// Verify webhook signature
if (verifySignature(payload, signature)) {
handlePaymentEvent(payload);
res.status(200).send('OK');
} else {
res.status(400).send('Invalid signature');
}
});
</div>
<div class="gp-alert gp-alert-warning">
<strong>Security:</strong> Always verify webhook signatures to ensure requests are from Global Payments.
</div>
</div>
</div>
<!-- Recurring Payments Tab -->
<div class="gp-tab-content" id="recurring">
<div class="gp-card">
<div class="gp-card-header">
<h2 class="gp-card-title">Recurring Payments</h2>
<p class="gp-card-description">
Set up subscription billing and recurring payment schedules.
</p>
</div>
<form id="recurring-form" class="gp-form">
<div class="gp-form-row">
<div class="gp-form-group">
<label for="subscription-amount" class="gp-label">Monthly Amount ($):</label>
<input type="number" id="subscription-amount" name="subscription-amount" class="gp-input" min="1.00" step="0.01" value="29.99" required>
</div>
<div class="gp-form-group">
<label for="billing-cycle" class="gp-label">Billing Cycle:</label>
<select id="billing-cycle" name="billing-cycle" class="gp-select" required>
<option value="monthly">Monthly</option>
<option value="quarterly">Quarterly</option>
<option value="annually">Annually</option>
</select>
</div>
</div>
<div class="gp-form-group">
<label class="gp-label">Payment Method:</label>
<div id="credit-card-recurring"></div>
</div>
<button type="submit" class="gp-button gp-button-primary gp-button-full">
Set Up Subscription
</button>
</form>
</div>
</div>
</div>
</div>
<!-- Footer -->
<!--
DEVELOPER NOTE: Update the following footer information to match your business:
- Company name and copyright year
- Update all links to point to your actual Terms of Service, Privacy Policy, and Refund Policy pages
- Refund Policy link is typically required by payment processor underwriting in addition to Terms and Privacy
- Ensure all linked policies are accessible and up-to-date before going live
-->
<footer class="gp-footer">
<div class="gp-container">
<div class="gp-footer-content">
<div class="gp-footer-section">
<p class="gp-footer-copyright">
© 2024- Your Company Name. All rights reserved.
</p>
</div>
<div class="gp-footer-section">
<nav class="gp-footer-nav">
<a href="/terms-of-service" class="gp-footer-link">Terms of Service</a>
<a href="/privacy-policy" class="gp-footer-link">Privacy Policy</a>
<a href="/refund-policy" class="gp-footer-link">Refund Policy</a>
</nav>
</div>
</div>
</div>
</footer>
<script src="https://globalpayments-samples.github.io/js/script.js"></script>
</body>
</html>