Module: PaymentComponent

Included in:
TessituraRest
Defined in:
lib/tessitura_rest/payment_gateway/payment_component.rb

Instance Method Summary collapse

Instance Method Details

#fetch_payment_component(amount, card_brands, constituent = nil, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/tessitura_rest/payment_gateway/payment_component.rb', line 2

def fetch_payment_component(amount, card_brands, constituent = nil, options = {})
  card_brands ||= ['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