Level 70
Jan 23, 2020
2
Level 3
Trying to retrieve Stripe payment methods; returns null object.
public function getPaymentMethods(Request $request)
{
$user = $request->user();
$paymentMethods = $user->PaymentMethods();
info($user->PaymentMethods());
return response()->json($paymentMethods);
}
The above presents in the logs:
[2020-01-23 21:07:26] local.INFO: [{}]
However, if given:
public function getPaymentMethods(Request $request)
{
$user = $request->user();
$paymentMethods = $user->paymentMethods();
info($user->hasPaymentMethod());
return response()->json($paymentMethods);
}
Logs present:
[2020-01-23 21:09:18] local.INFO: 1
So "$user->hasPaymentMethod()" returns true, but trying to call those payment methods with "user->paymentmethods()" returns null. We do have a stripe_id for a payment method associated with the user stored locally. Am I missing something?
Please or to participate in this conversation.