Make the title of the stripe dialog's subscribe button say "Start Free Trial" if there isn't already a valid credit card on file
This commit is contained in:
parent
8f66c39ff5
commit
c6a189001a
1 changed files with 4 additions and 3 deletions
|
@ -1155,7 +1155,8 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
||||||
|
|
||||||
planService.getCardInfo(orgname, function(cardInfo) {
|
planService.getCardInfo(orgname, function(cardInfo) {
|
||||||
if (plan.price > 0 && (previousSubscribeFailure || !cardInfo.last4)) {
|
if (plan.price > 0 && (previousSubscribeFailure || !cardInfo.last4)) {
|
||||||
planService.showSubscribeDialog($scope, orgname, planId, callbacks);
|
var title = cardInfo.last4 ? 'Subscribe' : 'Start Free trial<span style="display:none">{{amount}}</span>';
|
||||||
|
planService.showSubscribeDialog($scope, orgname, planId, callbacks, title);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1228,7 +1229,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
||||||
return email;
|
return email;
|
||||||
};
|
};
|
||||||
|
|
||||||
planService.showSubscribeDialog = function($scope, orgname, planId, callbacks) {
|
planService.showSubscribeDialog = function($scope, orgname, planId, callbacks, opt_title) {
|
||||||
if (!Features.BILLING) { return; }
|
if (!Features.BILLING) { return; }
|
||||||
|
|
||||||
if (callbacks['opening']) {
|
if (callbacks['opening']) {
|
||||||
|
@ -1262,7 +1263,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
|
||||||
currency: 'usd',
|
currency: 'usd',
|
||||||
name: 'Quay.io ' + planDetails.title + ' Subscription',
|
name: 'Quay.io ' + planDetails.title + ' Subscription',
|
||||||
description: 'Up to ' + planDetails.privateRepos + ' private repositories',
|
description: 'Up to ' + planDetails.privateRepos + ' private repositories',
|
||||||
panelLabel: 'Subscribe',
|
panelLabel: opt_title || 'Subscribe',
|
||||||
token: submitToken,
|
token: submitToken,
|
||||||
image: 'static/img/quay-icon-stripe.png',
|
image: 'static/img/quay-icon-stripe.png',
|
||||||
opened: function() { $scope.$apply(function() { callbacks['opened']() }); },
|
opened: function() { $scope.$apply(function() { callbacks['opened']() }); },
|
||||||
|
|
Reference in a new issue