Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="content">
- <h2>Thank you for choosing us! </h2>
- <div class="article">
- Your ticket price is: <%=fareResult%> USD
- </div>
- <div>
- <tr>
- <td>
- <script src="https://www.paypalobjects.com/api/checkout.js"></script>
- <div id="paypal-button-container"></div>
- <script>
- paypal.Button.render({
- env: 'sandbox', // sandbox | production
- // PayPal Client IDs - replace with your own
- // Create a PayPal app: https://developer.paypal.com/developer/applications/create
- client: {
- sandbox: 'mysandboxID',
- production: 'myID'
- },
- // Show the buyer a 'Pay Now' button in the checkout flow
- commit: true,
- // payment() is called when the button is clicked
- payment: function (data, actions) {
- // Make a call to the REST api to create the payment
- return actions.payment.create({
- payment: {
- transactions: [
- {
- amount: {total: '4', currency: 'USD'}
- }
- ]
- }
- });
- },
- // onAuthorize() is called when the buyer approves the payment
- onAuthorize: function (data, actions) {
- // Make a call to the REST api to execute the payment
- return actions.payment.execute().then(function () {
- window.alert('Payment Complete!');
- });
- }
- }, '#paypal-button-container');
- </script>
Add Comment
Please, Sign In to add comment