wallet_payment_vogue.blade.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <script src="//pay.voguepay.com/js/voguepay.js"></script>
  2. <script>
  3. closedFunction=function() {
  4. alert('window closed');
  5. location.href = '{{ env('APP_URL') }}'
  6. }
  7. successFunction=function(transaction_id) {
  8. location.href = '{{ env('APP_URL') }}'+'/vogue-pay/success/'+transaction_id
  9. }
  10. failedFunction=function(transaction_id) {
  11. location.href = '{{ env('APP_URL') }}'+'/vogue-pay/success/'+transaction_id
  12. }
  13. </script>
  14. @if (get_setting('voguepay_sandbox') == 1)
  15. <input type="hidden" id="merchant_id" name="v_merchant_id" value="demo">
  16. @else
  17. <input type="hidden" id="merchant_id" name="v_merchant_id" value="{{ env('VOGUE_MERCHANT_ID') }}">
  18. @endif
  19. <script>
  20. window.onload = function(){
  21. pay3();
  22. }
  23. function pay3() {
  24. Voguepay.init({
  25. v_merchant_id: document.getElementById("merchant_id").value,
  26. total: '{{ Session::get('payment_data')['amount'] }}',
  27. cur: '{{\App\Models\Currency::findOrFail(get_setting('system_default_currency'))->code}}',
  28. merchant_ref: 'ref123',
  29. loadText:'Custom load text',
  30. customer: {
  31. name: '{{ Auth::user()->name }}',
  32. email: '{{ Auth::user()->email }}',
  33. phone: '{{ Auth::user()->phone }}'
  34. },
  35. closed:closedFunction,
  36. success:successFunction,
  37. failed:failedFunction
  38. });
  39. }
  40. </script>