Sha256: f6cae04d27fb2023b66ff35104f9b546f8be9b0e1fedd800ff1cb3eebdb327d7

Contents?: true

Size: 562 Bytes

Versions: 30

Compression:

Stored size: 562 Bytes

Contents

# frozen_string_literal: true

module IronBank
  # Create payment run
  # https://www.zuora.com/developer/api-reference/#operation/POST_PaymentRun
  #
  class PaymentRun
    ENDPOINT = "/v1/payment-runs"

    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
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
iron_bank-5.4.1 lib/iron_bank/payment_run.rb
iron_bank-5.4.0 lib/iron_bank/payment_run.rb
iron_bank-5.3.2 lib/iron_bank/payment_run.rb
iron_bank-5.3.0 lib/iron_bank/payment_run.rb
iron_bank-5.2.6 lib/iron_bank/payment_run.rb
iron_bank-5.2.4 lib/iron_bank/payment_run.rb
iron_bank-5.2.3 lib/iron_bank/payment_run.rb
iron_bank-5.2.0 lib/iron_bank/payment_run.rb
iron_bank-5.1.1 lib/iron_bank/payment_run.rb
iron_bank-5.1.0 lib/iron_bank/payment_run.rb
iron_bank-4.4.3 lib/iron_bank/payment_run.rb
iron_bank-5.0.1 lib/iron_bank/payment_run.rb
iron_bank-5.0.0 lib/iron_bank/payment_run.rb
iron_bank-4.4.1 lib/iron_bank/payment_run.rb
iron_bank-4.4.0 lib/iron_bank/payment_run.rb
iron_bank-4.3.1 lib/iron_bank/payment_run.rb
iron_bank-4.3.0 lib/iron_bank/payment_run.rb
iron_bank-4.2.0 lib/iron_bank/payment_run.rb
iron_bank-4.1.1 lib/iron_bank/payment_run.rb
iron_bank-4.1.0 lib/iron_bank/payment_run.rb