Skip to content

Commit 81d50b7

Browse files
committed
Payment form language has been made dynamic
1 parent 52b3ad6 commit 81d50b7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

enrol.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,24 @@ function random_str(
8686
$request->setIpAddress($USER->lastip);
8787
$request->setPrice($cost);
8888
$request->setCurrency(\weepay\Model\Currency::TL);
89-
$request->setLocale(\weepay\Model\Locale::TR);
9089
$request->setDescription('Moodle WeePay Payment Solution');
9190
//$request->setCallBackUrl($CFG->wwwroot . "/enrol/weepaypayment/callback.php");
9291
$request->setCallBackUrl($CFG->wwwroot . "/enrol/weepaypayment/callback.php?oid=".$OrderID . "-" . $USER->id . "-" . $course->id . "-" . $instance->id);
9392
$request->setPaymentGroup(\weepay\Model\PaymentGroup::PRODUCT);
9493
$request->setPaymentChannel(\weepay\Model\PaymentChannel::WEB);
94+
// Payment Language Selector
95+
if($USER->lang=='en')
96+
{
97+
$request->setLocale(\weepay\Model\Locale::EN);
98+
}
99+
else if ($USER->lang=='tr')
100+
{
101+
$request->setLocale(\weepay\Model\Locale::TR);
102+
}
103+
else // Otherwise Turkish
104+
{
105+
$request->setLocale(\weepay\Model\Locale::TR);
106+
}
95107

96108
//Customer
97109
$customer = new \weepay\Model\Customer();
@@ -138,7 +150,7 @@ function random_str(
138150

139151
$checkoutFormInitialize = \weepay\Model\CheckoutFormInitialize::create($request, $options);
140152

141-
echo "<div id='weePay-checkout-form' class='responsive'>";
153+
echo "<div id='weePay-checkout-form' class='responsive col-lg-6 col-md-12 col-sm-12' style='float:none; margin:auto;'>";
142154

143155
if ($checkoutFormInitialize->getStatus() == 'success') {
144156

0 commit comments

Comments
 (0)