Closed pointerish closed 2 years ago
@pointerish Yep it looks like the latter is the cause. What was "params". Looks like it was something but didn't match payment_method
.
defp plural_endpoint() do
"payment_methods"
end
defp plural_endpoint(%{payment_method: payment_method}) do
plural_endpoint() <> "/" <> get_id!(payment_method)
end
Looks like your payment_method
argument to attach is missing. Lmk if that isn't the case!
The
Stripe.PaymentMethod.attach/2
andStripe.PaymentMethod.detach/2
seem to be incorrectly creating their endpoints. Whenever I attempt to attach aPayment Method
to aCustomer
I get the following error:Notice the part where it says
"Unrecognized request URL (POST: /v1/payment_methods//attach)
. The//attach
is wrong.They run fine if I remove the prepended
/
from the/attach
and/detach
strings and recompile the following code:I'm using the latest 2.12.1 version. It'd be awesome if someone could double-check this. I'd be happy to create the PR if needed.