-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathform.php
More file actions
executable file
·610 lines (550 loc) · 30.7 KB
/
form.php
File metadata and controls
executable file
·610 lines (550 loc) · 30.7 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
<?php if (!defined('ABSPATH')) exit;
/**
* Shortcode for donation form
*
* @param array $atts Valid keys are name (form name) and live (mode)
* @param string $content Page contents for donation confirmation step
* @return string HTML form contents
*/
function raise_form($atts, $content = null)
{
// Disable caching
if (!defined('DONOTCACHEPAGE')) {
define('DONOTCACHEPAGE', true);
}
// Extract shortcode attributes (name becomes $form, etc.)
extract(shortcode_atts([
'form' => '', // $form
'live' => 'true', // $live
], $atts));
// Make sure we have a boolean
$live = ($live == 'false' || $live == 'no' || $live == '0') ? false : true;
$mode = !$live ? 'sandbox' : 'live';
try {
$formSettings = raise_init_donation_form($form, $mode);
} catch (\Exception $ex) {
?>
<div class="alert alert-danger" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
<?= $ex->getMessage() ?>
</div>
<?php
return;
}
// Get user country using freegeoip.net
$userCountry = raise_get_initial_country($formSettings);
$userCountryCode = raise_get($userCountry['code']);
$userCurrency = raise_get_user_currency($userCountryCode);
$currencies = raise_get($formSettings['amount']['currency'], array());
$supportedCurrencyCodes = array_map('strtoupper', array_keys($currencies));
$preselectedCurrency = $userCurrency && in_array($userCurrency, $supportedCurrencyCodes) ? $userCurrency : reset($supportedCurrencyCodes);
$lcCurrency = strtolower($preselectedCurrency);
$preselectedCurrencyFlag = raise_get($currencies[$lcCurrency]['country_flag'], '');
$preselectedCurrencyPattern = raise_get($currencies[$lcCurrency]['pattern'], '');
$preselectedCurrencyLowerBound = raise_get($currencies[$lcCurrency]['lower_bound'], 1);
// Handle redirection case after successful payment
if (isset($_GET['success']) && $_GET['success'] == 'true') {
// Set status to payed to prevent replay attacks on our logs
$checkoutCssClass = '';
$confirmationCssClass = ' active';
} else {
$checkoutCssClass = ' active';
$confirmationCssClass = '';
}
ob_start();
?>
<!-- Start Bootstrap scope -->
<div class="btstrp">
<?php if ($mode == 'sandbox'): ?>
<div class="progress">
<div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
<span><strong>sandbox</strong></span>
</div>
</div>
<?php endif; ?>
<!-- Donation form -->
<form action="<?php echo admin_url('admin-ajax.php') ?>" method="post" id="donationForm" class="form-horizontal">
<script>
var raiseDonationConfig = {
mode: "<?= $mode ?>",
userCountry: "<?= $userCountryCode ?>",
selectedCurrency: "<?= $preselectedCurrency ?>",
countryCompulsory: <?= raise_get($formSettings['payment']['extra_fields']['country'], false) ? 1 : 0 ?>
}
</script>
<input type="hidden" name="action" value="process_banktransfer"> <!-- ajax key -->
<input type="hidden" name="form" value="<?= $form ?>" id="raise-form-name">
<input type="hidden" name="mode" value="<?= $mode ?>" id="raise-form-mode">
<input type="hidden" name="post_donation_instructions" value="" id="raise-form-post-donation-instructions">
<input type="hidden" name="locale" value="<?= get_locale() ?>">
<input type="hidden" name="share_data_offered" id="share-data-offered" value="0">
<input type="hidden" name="tip_offered" id="tip-offered" value="0">
<input type="hidden" name="tip_amount" id="tip-amount" value="0">
<input type="hidden" name="tip_percentage" id="tip-percentage" value="0">
<!-- Scrollable root element -->
<div id="wizard">
<!-- Progress bar -->
<div id="progress" class="row">
<ol>
<li class="col-xs-4<?php echo $checkoutCssClass ?>"><span>1</span> <?php _e('Amount', 'raise') ?></li>
<li class="col-xs-4"><span>2</span> <?php _e('Payment', 'raise') ?></li>
<li class="col-xs-4<?php echo $confirmationCssClass ?>"><span>3</span> <?php _e('Finish', 'raise') ?></li>
</ol>
</div>
<!-- Scrollable items -->
<div id="donation-carousel" data-ride="carousel" data-interval="false" data-wrap="false" data-keyboard="false">
<!-- Amount slide -->
<div class="item<?php echo $checkoutCssClass ?>" id="amount-item">
<div class="sr-only">
<h3><?php _e('My Donation', 'raise') ?></h3>
</div>
<!-- Currency -->
<div class="<?php echo count($currencies) > 1 ? 'row' : 'hidden' ?>">
<div class="col-xs-12" id="donation-currency">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="<?php echo plugins_url('assets/images/blank.gif', __FILE__) ?>" id="selected-currency-flag" class="flag flag-<?php echo $preselectedCurrencyFlag ?>" alt="<?php echo $preselectedCurrency ?>">
<span id="selected-currency"><?php echo $preselectedCurrency ?></span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<?php
foreach ($currencies as $lcCurrency => $currencySettings) {
$currency = strtoupper($lcCurrency);
$flagCss = isset($currencySettings['country_flag']) ? 'flag-' . $currencySettings['country_flag'] : '';
$checked = $currency == $preselectedCurrency ? 'checked' : '';
echo '<li><label for="currency-' . $lcCurrency . '"><input type="radio" id="currency-' . $lcCurrency . '" name="currency" value="' . $currency . '" class="hidden" ' . $checked . '><img src="'. plugins_url("assets/images/blank.gif", __FILE__) . '" class="flag ' . $flagCss . '" alt="' . $currency . '">' . $currency . '</label></li>';
}
?>
</ul>
</div>
</div>
</div>
<?php
$enabledProviders = raise_enabled_payment_providers($formSettings, $mode);
$monthlyDisplay = raise_monthly_frequency_supported($enabledProviders) ? '' : 'hidden';
$monthlyChecked = raise_get($formSettings['amount']['frequency']['default'], 'once') == 'monthly';
$onceAttribute = $monthlyChecked ? '' : ' checked';
$onceClass = $monthlyChecked ? '' : 'active';
$monthlyAttribute = $monthlyChecked ? ' checked' : '';
$monthlyClass = $monthlyChecked ? 'active' : '';
?>
<div class="row <?= $monthlyDisplay ?>">
<ul id="frequency" class="col-xs-12">
<li>
<input type="radio" class="radio" name="frequency" value="once" id="frequency-once"<?= $onceAttribute ?>>
<label for="frequency-once" class="<?= $onceClass ?>"><?php _e('Give once', 'raise') ?></label>
</li><li>
<input type="radio" class="radio" name="frequency" value="monthly" id="frequency-monthly"<?= $monthlyAttribute ?>>
<label for="frequency-monthly" class="<?= $monthlyClass ?>"><?php _e('Give monthly', 'raise') ?></label>
<?php if ($supertext = raise_get($formSettings['amount']['helper_texts']['monthly_donation_teaser'])): ?>
<sup class="monthly-donation-teaser"><?= esc_html(raise_get_localized_value($supertext)) ?></sup>
<?php endif; ?>
</li>
</ul>
</div>
<?php
// Monthly buttons (if present)
$amountsMonthly = raise_get($formSettings['amount']['button_monthly'], []);
$onceButtonClass = $monthlyChecked && $amountsMonthly ? ' hidden' : '';
$monthlyButtonClass = $monthlyChecked && $amountsMonthly ? '' : ' hidden';
?>
<?php if (raise_get($formSettings['amount']['helper_texts']['average_amount_once']) || raise_get($formSettings['amount']['helper_texts']['average_amount_monhtly'])): ?>
<div class="row">
<div class="col-xs-12 average-amounts">
<div class="average-amounts__once<?= $onceButtonClass ?>">
<?php
echo raise_get_localized_value(raise_get($formSettings['amount']['helper_texts']['average_amount_once'], ""));
?>
</div>
<div class="average-amounts__monthly<?= $monthlyButtonClass ?>">
<?php
echo raise_get_localized_value(raise_get($formSettings['amount']['helper_texts']['average_amount_monthly'], ""));
?>
</div>
</div>
</div>
<?php endif; ?>
<div class="row">
<ul id="amounts" class="radio">
<?php
// One-time buttons
$cols = min(12, raise_get($formSettings['amount']['columns'], 3));
$buttonColSpan = floor(12 / $cols);
$tabIndex = 0;
$amounts = raise_get($formSettings['amount']['button'], array());
foreach (array_filter($amounts) as $amount) {
echo '<li class="col-xs-' . $buttonColSpan . ' amount-once' . $onceButtonClass . '">';
echo ' <input type="radio" class="radio" name="amount" value="' . $amount . '" tabindex="' . ++$tabIndex . '" id="amount-once-' . $amount . '">';
echo ' <label for="amount-once-' . $amount . '">' . str_replace('%amount%', $amount, $preselectedCurrencyPattern) . '</label>';
echo '</li>';
}
$tabIndexMonthly = $tabIndex;
foreach (array_filter($amountsMonthly) as $amount) {
echo '<li class="col-xs-' . $buttonColSpan . ' amount-monthly' . $monthlyButtonClass . '">';
echo ' <input type="radio" class="radio" name="amount" value="' . $amount . '" tabindex="' . ++$tabIndexMonthly . '" id="amount-monthly-' . $amount . '">';
echo ' <label for="amount-monthly-' . $amount . '">' . str_replace('%amount%', $amount, $preselectedCurrencyPattern) . '</label>';
echo '</li>';
}
?>
<?php if (raise_get($formSettings['amount']['custom'], true)): ?>
<li class="col-xs-<?php echo 12 - ($buttonColSpan * $tabIndex % 12) ?>">
<div class="input-group">
<span class="input-group-addon"><?php echo trim(str_replace('%amount%', '', $preselectedCurrencyPattern)); ?></span>
<input type="number" min="<?= $preselectedCurrencyLowerBound ?>" class="form-control input-lg text" name="amount_other" id="amount-other" placeholder="<?php _e('Other', 'raise') ?>" tabindex="<?php echo ++$tabIndexMonthly ?>">
<label for="amount-other" class="sr-only"><?php _e('Other', 'raise') ?></label>
</div>
</li>
<?php endif; ?>
</ul>
</div>
<div class="buttons row">
<div class="col-sm-4 col-sm-offset-4">
<button type="button" class="btn btn-lg confirm donation-continue" disabled="disabled"><?php _e('Next', 'raise') ?></button>
</div>
</div>
</div>
<!-- Payment slide -->
<div class="item" id="payment-method-item">
<div class="sr-only">
<h3><?php _e('Choose a payment method', 'raise') ?></h3>
</div>
<div class="form-group payment-info" id="payment-providers">
<?= raise_print_payment_providers($formSettings, $mode); ?>
</div>
<!-- Purpose -->
<?php
if (raise_get($formSettings['payment']['order']['purpose_first'], false)) {
if ($purposes = raise_get($formSettings['payment']['purpose'])) {
raise_print_purpose($purposes, $formSettings);
}
}
?>
<!-- Name -->
<div class="form-group required donor-info">
<label for="donor-name" class="col-sm-3 control-label"><?php _e('Name', 'raise') ?></label>
<div class="col-sm-9">
<input type="text" class="form-control text" name="name" id="donor-name" placeholder="">
</div>
</div>
<!-- Donate anonymously (for fundraisers only) -->
<?php if (!empty($formSettings['fundraiser']) && raise_get($formSettings['payment']['extra_fields']['anonymous'], false)): ?>
<div class="form-group donor-info" style="margin-top: -17px">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="anonymous" id="donor-anonymous" value="1"> <?= raise_get_localized_value(raise_get($formSettings['payment']['labels']['anonymous'], __('Don\'t publish my name', 'raise'))) ?>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Email -->
<div class="form-group required donor-info">
<label for="donor-email" class="col-sm-3 control-label"><?php _e('Email', 'raise') ?></label>
<div class="col-sm-9">
<input type="email" class="form-control text" name="email" id="donor-email" placeholder="">
</div>
</div>
<!-- Anti-spam email (only used for bank transfer, reset on submit) -->
<div id="email-confirm-group" class="form-group required donor-info">
<label for="donor-email-confirm" class="col-sm-3 control-label"><?php _e('Email', 'raise') ?></label>
<div class="col-sm-9">
<input type="email" class="form-control text" name="email-confirm" id="donor-email-confirm" value="">
</div>
</div>
<!-- Country (if necessary for tax deduction) -->
<?php if (raise_get($formSettings['payment']['extra_fields']['country'], false)): ?>
<div class="form-group required donor-info">
<label for="donor-country" class="col-sm-3 control-label"><?php _e('Country', 'raise') ?></label>
<div class="col-sm-9">
<select class="combobox form-control" name="country_code" id="donor-country">
<option></option>
<?php
$countries = raise_get_sorted_country_list();
foreach ($countries as $code => $country) {
$checked = $userCountryCode === $code ? 'selected' : '';
echo '<option value="' . $code . '" ' . $checked . '>' . $country[0] . '</option>';
}
?>
</select>
</div>
</div>
<?php endif; ?>
<!-- Purpose -->
<?php
if (!raise_get($formSettings['payment']['order']['purpose_first'], false)) {
if ($purposes = raise_get($formSettings['payment']['purpose'])) {
raise_print_purpose($purposes, $formSettings);
}
}
?>
<!-- Comment -->
<?php if (raise_get($formSettings['payment']['extra_fields']['comment'], false)): ?>
<div class="form-group donor-info">
<label for="donor-comment" class="col-sm-3 control-label"><?= raise_get_localized_value(raise_get($formSettings['payment']['labels']['comment'], __('Public comment', 'raise'))) ?> (<?php _e('optional', 'raise') ?>)</label>
<div class="col-sm-9">
<textarea class="form-control" rows="3" name="comment" id="donor-comment"></textarea>
</div>
</div>
<?php endif; ?>
<?php
if (raise_get($formSettings['payment']['order']['checkboxes_last'], false)) {
raise_print_donor_extra_info($formSettings, $userCountryCode);
}
?>
<!-- Share with charity -->
<?php if (!empty($formSettings['payment']['form_elements']['share_data'])): ?>
<div id="share-data-form-group" class="form-group donor-info" style="margin-top: -10px; display: none">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="share_data" id="share-data" value="1" class="precheckable" disabled>
<span id="share-data-text"><?php _e('Share my data with recipient charity', 'raise'); ?></span>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Tipping -->
<?php if (!empty($formSettings['payment']['form_elements']['tip'])): ?>
<div id="tip-form-group" class="form-group donor-info" style="margin-top: -10px; display: none">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="tip" id="tip" value="1" class="precheckable">
<span id="tip-text"></span>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Terms and conditions -->
<?php if (!empty($formSettings['payment']['form_elements']['terms']['label'])): ?>
<div id="share-data-form-group" class="form-group required donor-info" style="margin-top: -10px">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="terms" id="terms" value="1" required>
<span id="terms-text"><?= raise_get_localized_value($formSettings['payment']['form_elements']['terms']['label']) ?></span>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Mailing list -->
<?php if (!empty($formSettings['webhook']['mailing_list'][$mode])): ?>
<div class="form-group donor-info" style="margin-top: -10px">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="mailinglist" id="donor-mailinglist" value="1">
<?php
if (!empty($formSettings['payment']['form_elements']['mailing_list'])) {
echo esc_html(raise_get_localized_value($formSettings['payment']['form_elements']['mailing_list']));
} else {
_e('Subscribe me to newsletter', 'raise');
}
?>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Gift aid -->
<?php
if (!empty($formSettings['payment']['form_elements']['gift_aid'])):
?>
<div class="form-group donor-info" style="margin-top: -10px; display: none">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="gift_aid" id="gift-aid" value="1" class="precheckable">
<span id="gift-aid-text"></span>
</label>
</div>
</div>
</div>
<!-- Gift aid confirmation -->
<div class="form-group required donor-info" style="margin-top: -10px; display: none">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="gift_aid_confirmation" id="gift-aid-confirmation" value="1" class="precheckable" required>
<span id="gift-aid-confirmation-text"></span>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Tax receipt -->
<?php
$taxReceiptCheckboxHidden = raise_get($formSettings['payment']['form_elements']['tax_receipt']['checkbox_hidden'], false);
if (!$taxReceiptCheckboxHidden):
?>
<div class="form-group donor-info" style="margin-top: -10px">
<div class="col-sm-offset-3 col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="tax_receipt" id="tax-receipt" value="1" class="precheckable" disabled>
<span id="tax-receipt-text"><?php _e('I need a tax receipt', 'raise'); ?></span>
</label>
</div>
</div>
</div>
<?php endif; ?>
<?php
if (!raise_get($formSettings['payment']['order']['checkboxes_last'], false)) {
raise_print_donor_extra_info($formSettings, $userCountryCode);
}
?>
<!-- Account description -->
<?php if (!empty($formSettings['payment']['account_description'])): ?>
<div class="row">
<div id="account-description" class="col-sm-offset-3 col-sm-9"></div>
</div>
<?php endif; ?>
<div class="buttons row">
<div class="col-sm-6 col-sm-push-3 nopadding">
<button type="submit" class="btn btn-lg confirm donation-continue" id="donation-submit"><?php _e('Next', 'raise') ?></button>
</div>
<div class="col-xs-4 col-sm-3 col-sm-pull-6" style="text-align: left">
<button type="button" class="btn btn-link unconfirm" id="donation-go-back"><?php _e('Back', 'raise') ?></button>
</div>
<div class="col-xs-8 col-sm-12" id="secure-transaction">
<span class="glyphicon glyphicon-lock" aria-hidden="true"></span><span class="glyphicon glyphicon-ok glyphicon-overlay" aria-hidden="true"></span> <?php _e('Secure', 'raise') ?>
</div>
</div>
<?php if ($siteKey = raise_get($formSettings['payment']['recaptcha']['site_key'])): ?>
<div class="row relative">
<div id='recaptcha' class="g-recaptcha"
data-sitekey="<?= $siteKey ?>"
data-callback="sendBanktransferDonation"
data-size="invisible"
data-badge="inline"></div>
<div class="g-recaptcha-overlay" title="reCAPTCHA"></div>
</div>
<script src="//www.google.com/recaptcha/api.js" async defer></script>
<?php endif; ?>
</div>
<!-- Confirmation slide -->
<div class="item<?php echo $confirmationCssClass ?>" id="donation-confirmation">
<div class="alert alert-success">
<div class="response-icon"></div>
<div class="response-text">
<strong><span id="success-text"><?php echo esc_html(raise_get_localized_value($formSettings['finish']['success_message'])) ?></span></strong>
</div>
</div>
<div id="shortcode-content">
<?php echo !empty($content) ? do_shortcode($content) : '' ?>
</div>
</div>
</div>
</div>
</form>
<?php
if (in_array('paypal', $enabledProviders)): ?>
<!-- PayPal modal -->
<div id="PayPalModal" class="modal raise-modal raise-popup-modal fade" role="dialog" data-backdrop="static">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div id="PayPalPopupButton"></div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if (in_array('gocardless', $enabledProviders)): ?>
<!-- GoCardless modal -->
<div id="GoCardlessModal" class="modal raise-modal raise-popup-modal fade" role="dialog" data-backdrop="static">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<div class="pp gocardless"></div>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div class="raise_popup_open hidden">
<p><?php _e("Please continue the donation in the secure window that you've already opened.", "raise") ?></p>
<button class="btn btn-primary" onclick="raisePopup.focus()">OK</button>
</div>
<div class="raise_popup_closed">
<p id="GoCardlessNote" class="hidden"><strong><?php _e("Note: GoCardless requires a mandate of type “recurrent”, but we will only collect once.", "raise") ?></strong></p>
<button id="GoCardlessPopupButton" class="btn btn-primary"><span class="glyphicon glyphicon-lock" style="margin-right: 5px" aria-hidden="true"></span><?php _e("Set up Direct Debit", "raise") ?></button>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if (in_array('bitpay', $enabledProviders)): ?>
<!-- Bitpay modal -->
<div id="BitPayModal" class="modal raise-modal raise-popup-modal fade" role="dialog" data-backdrop="static">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<div class="pp bitpay"></div>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div class="raise_popup_open hidden">
<p><?php _e("Please continue the donation in the secure window that you've already opened.", "raise") ?></p>
<button class="btn btn-primary" onclick="raisePopup.focus()">OK</button>
</div>
<div class="raise_popup_closed">
<button id="BitPayPopupButton" class="btn btn-primary"><span class="glyphicon glyphicon-lock" style="margin-right: 5px" aria-hidden="true"></span><?php _e("Pay by Bitcoin", "raise") ?></button>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if (in_array('coinbase', $enabledProviders)): ?>
<!-- Coinbase modal -->
<div id="CoinbaseModal" class="modal raise-modal raise-popup-modal fade" role="dialog" data-backdrop="static">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<div class="pp coinbase"></div>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div class="raise_popup_open hidden">
<p><?php _e("Please continue the donation in the secure window that you've already opened.", "raise") ?></p>
<button class="btn btn-primary" onclick="raisePopup.focus()">OK</button>
</div>
<div class="raise_popup_closed">
<p class="coinbase_notice">
<?php _e("<strong>Important:</strong> Do not close the popup window until the transaction has been <strong>verified</strong>. This can take <strong>up to 10 minutes</strong>. Once the transaction is verified, click on <strong>Continue</strong> or wait until the popup is closed automatically.", 'raise'); ?>
</p>
<button id="CoinbasePopupButton" class="btn btn-primary"><span class="glyphicon glyphicon-lock" style="margin-right: 5px" aria-hidden="true"></span><?php _e("Donate with Crypto", "raise") ?></button>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if (in_array('skrill', $enabledProviders)): ?>
<!-- Skrill modal -->
<div id="SkrillModal" class="modal raise-modal raise-iframe-modal fade" role="dialog" data-backdrop="static">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body"></div>
</div>
</div>
</div>
<?php endif; ?>
<div id="drawer"></div>
</div>
<!-- End Bootstrap scope -->
<?php
return ob_get_clean();
}