Sha256: d55765f2fb5a88fed910cd80ecc77f969a184a3d7f39965273b2645b1d6550a9

Contents?: true

Size: 1.95 KB

Versions: 1

Compression:

Stored size: 1.95 KB

Contents

module MidasClient
  module EndPoints

    def self.production?
      (ENV['RACK_ENV']  == 'production') || (ENV['RAILS_ENV'] == 'production') || ENV['PRODUCTION'] || ENV['production']
    end

    def self.get_env
      self.production? ? PRODUCTION : DEVELOPMENT
    end

    DEVELOPMENT ={
        url: 'https://sandbox.ansertecnologia.net',
        management_auth: 'Basic bWlkYXM6bXRmYndZQDE5Nzc='
    }

    PRODUCTION ={
        url: 'https://api.ansertecnologia.net',
        management_auth: 'Basic bWlkYXM6aWNzZFA/MTk5OQ=='
    }

    OPERATIONS = {
        context: '/midas-core/v2',
        store: '/creditcard',
        synchronous_transaction: '/transaction/creditcard',
        asynchronous_transaction: '/transaction/creditcard/dispatch',
        authorize: '/transaction/creditcard/authorize',
        confirm: '/transaction/creditcard/{transactionToken}/capture',
        cancel: '/transaction/creditcard/{transactionToken}/cancel',
        refund: '/transaction/creditcard/{transactionToken}/refund',
        query_by_transaction: '/transaction/{transactionToken}',
        callback: 'http://matricula.crossfitlendarios.com.br/callback'
    }

    SUBSCRIPTIONS = {
        context: '/midas-core/v2',
        by_token: '/subscription/{subscriptionToken}',
        invoices: '/subscription/{subscriptionToken}/invoices',
        invoice_transactions: '/invoice/{invoiceToken}/transactions',
        create: '/subscription/creditcard',
        cancel: '/subscription/{subscriptionToken}/cancel',
        update: '/subscription/{subscriptionToken}',
        update_invoice: '/invoice/{invoiceToken}',
        callback: 'https://matricula.crossfitlendarios.com.br/callback'
    }

    QUERIES = {
        context: '/midas-query/v2',
        by_period: '/transactions?startDate={startDate}&endDate={endDate}&status={status}',
    }

    MANAGEMENTS = {
        context: '/midas-managment/v2',
        create_pos: '/pointofsale',
        list_pos: '/pointofsale'
    }

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
midas_client-0.1.4 lib/midas_client/endpoints.rb