Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="https://www.paypalobjects.com/api/checkout.js"></script>
- <script>
- paypal.Button.render({
- client: {
- sandbox: 'AUqe7hp0cLjEDtBW1wip6Ro-S0C1IGjbglBdLLLy9NRPyQgqDbAqCtVySFK-bqxF4Vb1BpSmDqD_Bxzt',
- production: 'AXQ9cwtDj9fVeosCzIDTCj8tXroo8-NfcUbOogZGG1dL5Ay_a7pzdC52TSdfq0GWbnIltZRr7weZJ1Hd'
- },
- style: {
- size: 'small',
- color: 'gold',
- shape: 'rect',
- label: 'generic'
- },
- env: 'production', // Or 'production',
- commit: true, // Show a 'Pay Now' button
- timeout: 30000,
- payment: function (data, actions) {
- return actions.payment.create({
- payment: {
- transactions: [
- {
- amount: {total: '{{$price}}', currency: 'USD'}
- }
- ]
- }
- });
- },
- onAuthorize: function (data, actions) {
- return actions.payment.execute().then(function (payment) {
- $.ajax({
- method: 'POST',
- url: '{{ route('tasks.payments.paypal', ['task' => $task])}}',
- }).done(function (response) {
- window.location = response.redirect;
- });
- });
- }
- }, '#paypal-button');
- </script>
Add Comment
Please, Sign In to add comment