#thecoderhero

1 messages · Page 1 of 1 (latest)

marsh tartanBOT
finite condor
#

👋 Not sure I fully grasp the question, can you elaborate?
What "sources" are you referring to?

normal gate
#

I am pulling PaymentMethod from the Customer object. We have MANY old customers that have a Source for their payment method.

#

Here is a sample of our code:

#

public static List<PaymentMethod> getStripePaymentMethodsByStripeCustomerId(String stripeCustomerId)
throws StripeException {
Map<String, Object> params = new HashMap<>();
params.put("customer", stripeCustomerId);
return PaymentMethod.list(params).getData();
}

#

Does this get only PaymentMethods or does it return all payment methods including Source Objects?

finite condor
#

AFAIK I think it only lists PaymentMethod pm_xx objects.
Have you tested it already? If not, running a quick test can confirm the expected result

normal gate
#

Ya, that's what I thought. Just double checking.

#

Thank you