diff --git a/app/services/checkout/form_data_adapter.rb b/app/services/checkout/form_data_adapter.rb index 273a978a55..1333ed5dbd 100644 --- a/app/services/checkout/form_data_adapter.rb +++ b/app/services/checkout/form_data_adapter.rb @@ -33,6 +33,11 @@ module Checkout @params[:order][:payments_attributes].first[:source_attributes] = payment_source_params end + # Ensures cc_type is always passed to the model by inferring the type when + # the frontend didn't provide it. This fixes Pin Payments specifically + # although it might be useful for future payment gateways. + # + # More details: app/assets/javascripts/darkswarm/services/checkout.js.coffee#L70-L98 def fill_in_card_type return unless payment_source_attributes