Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

43 wiersze
1.3 KiB

  1. function onScriptLoad() {
  2. console.log('inside on load')
  3. var config = {
  4. root: '',
  5. flow: 'DEFAULT',
  6. data: {
  7. orderId: '{{ order_id}}',
  8. token: '{{ token }}',
  9. tokenType: 'TXN_TOKEN',
  10. amount: '{{ amount }}'
  11. },
  12. handler: {
  13. notifyMerchant: function(eventName, data) {
  14. // notify about the state of the payment page ( invalid token , session expire , cancel transaction)
  15. console.log('notifyMerchant handler function called');
  16. console.log('eventName => ', eventName);
  17. console.log('data => ', data);
  18. },
  19. transactionStatus: function transactionStatus(paymentStatus) {
  20. // provide information to merchant about the payment status.
  21. console.log('transaction status handler function called');
  22. console.log('paymentStatus => ', paymentStatus);
  23. }
  24. }
  25. };
  26. $('.paytm-loading').addClass('hidden');
  27. if (window.Paytm && window.Paytm.CheckoutJS) {
  28. window.Paytm.CheckoutJS.onLoad(function excecuteAfterCompleteLoad() {
  29. // initialze configuration using init method
  30. window.Paytm.CheckoutJS.init(config)
  31. .then(function onSuccess() {
  32. // after successfully updating configuration, invoke Blink Checkout
  33. window.Paytm.CheckoutJS.invoke();
  34. })
  35. .catch(function onError(error) {
  36. console.log('inside the error window')
  37. console.log('error => ', error);
  38. });
  39. });
  40. }
  41. }