Guest User

Untitled

a guest
Jan 4th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. <div id="content">
  2. <h2>Thank you for choosing us! </h2>
  3.  
  4. <div class="article">
  5. Your ticket price is: <%=fareResult%> USD
  6. </div>
  7. <div>
  8.  
  9. <tr>
  10. <td>
  11. <script src="https://www.paypalobjects.com/api/checkout.js"></script>
  12.  
  13. <div id="paypal-button-container"></div>
  14.  
  15. <script>
  16. paypal.Button.render({
  17.  
  18. env: 'sandbox', // sandbox | production
  19.  
  20. // PayPal Client IDs - replace with your own
  21. // Create a PayPal app: https://developer.paypal.com/developer/applications/create
  22. client: {
  23. sandbox: 'mysandboxID',
  24. production: 'myID'
  25. },
  26.  
  27. // Show the buyer a 'Pay Now' button in the checkout flow
  28. commit: true,
  29. // payment() is called when the button is clicked
  30. payment: function (data, actions) {
  31.  
  32. // Make a call to the REST api to create the payment
  33.  
  34.  
  35. return actions.payment.create({
  36. payment: {
  37. transactions: [
  38. {
  39. amount: {total: '4', currency: 'USD'}
  40. }
  41. ]
  42. }
  43. });
  44. },
  45. // onAuthorize() is called when the buyer approves the payment
  46. onAuthorize: function (data, actions) {
  47.  
  48. // Make a call to the REST api to execute the payment
  49. return actions.payment.execute().then(function () {
  50. window.alert('Payment Complete!');
  51. });
  52. }
  53.  
  54. }, '#paypal-button-container');
  55. </script>
Add Comment
Please, Sign In to add comment