class

Omise::Client

Inherits Reference < Object

Constructors

new(public_key : String, secret_key : String, api_base : String = "https://api.omise.co", transport : Transport = HTTPTransport.new, allow_insecure_api_base : Bool = false)
Source

Instance methods

add_customer_card(*, customer_id : String, token : String) : Customer

Adds a newly tokenized card to an existing customer. Omise determines the resulting default card according to the customer API's normal behavior.

Source
api_base
Source
create_card_charge(*, token : String, amount : Int64, currency : String = "THB", description : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, return_uri : String | Nil = nil) : Charge

Creates a card charge from a single-use token produced in the browser by Omise.js. Raw card details must never be sent to this backend client.

Source
create_customer(*, token : String, email : String | Nil = nil, description : String | Nil = nil, metadata : Hash(String, String) | Nil = nil) : Customer

Creates an Omise customer and converts an unused browser token into a reusable card. Raw card details must never reach this client.

Source
create_customer_card_charge(*, customer_id : String, amount : Int64, currency : String = "THB", card_id : String | Nil = nil, description : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, return_uri : String | Nil = nil, transaction_indicator : String = "CIT", recurring_reason : String | Nil = nil, first_charge : String | Nil = nil) : Charge

Charges a reusable card associated with an Omise customer. Use CIT for an attended first payment and MIT plus a recurring reason for renewals.

Source
create_promptpay_charge(amount : Int64, description : String | Nil = nil, metadata : Hash(String, String) | Nil = nil) : Charge
Source
create_recurring_card_charge(*, customer_id : String, amount : Int64, currency : String = "THB", card_id : String | Nil = nil, description : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, first_charge : String | Nil = nil, recurring_reason : String = "standing_order") : Charge
Source
create_truemoney_jumpapp_charge(*, amount : Int64, return_uri : String, description : String | Nil = nil, metadata : Hash(String, String) | Nil = nil) : Charge

Creates a Thailand TrueMoney Wallet charge using Omise's JumpApp flow. The customer must be redirected to the validated authorization URI.

Source
inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
retrieve_charge(id : String) : Charge
Source
retrieve_customer(id : String) : Customer
Source