I've also tried passing 'pm_card_visa' as the payment_id in test mode with the same result.
Steps to recreate
Capybara feature test with JS
stripe.createPaymentMethod client side
Stripe::PaymentMethod.attach with the result.paymentMethod.id returned from step 2
Result[StripeMock req]::attach_payment_method post /v1/payment_methods/pm_1HfEKQIz6J50NfGiUsRw7pAi/attach {:customer=>"test_cus_1"} *** Stripe::InvalidRequestError Exception: No such payment_method: pm_1HfEKQIz6J50NfGiUsRw7pAi
3. Stripe::PaymentMethod.attach with the result.paymentMethod.id returned from step 2Stripe::PaymentMethod.attach(payment_id, { customer: user.stripe_id })
Notes
Steps to recreate
stripe.createPaymentMethod
client sideStripe::PaymentMethod.attach
with theresult.paymentMethod.id
returned from step 2Result
[StripeMock req]::attach_payment_method post /v1/payment_methods/pm_1HfEKQIz6J50NfGiUsRw7pAi/attach {:customer=>"test_cus_1"} *** Stripe::InvalidRequestError Exception: No such payment_method: pm_1HfEKQIz6J50NfGiUsRw7pAi
1. Capybara feature test with JS true
2.
stripe.createPaymentMethod
client sidestripe.createPaymentMethod({ type: 'card', card: cardElement, })
3.
Stripe::PaymentMethod.attach
with theresult.paymentMethod.id
returned from step 2Stripe::PaymentMethod.attach(payment_id, { customer: user.stripe_id })