[php] Paystack
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- <?php
- $var = '<script>
- function payWithPaystack(){
- var amt = document.getElementById(\'add_money\').value;
- var email = document.getElementById(\'email\').value;
- amt = amt * 100;
- var err = \'\';
- if (amt>0) {
- const is_wallet = "<?php echo $_SESSION[\'IS_WALLET\'] = \'yes\' ?>";
- <?php $amt = \'<script>document.write(amt)<\\\\/script>\';
- echo $_SESSION[\'AMT\'] = $amt ?>";
- var handler = PaystackPop.setup({
- key: \'pk_test_fb4c501c1c8e8ddafb56a1e55073e84c35f70b7b\',
- email: email,
- amount: amt,
- currency: "NGN",
- ref: \'\'+Math.floor((Math.random() * 1000000000) + 1), // generates a pseudo-unique reference. Please replace with a reference you generated. Or remove the line entirely so our API will generate one for you
- metadata: {
- custom_fields: [
- {
- display_name: "Mobile Number",
- variable_name: "mobile_number",
- value: ""
- }
- ]
- },
- callback: function(response){
- const referenced = response.reference;
- const status = response.status;
- window.location.href=\'success?successfullypaid=\'+referenced+\'&status=\'+status;
- },
- onClose: function(){
- alert(\'window closed\');
- }
- });
- handler.openIframe();
- } else {
- var err = document.getElementById(\'err\').innerHTML="Please enter a valid amount";
- }
- }
- </script>';
Editor
You can edit this paste and save as new:
File Description
- Paystack
- Paste Code
- 09 Jun-2023
- 2.4 Kb
You can Share it: