forked from dualcube/moodle-enrol_stripepayment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enrol.html
44 lines (41 loc) · 2.32 KB
/
enrol.html
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
<div class="mdl-align">
<h3><?php echo $instancename; ?></h3>
<p><?php echo $message; ?></p>
<p><b><?php echo get_string("cost").": {$instance->currency} {$localisedcost}"; ?></b></p>
<form action="<?php echo "$CFG->wwwroot/enrol/stripepayment/charge.php"?>" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="item_name" value="<?php p($coursefullname) ?>" />
<input type="hidden" name="item_number" value="<?php p($courseshortname) ?>" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="on0" value="<?php print_string("user") ?>" />
<input type="hidden" name="os0" value="<?php p($userfullname) ?>" />
<input type="hidden" name="custom" value="<?php echo "{$USER->id}-{$course->id}-{$instance->id}" ?>" />
<input type="hidden" name="currency_code" value="<?php p($instance->currency) ?>" />
<input type="hidden" name="amount" value="<?php p($cost) ?>" />
<input type="hidden" name="for_auction" value="false" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="cbt" value="<?php print_string("continuetocourse") ?>" />
<input type="hidden" name="first_name" value="<?php p($userfirstname) ?>" />
<input type="hidden" name="last_name" value="<?php p($userlastname) ?>" />
<input type="hidden" name="address" value="<?php p($useraddress) ?>" />
<input type="hidden" name="city" value="<?php p($usercity) ?>" />
<input type="hidden" name="email" value="<?php p($USER->email) ?>" />
<input type="hidden" name="country" value="<?php p($USER->country) ?>" />
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<?php echo $publishablekey; ?>"
data-image=""
data-name="<?php p($coursefullname) ?>"
data-description="Enrolment Cost (<?php p($instance->currency) ?><?php p($cost) ?>)"
data-metadata="6"
data-currency="<?php p($instance->currency) ?>"
data-amount="<?php p($cost * 100) ?>"
data-data-zip-code="<?php if ($validatezipcode == 0) { echo 'false'; } else { echo 'true'; } ?>"
data-billing-address="<?php if ($billingaddress == 0) { echo 'false'; } else { echo 'true'; } ?>"
>
</script>
</form>
</div>