mirrored from git://git.moodle.org/moodle.git
/
enrol.html
43 lines (35 loc) · 2.15 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
<div align="center">
<p><?php print_string("paymentrequired") ?></p>
<p><b><?php echo get_string("cost").": $CFG->enrol_currency $cost"; ?></b></p>
<p><?php print_string("paymentinstant") ?></p>
<?php
$paypalurl = empty($CFG->usepaypalsandbox) ? 'https://www.paypal.com/cgi-bin/webscr' : 'https://www.sandbox.paypal.com/cgi-bin/webscr';
?>
<form action="<?php echo $paypalurl ?>" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php p($CFG->enrol_paypalbusiness)?>">
<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" ?>">
<input type="hidden" name="currency_code" value="<?php p($CFG->enrol_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="notify_url" value="<?php echo "$CFG->wwwroot/enrol/paypal/ipn.php"?>">
<input type="hidden" name="return" value="<?php echo "$CFG->wwwroot/enrol/paypal/return.php?id=$course->id" ?>">
<input type="hidden" name="cancel_return" value="<?php echo $CFG->wwwroot ?>">
<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) ?>">
<input type="submit" value="<?php print_string("sendpaymentbutton", "enrol_paypal") ?>">
</form>
</div>