Sha256: 29a9bd3f965c94d6d80f56d50356468fb4e6976e2b9b992b885052b144e8129b

Contents?: true

Size: 1.54 KB

Versions: 7

Compression:

Stored size: 1.54 KB

Contents

module Moka
  class Endpoint
    BASE_URL        = 'https://service.moka.com'
    TEST_BASE_URL   = 'https://service.testmoka.com'

    ENDPOINTS       = {
      # Payment Options
      direct_payment: '/PaymentDealer/DoDirectPayment',
      direct_payment_three_d: '/PaymentDealer/DoDirectPaymentThreeD',
      capture: '/PaymentDealer/DoCapture',
      approve_pool_payment: '/PaymentDealer/DoApprovePoolPayment',
      void: '/PaymentDealer/DoVoid',
      refund: '/PaymentDealer/DoCreateRefundRequest',
      get_payment_list: '/PaymentDealer/GetPaymentList',
      get_transaction_list: '/PaymentDealer/GetPaymentTrxList',
      get_payment_detail_list: '/PaymentDealer/GetDealerPaymentTrxDetailList',

      # Customer Options
      add_customer: '/DealerCustomer/AddCustomer',
      update_customer: '/DealerCustomer/UpdateCustomer',
      get_customer: '/DealerCustomer/GetCustomer',
      remove_customer: '/DealerCustomer/RemoveCustomer',
      add_customer_with_card: '/DealerCustomer/AddCustomerWithCard',

      # Card Options
      add_card: '/DealerCustomer/AddCard',
      update_card: '/DealerCustomer/UpdateCard',
      get_card: '/DealerCustomer/GetCard',
      get_card_list: '/DealerCustomer/GetCardList',
      remove_card: '/DealerCustomer/RemoveCard'
    }

    ENDPOINTS.each_key do |attribute|
      attr_accessor attribute
    end

    def initialize
      base_url = Moka.configuration.test? ? TEST_BASE_URL : BASE_URL
      ENDPOINTS.each do |attribute, value|
        send("#{attribute}=".to_sym, "#{base_url}#{value}")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
bf-mokapay-1.0.0 lib/moka/endpoint.rb
mokapay-1.0.0 lib/moka/endpoint.rb
mokapay-0.1.4 lib/moka/endpoint.rb
mokapay-0.1.3 lib/moka/endpoint.rb
mokapay-0.1.2 lib/moka/endpoint.rb
mokapay-0.1.1 lib/moka/endpoint.rb
mokapay-0.1.0 lib/moka/endpoint.rb