lib/moip2/payment_api.rb in moip2-0.1.4 vs lib/moip2/payment_api.rb in moip2-1.0.0
- old
+ new
@@ -1,15 +1,25 @@
module Moip2
class PaymentApi
-
attr_reader :client
def initialize(client)
@client = client
end
def create(order_id, payment)
Resource::Payment.new client.post("/v2/orders/#{order_id}/payments", payment)
end
+ def show(payment_id)
+ Resource::Payment.new client.get("/v2/payments/#{payment_id}")
+ end
+
+ def capture(payment_id)
+ Resource::Payment.new client.post("/v2/payments/#{payment_id}/capture", nil)
+ end
+
+ def void(payment_id)
+ Resource::Payment.new client.post("/v2/payments/#{payment_id}/void", nil)
+ end
end
end