Kind Regards
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/13750508.255604.1621434160035%40mail.yahoo.com.
Kind Regards
<!--<button
class="btn btn-lg btn-primary btn-block text-uppercase"
type="submit">Post</button>-->
<div id="paypal-button"></div>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
paypal.Button.render({
// Configure environment
env: 'sandbox',
client: {
sandbox: 'demo_sandbox_client_id',
production: 'demo_production_client_id'
},
// Customize button (optional)
locale: 'en_US',
style: {
size: 'responsive',
color: 'gold',
shape: 'pill',
label: 'pay',
tagline: 'true',
fundingicons: 'true',
},
// Enable Pay Now checkout flow (optional)
commit: true,
// Set up a payment
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '15.00',
currency: 'USD'
}
}],
redirect_urls: {
return_url: 'https://example.com',
cancel_url: 'https://example.com'
}
});
},
experience: {
input_fields: {
no_shipping: 1
}
},
// Execute the payment
onAuthorize: function(data, actions) {
return actions.payment.execute().then(function() {
// Show a confirmation message to the buyer
window.alert('Thank you for your payment, your ad will be live now!');
});
},
onError: function (err) {
// Show an error page here, when an error occurs
},
onCancel: function (data, actions) {
// Show a cancel page or return to cart
window.alert('Your Payment Was Cancelled!');
},
}, '#paypal-button');
</script>
<br />
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock content %}
{% block jsfiles %}{% endblock jsfiles %}
Thanks
Kind Regards
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1362915566.1915479.1622464587686%40mail.yahoo.com.
onAuthorize: function(data, actions) {
return actions.payment.execute().then(function() {
// Show a confirmation message to the buyer
window.alert('Thank you for your payment, your ad will be live now!')
;
fetch(`${url}?data=${JSON.stringify(data)}`)
});
},
Kind Regards
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/765753284.2471150.1622576700188%40mail.yahoo.com.