Sha256: bb854bf73491d6a521354a58bb1120576746b4da46e91bba9bd892f7d65702ff

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

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

    def release(escrow_id)
      Resource::Escrow.new client.post("/v2/escrows/#{escrow_id}/release", nil)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moip2-1.3.1 lib/moip2/payment_api.rb