Class: IronBank::PaymentRun

Inherits:
Object
  • Object
show all
Defined in:
lib/iron_bank/payment_run.rb

Overview

Constant Summary collapse

ENDPOINT =
"/v1/payment-runs"

Class Method Summary collapse

Class Method Details

.create(params) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/iron_bank/payment_run.rb', line 10

def self.create(params)
  payload = IronBank::Object.new(params).deep_camelize(type: :lower)
  body    = IronBank.client.connection.post(ENDPOINT, payload).body
  success = body.fetch("success", false)

  raise ::IronBank::UnprocessableEntityError, body unless success

  IronBank::Object.new(body).deep_underscore
end