From 521077ed4ffac55bc3dab87100e14f1365202ae1 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 27 Jul 2017 11:31:58 -0700 Subject: [PATCH] Explicitly configure HTTP request for PayPal (#8896) * fix(payments): explicitly configure HTTP request * refactor(req): return $http call * fix(payments): inject and open $window --- website/client-old/js/services/paymentServices.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/client-old/js/services/paymentServices.js b/website/client-old/js/services/paymentServices.js index 58ba77dca2..28e7a841e5 100644 --- a/website/client-old/js/services/paymentServices.js +++ b/website/client-old/js/services/paymentServices.js @@ -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) {