Paypal API Sandbox checkout button not working

chao1234567
Contributor
Contributor

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. 

 

chao1234567_1-1667032258480.png

 

 

chao1234567_0-1667032227380.png

 

 

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 %}

Login to Me Too
5 REPLIES 5

SladeRun14
New Community Member

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"

Edit Message - PayPal Community - Brave.png

 

 

Login to Me Too

chao1234567
Contributor
Contributor

If you keep on clicking on it does it work? 

 

Login to Me Too

larrygowan1
New Community Member
Hello I have a question to ask I'm new at this and I really don't know anything about how to do this how can I receive money coming from games that I'm playing on the internet and on my iPod the individuals who run the games that I play for money you telling me they send my money to my account but it won't accept it so what are the steps that I have to take you open it up so my cash could come in my account?
Login to Me Too

chao1234567
Contributor
Contributor

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. 

 

 

Login to Me Too

Lukaz2020
Contributor
Contributor
I have also this problem, but only by subscriptions.
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.