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