customer_package_payment_vogue.blade.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. @php
  20. $customer_package = \App\Models\CustomerPackage::findOrFail(Session::get('payment_data')['customer_package_id']);
  21. @endphp
  22. <script>
  23. window.onload = function(){
  24. pay3();
  25. }
  26. function pay3() {
  27. Voguepay.init({
  28. v_merchant_id: document.getElementById("merchant_id").value,
  29. total: '{{ $customer_package->amount }}',
  30. cur: '{{\App\Models\Currency::findOrFail(get_setting('system_default_currency'))->first()->value)->code}}',
  31. merchant_ref: 'ref123',
  32. loadText:'Custom load text',
  33. customer: {
  34. name: '{{ Auth::user()->name }}',
  35. email: '{{ Auth::user()->email }}',
  36. phone: '{{ Auth::user()->phone }}'
  37. },
  38. closed:closedFunction,
  39. success:successFunction,
  40. failed:failedFunction
  41. });
  42. }
  43. </script>