Class: Pin::API::Client

Inherits:
Object
  • Object
show all
Includes:
Charges, Customers, Refunds, Tokens
Defined in:
lib/pin/api/client.rb

Constant Summary collapse

BASE_URL =
"https://#{Pin.config.endpoint}/1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Tokens

#create_token

Methods included from Refunds

#create_refund, #refunds

Methods included from Charges

#capture_charge, #charge, #charge_search, #charges, #create_charge

Methods included from Customers

#create_customer, #customer, #customer_charges, #customers, #update_customer

Constructor Details

#initializeClient

Returns a new instance of Client.



24
25
26
27
28
29
# File 'lib/pin/api/client.rb', line 24

def initialize
  @url = URI.parse(BASE_URL)
  @http = Net::HTTP.new(@url.host, @url.port)
  @http.use_ssl = true
  @http.verify_mode = OpenSSL::SSL::VERIFY_PEER
end

Instance Attribute Details

#httpObject

Returns the value of attribute http.



15
16
17
# File 'lib/pin/api/client.rb', line 15

def http
  @http
end