class OpenpayApi
Constants
- API_DEV
API Endpoints
- API_PROD
Public Class Methods
base_url(production)
click to toggle source
# File lib/openpay/openpay_api.rb, line 33 def OpenpayApi::base_url(production) if production API_PROD else API_DEV end end
new(merchant_id, private_key, production=false, timeout=90)
click to toggle source
by default testing environment is used
# File lib/openpay/openpay_api.rb, line 20 def initialize(merchant_id, private_key, production=false, timeout=90) @merchant_id=merchant_id @private_key=private_key @production=production @timeout=timeout end
Public Instance Methods
create(resource)
click to toggle source
# File lib/openpay/openpay_api.rb, line 27 def create(resource) klass=OpenPayResourceFactory::create(resource, @merchant_id, @private_key, @production, @timeout) klass.api_hook=self klass end
env()
click to toggle source
# File lib/openpay/openpay_api.rb, line 41 def env if @production :production else :test end end