Skip to content

Commit 23c4fe2

Browse files
committed
updated payment function
1 parent 88be37e commit 23c4fe2

1 file changed

Lines changed: 25 additions & 26 deletions

File tree

modules/gateways/paystack.php

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -177,34 +177,33 @@ function paystack_link($params)
177177
<script>
178178
var button_created = false;
179179
var paystackPop = new PaystackPop()
180-
paystackPop.checkout({
181-
key: \''.addslashes(trim($publicKey)).'\',
182-
email: \''.addslashes(trim($email)).'\',
183-
phone: \''.addslashes(trim($phone)).'\',
184-
amount: '.$amountinkobo.',
185-
currency: \''.addslashes(trim($currency)).'\',
186-
ref:\''.$txnref.'\',
187-
metadata:{
188-
"custom_fields":[
189-
{
190-
"display_name":"Plugin",
191-
"variable_name":"plugin",
192-
"value":"whmcs"
193-
}
194-
]
195-
},
196-
onSuccess: function(response){
197-
$(\'div.alert.alert-info.text-center\').hide();
198-
$(\'.payment-btn-container2\').hide();
199-
200-
window.location.href = \''.addslashes($callbackUrl).'&trxref=\' + response.trxref;
201-
},
202-
onCancel: function(){
203-
}
204-
});
205180
206181
function payWithPaystack(){
207-
paystackPop
182+
paystackPop.checkout({
183+
key: \''.addslashes(trim($publicKey)).'\',
184+
email: \''.addslashes(trim($email)).'\',
185+
phone: \''.addslashes(trim($phone)).'\',
186+
amount: '.$amountinkobo.',
187+
currency: \''.addslashes(trim($currency)).'\',
188+
ref:\''.$txnref.'\',
189+
metadata:{
190+
"custom_fields":[
191+
{
192+
"display_name":"Plugin",
193+
"variable_name":"plugin",
194+
"value":"whmcs"
195+
}
196+
]
197+
},
198+
onSuccess: function(response){
199+
$(\'div.alert.alert-info.text-center\').hide();
200+
$(\'.payment-btn-container2\').hide();
201+
202+
window.location.href = \''.addslashes($callbackUrl).'&trxref=\' + response.trxref;
203+
},
204+
onCancel: function(){
205+
}
206+
});
208207
}
209208
210209
function create_button(){

0 commit comments

Comments
 (0)