Update stripe_stubs to handle stripeSCA

This commit is contained in:
Nihal Mohammed
2021-08-06 14:50:28 +05:30
committed by Nihal
parent fa9f6432c3
commit eb17c208f9

View File

@@ -28,11 +28,11 @@ module StripeStubs
end
# Attaches the payment method to the customer in the hub's stripe account
def stub_payment_method_attach_request
def stub_payment_method_attach_request(payment_method: "pm_123", customer: "cus_A123")
stub_request(:post,
"https://api.stripe.com/v1/payment_methods/pm_123/attach")
.with(body: { customer: "cus_A123" })
.to_return(hub_payment_method_response_mock({ pm_id: "pm_123" }))
"https://api.stripe.com/v1/payment_methods/#{payment_method}/attach")
.with(body: { customer: customer })
.to_return(hub_payment_method_response_mock({ pm_id: payment_method }))
end
def stub_retrieve_payment_method_request(payment_method_id = "pm_1234")