cart_payment_vogue.blade.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <script src="//pay.voguepay.com/js/voguepay.js"></script>
  2. <script>
  3. closedFunction=function() {
  4. location.href = '{{ env('APP_URL') }}'
  5. }
  6. successFunction=function(transaction_id) {
  7. location.href = '{{ env('APP_URL') }}'+'/vogue-pay/success/'+transaction_id
  8. }
  9. failedFunction=function(transaction_id) {
  10. location.href = '{{ env('APP_URL') }}'+'/vogue-pay/failure/'+transaction_id
  11. }
  12. </script>
  13. @if (get_setting('voguepay_sandbox') == 1)
  14. <input type="hidden" id="merchant_id" name="v_merchant_id" value="demo">
  15. @else
  16. <input type="hidden" id="merchant_id" name="v_merchant_id" value="{{ env('VOGUE_MERCHANT_ID') }}">
  17. @endif
  18. <script>
  19. window.onload = function(){
  20. pay3();
  21. }
  22. function pay3() {
  23. Voguepay.init({
  24. v_merchant_id: document.getElementById("merchant_id").value,
  25. total: '{{\App\Models\CombinedOrder::findOrFail(Session::get('combined_order_id'))->grand_total}}',
  26. cur: '{{\App\Models\Currency::findOrFail(get_setting('system_default_currency'))->code}}',
  27. merchant_ref: 'ref123',
  28. memo: 'Payment for shirt',
  29. developer_code: '5a61be72ab323',
  30. store_id: 1,
  31. loadText:'Custom load text',
  32. customer: {
  33. name: '{{ Session::get('shipping_info')['name'] }}',
  34. address: '{{ Session::get('shipping_info')['address'] }}',
  35. city: '{{ Session::get('shipping_info')['city'] }}',
  36. state: 'Customer state',
  37. zipcode: '{{ Session::get('shipping_info')['postal_code'] }}',
  38. email: '{{ Session::get('shipping_info')['email'] }}',
  39. phone: '{{ Session::get('shipping_info')['phone'] }}'
  40. },
  41. closed:closedFunction,
  42. success:successFunction,
  43. failed:failedFunction
  44. });
  45. }
  46. </script>