module PaymentComponent def fetch_payment_component(amount, card_brands, constituent = nil, options = {}) card_brands ||= %w(amex, mc, discover, visa) parameters = { 'Amount': amount, 'ConstituentId': constituent, 'CardBrandsToInclude': card_brands, } options.merge!(basic_auth: @auth, headers: @headers) options.merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint('PaymentGateway/PaymentComponent'), options) end end