mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 01:29:21 +00:00
Explicitly configure HTTP request for PayPal (#8896)
* fix(payments): explicitly configure HTTP request * refactor(req): return $http call * fix(payments): inject and open $window
This commit is contained in:
parent
7a5f01d516
commit
521077ed4f
1 changed files with 4 additions and 3 deletions
|
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('habitrpg').factory('Payments',
|
||||
['$rootScope', 'User', '$http', 'Content', 'Notification',
|
||||
function($rootScope, User, $http, Content, Notification) {
|
||||
['$rootScope', '$window', 'User', '$http', 'Content', 'Notification',
|
||||
function($rootScope, $window, User, $http, Content, Notification) {
|
||||
var Payments = {};
|
||||
var isAmazonReady = false;
|
||||
Payments.amazonButtonEnabled = true;
|
||||
|
|
@ -362,7 +362,8 @@ function($rootScope, User, $http, Content, Notification) {
|
|||
|
||||
var gift = Payments.encodeGift(data.giftedTo, data.gift);
|
||||
var url = '/paypal/checkout?_id=' + User.user._id + '&apiToken=' + User.settings.auth.apiToken + '&gift=' + gift;
|
||||
$http.get(url);
|
||||
|
||||
$window.open(url, '_blank');
|
||||
}
|
||||
|
||||
Payments.encodeGift = function(uuid, gift) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue