Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(fix): adding payment method fails because of incorrect customer lookup
· f3a06d68
Mark Harding
authored
Aug 29, 2019
f3a06d68
(fix): if no customer, return empty list
· 119c6d9a
Mark Harding
authored
Aug 29, 2019
119c6d9a
Show whitespace changes
Inline
Side-by-side
Core/Payments/Stripe/Customers/Manager.php
View file @
119c6d9a
...
...
@@ -27,7 +27,7 @@ class Manager
* @param string $userGuid
* @return Customer
*/
public
function
getFromUserGuid
(
$userGuid
):
Customer
public
function
getFromUserGuid
(
$userGuid
):
?
Customer
{
$customerId
=
$this
->
lookup
->
get
(
"
{
$userGuid
}
:payments"
)[
'customer_id'
];
...
...
@@ -60,7 +60,7 @@ class Manager
'payment_method'
=>
$customer
->
getPaymentMethod
(),
]);
$this
->
l
u
->
set
(
"
{
$customer
->
getUserGuid
()
}
:payments"
,
[
$this
->
l
ookup
->
set
(
"
{
$customer
->
getUserGuid
()
}
:payments"
,
[
'customer_id'
=>
(
string
)
$stripeCustomer
->
id
]);
...
...
Core/Payments/Stripe/PaymentMethods/Manager.php
View file @
119c6d9a
...
...
@@ -41,6 +41,10 @@ class Manager
}
$customer
=
$this
->
customersManager
->
getFromUserGuid
(
$opts
[
'user_guid'
]);
if
(
!
$customer
)
{
return
new
Response
();
}
$stripePaymentMethods
=
$this
->
paymentMethodInstance
->
all
([
'customer'
=>
$customer
->
getId
(),
'type'
=>
'card'
,
...
...