Class: Shift4::Charges

Inherits:
Object
  • Object
show all
Extended by:
TransactionBase
Defined in:
lib/shift4/charges.rb

Class Method Summary collapse

Methods included from TransactionBase

communicator, communicator=

Class Method Details

.capture(charge_id, config = Configuration) ⇒ Object



23
24
25
# File 'lib/shift4/charges.rb', line 23

def self.capture(charge_id, config = Configuration)
  communicator.post("#{config.api_url}/charges/#{charge_id}/capture", config: config)
end

.create(params, config = Configuration) ⇒ Object



7
8
9
# File 'lib/shift4/charges.rb', line 7

def self.create(params, config = Configuration)
  communicator.post("#{config.api_url}/charges", json: params, config: config)
end

.list(params = nil, config = Configuration) ⇒ Object



19
20
21
# File 'lib/shift4/charges.rb', line 19

def self.list(params = nil, config = Configuration)
  communicator.get("#{config.api_url}/charges", query: params, config: config)
end

.refund(charge_id, params = nil, config = Configuration) ⇒ Object



27
28
29
# File 'lib/shift4/charges.rb', line 27

def self.refund(charge_id, params = nil, config = Configuration)
  communicator.post("#{config.api_url}/charges/#{charge_id}/refund", json: params, config: config)
end

.retrieve(charge_id, config = Configuration) ⇒ Object



11
12
13
# File 'lib/shift4/charges.rb', line 11

def self.retrieve(charge_id, config = Configuration)
  communicator.get("#{config.api_url}/charges/#{charge_id}", config: config)
end

.update(charge_id, params, config = Configuration) ⇒ Object



15
16
17
# File 'lib/shift4/charges.rb', line 15

def self.update(charge_id, params, config = Configuration)
  communicator.post("#{config.api_url}/charges/#{charge_id}", json: params, config: config)
end