class GoPay::Gateway
Public Class Methods
new(config)
click to toggle source
# File lib/gopay/gateway.rb, line 3 def initialize(config) @client = Client.new(config) @goid = config[:goid] end
Public Instance Methods
create(payment_data)
click to toggle source
# File lib/gopay/gateway.rb, line 8 def create(payment_data) target = { target: { type: "ACCOUNT", goid: @goid } } @client.request :post, "/api/payments/payment", body_parameters: payment_data.merge(target) end
refund(id, amount)
click to toggle source
# File lib/gopay/gateway.rb, line 17 def refund(id, amount) @client.request :post, "/api/payments/payment/#{id}/refund", body_parameters: { amount: amount } end
retrieve(id)
click to toggle source
# File lib/gopay/gateway.rb, line 13 def retrieve(id) @client.request :get, "/api/payments/payment/#{id}" end
void_recurrence(id)
click to toggle source
# File lib/gopay/gateway.rb, line 21 def void_recurrence(id) @client.request :post, "/api/payments/payment/#{id}/void-recurrence" end