Class: Frontgo::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, Credit, Customer, HostedCheckout, Order, Refund, Reservation, Subscription, Terminal
Defined in:
lib/frontgo.rb

Instance Method Summary collapse

Methods included from HostedCheckout

#create_hosted_checkout

Methods included from Credit

#credit_check_corporate, #credit_check_private, #get_credit_check_list

Methods included from Terminal

#cancel_refund_request, #cancel_terminal_order, #create_terminal_order, #get_payment_status, #get_refund_status, #get_terminal_lists, #refund_terminal_order, #resend_terminal_order

Methods included from Refund

#request_refund_approval

Methods included from Customer

#get_customer_details_by_uuid, #update_corporate_customer, #update_private_customer

Methods included from Subscription

#cancel_subscription, #create_session_for_subscription_payment, #create_subscription, #get_failed_payment_details, #get_failed_payment_list, #get_subscription_details_by_uuid, #get_subscription_list, #refund_subscription_cycle, #resend_subscription

Methods included from Reservation

#cancel_reservation, #capture_reservation, #charge_reservation, #complete_reservation, #create_session_for_reservation, #get_reservation_details_by_uuid, #get_reservation_history_by_time_frame, #refund_reservation, #resend_reservation, #submit_reservation

Methods included from Order

#cancel_order, #create_session_for_invoice_order, #create_session_for_one_time_payment_link, #get_all_order_status, #get_invoice_number_by_uuid, #get_order_details_by_uuid, #get_order_status_by_uuid, #refund_order, #resend_payment_link, #send_e_faktura, #send_ehf_invoice, #send_invoice, #send_payment_link

Methods included from Connection

#delete, #get, #post, #put, #url_prefix

Constructor Details

#initialize(key:, demo: false) ⇒ Client

Initializes the client.

Parameters:

  • key (String)

    Bearer key

  • demo (Boolean) (defaults to: false)

    Optionally target the demo environment



36
37
38
39
40
41
42
43
# File 'lib/frontgo.rb', line 36

def initialize(key:, demo: false)
  @demo = demo || false
  @connection = Faraday.new(base_url) do |conn|
    conn.headers["Authorization"] = "Bearer #{key}"
    conn.request :json
    conn.response :json
  end
end