Paypal API Sandbox checkout button not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am testing my website which is http://138.68.164.186:5000/
The link is only working when the laptop is switched on. (still in development stage)
As a logged in user there is a subscription (billing page). The billing page contains the Paypal checkout button. When I click on the button a new browser opens up bu closes very quickly. I have been able to grab a screen shot.
I have used postman to generate the API
Below is my script.
I have added the Paypal script, PayPal button.
{% extends 'layout/dashboard.html' %}
{% load static %}
{% load crispy_forms_tags %}
{% block body %}
<div class="container-xxl flex-grow-1 container-p-y">
<h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Account Settings /</span> Billing </h4>
<div class="row">
<div class="col-md-12">
<ul class="nav nav-pills flex-column flex-md-row mb-3">
<li class="nav-item">
<a class="nav-link active" href="#;"><i class="bx bx-user me-1"></i> Billing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pages-account-settings-notifications.html"
><i class="bx bx-bell me-1"></i> Notifications</a>
</li>
</ul>
<div class="card">
<h5 class="card-header">Billing Information</h5>
<div class="card-body">
<div class="mb-3 col-12 mb-0">
<!-- -->
<script src="https://www.paypal.com/sdk/js?client-id=AQK_07Ti2_xSUVBYerKpxubDibK9XaF3efm2AwvUEch3NA5pp2ru3wFixkek...">
</script>
{% if user.profile.subscriptionType == "free" %}
<div class="alert alert-warning">
<h6 class="alert-heading fw-bold mb-1">You are currently on the Free Tier</h6>
<p class="mb-0">You can cancel your subscription at any time, no strings attached</p>
</div>
<div id="paypal-button-container-1"></div>
{% elif user.profile.subscriptionType == "starter" %}
<div class="alert alert-info">
<h6 class="alert-heading fw-bold mb-1">You are currently on the Starter Tier</h6>
<p class="mb-0">You can cancel your subscription at any time, no strings attached</p>
</div>
<div id="paypal-button-container-2"></div>
{% elif user.profile.subscriptionType == "advanced" %}
<div class="alert alert-success">
<h6 class="alert-heading fw-bold mb-1">You are currently on the Advanced Tier</h6>
<p class="mb-0">You can cancel your subscription at any time, no strings attached</p>
</div>
{% else %}
<h1>Something went wrong</h1>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script>
paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'P-1F15340389910541HMNONK2A' // Creates starter plan subscription
});
},
onApprove: function(data, actions) {
alert('You have successfully created subscription ' + data.subscriptionID); // Optional message given to subscriber
},
onCancel: function (data) {
alert('You have cancelled your subscription'); //When the transaction cancels.
}
}).render('#paypal-button-container-1'); // Renders the PayPal button
</script>
{% endblock %}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We're having the same problem.
- Selenium functional tests are failing after the "Debit or Credit Card" button is clicked.
- The PayPal dialog displays briefly, then disappears.
- Clicking on the "Debit or Credit Card" button multiple times sometimes results in the PayPal dialog displaying properly.
- After getting the dialog to display properly, entering the proper data and submitting, the dialog displays the message "Things don't appear to be working at the moment. Please try again later"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As an update, I have found that if i continously click on the paypal button then 1 in 6 times it does work. (kind of)
I am able to enter a sandbox username and account number. They paypal thinks about it then tell me they are unable to process the order and try again later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Paypal advance checkout in PayPal Payments Standard
- venmo option not showing on smart phone in PayPal Payments Standard
- Our online donation forms won't connect to Paypal in PayPal Payments Standard
- Using Paypal Smart Buttons for checkout sometimes fails with Debit/ Credit Cards Form in Braintree Client-side Integration (JS, iOS, Android SDKs)
- Disputes Webhook does not works on Sandbox (23/04/24) in Sandbox Environment