Sha256: b73dabc138fb04c45eb70aac02967208b7d83c5e43cfc76d8a6c4b09227a20e0

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

module GoPay
  class Gateway
    def initialize(config)
      @client = Client.new(config)
      @goid = config[:goid]
    end

    def create(payment_data)
      target = { target: { type: "ACCOUNT", goid: @goid } }
      @client.request :post, "/api/payments/payment", body_parameters: payment_data.merge(target)
    end

    def retrieve(id)
      @client.request :get, "/api/payments/payment/#{id}"
    end

    def refund(id, amount)
      @client.request :post, "/api/payments/payment/#{id}/refund", body_parameters: { amount: amount }
    end

    def void_recurrence(id)
      @client.request :post, "/api/payments/payment/#{id}/void-recurrence"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gopay-ruby-0.4.1 lib/gopay/gateway.rb
gopay-ruby-0.4.0.alpha lib/gopay/gateway.rb