class GoPay::Payment
Public Class Methods
create(payment_data)
click to toggle source
basic methods
# File lib/gopay/payment.rb, line 6 def self.create(payment_data) target = { target: { type: "ACCOUNT", goid: GoPay.goid } } GoPay.request :post, "/api/payments/payment", body_parameters: payment_data.merge(target) end
create_recurrence(original_payment_id, recurring_payment_data)
click to toggle source
# File lib/gopay/payment.rb, line 23 def self.create_recurrence(original_payment_id, recurring_payment_data) GoPay.request :post, "/api/payments/payment/#{original_payment_id}/create-recurrence", body_parameters: recurring_payment_data end
payment_instruments(currency)
click to toggle source
other methods
# File lib/gopay/payment.rb, line 29 def self.payment_instruments(currency) goid = GoPay.goid GoPay.request :get, "/api/eshops/eshop/#{goid}/payment-instruments/#{currency}" end
refund(id, amount)
click to toggle source
# File lib/gopay/payment.rb, line 19 def self.refund(id, amount) GoPay.request :post, "/api/payments/payment/#{id}/refund", body_parameters: { amount: amount } end
retrieve(id)
click to toggle source
# File lib/gopay/payment.rb, line 11 def self.retrieve(id) GoPay.request :get, "/api/payments/payment/#{id}" end
void_recurrence(id)
click to toggle source
# File lib/gopay/payment.rb, line 15 def self.void_recurrence(id) GoPay.request :post, "/api/payments/payment/#{id}/void-recurrence" end