mirror of
https://github.com/HabitRPG/habitica.git
synced 2026-04-22 19:39:25 -05: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user