paypal support for backups

This commit is contained in:
usmannasir
2024-08-03 16:17:33 +05:00
parent 43c60c6017
commit f500809452
3 changed files with 50 additions and 6 deletions

View File

@@ -2309,6 +2309,39 @@ app.controller('backupPlanNowOneClick', function ($scope, $http, $window) {
};
//// paypal
$scope.PaypalBuyNowBackup = function (planName, monthlyPrice, yearlyPrice, months) {
const baseURL = 'https://platform.cyberpersons.com/Billing/PaypalCreateOrderforBackupPlans';
// Get the current URL
var currentURL = window.location.href;
// Find the position of the question mark
const queryStringIndex = currentURL.indexOf('?');
// Check if there is a query string
currentURL = queryStringIndex !== -1 ? currentURL.substring(0, queryStringIndex) : currentURL;
// Encode parameters to make them URL-safe
const params = new URLSearchParams({
planName: planName,
monthlyPrice: monthlyPrice,
yearlyPrice: yearlyPrice,
returnURL: currentURL, // Add the current URL as a query parameter
months: months
});
// Build the complete URL with query string
const fullURL = `${baseURL}?${params.toString()}`;
// Redirect to the constructed URL
window.location.href = fullURL;
}
});

View File

@@ -46,7 +46,8 @@
<form action="/" class="form-horizontal bordered-row">
<p style="font-size: 15px;margin: 1%;">With CyberPanel's one-click backups, you can easily back up your website to our secure
<p style="font-size: 15px;margin: 1%;">With CyberPanel's one-click backups, you can easily back
up your website to our secure
servers in just 60 seconds. It's simple, fast, and reliable.</p>
@@ -82,7 +83,7 @@
<td>
{% if plan.state == 1 %}
<a
href="{% url 'ManageOCBackups' %}?id={{ plan.id }}">
href="{% url 'ManageOCBackups' %}?id={{ plan.id }}">
<button style="margin-bottom: 1%" type="button"
class="btn btn-primary btn-lg btn-block">{% trans "Schedule Backups" %}</button>
</a>
@@ -136,12 +137,22 @@
<td>${{ plan.monthlyPrice }}</td>
<td>${{ plan.yearlyPrice }}</td>
<td>
{% if plan.name != '100GB' %}
<button type="button"
ng-click="PaypalBuyNowBackup('{{ plan.name }}', '{{ plan.monthlyPrice }}', '{{ plan.yearlyPrice }}', 1)"
class="btn btn-primary btn-lg btn-block">{% trans "Buy Monthly (Paypal)" %}</button>
{% endif %}
<button type="button"
ng-click="BuyNowBackupP('{{ plan.name }}', '{{ plan.monthlyPrice }}', '{{ plan.yearlyPrice }}', 1)"
class="btn btn-primary btn-lg btn-block">{% trans "Buy Monthly" %}</button>
ng-click="PaypalBuyNowBackup('{{ plan.name }}', '{{ plan.monthlyPrice }}', '{{ plan.yearlyPrice }}', 12)"
class="btn btn-primary btn-lg btn-block">{% trans "Buy Yearly (Paypal)" %}</button>
{% if plan.name != '100GB' %}
<button type="button"
ng-click="BuyNowBackupP('{{ plan.name }}', '{{ plan.monthlyPrice }}', '{{ plan.yearlyPrice }}', 1)"
class="btn btn-primary btn-lg btn-block">{% trans "Buy Monthly via Card" %}</button>
{% endif %}
<button type="button"
ng-click="BuyNowBackupP('{{ plan.name }}', '{{ plan.monthlyPrice }}', '{{ plan.yearlyPrice }}', 12)"
class="btn btn-primary btn-lg btn-block">{% trans "Buy Yearly" %}</button>
class="btn btn-primary btn-lg btn-block">{% trans "Buy Yearly via Card" %}</button>
</td>
</td>
</tr>

View File

@@ -77,7 +77,7 @@
<!-- HELPERS -->
{% with version="2.3.5.6" %}
{% with version="2.3.5.7" %}
<link rel="stylesheet" type="text/css" href="{% static 'baseTemplate/assets/finalBase/finalBase.css' %}">