Class: Moip2::PaymentApi

Inherits:
Object
  • Object
show all
Defined in:
lib/moip2/payment_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ PaymentApi

Returns a new instance of PaymentApi.



6
7
8
# File 'lib/moip2/payment_api.rb', line 6

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/moip2/payment_api.rb', line 4

def client
  @client
end

Instance Method Details

#create(order_id, payment) ⇒ Object



10
11
12
# File 'lib/moip2/payment_api.rb', line 10

def create(order_id, payment)
  Resource::Payment.new client.post("/v2/orders/#{order_id}/payments", payment)
end