Class: PaygatePk::Providers::PayFast::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/paygate_pk/providers/pay_fast/client.rb

Overview

HTTP client for PayFast API

Instance Method Summary collapse

Constructor Details

#initialize(config: PaygatePk.config.pay_fast) ⇒ Client

Returns a new instance of Client.



11
12
13
# File 'lib/paygate_pk/providers/pay_fast/client.rb', line 11

def initialize(config: PaygatePk.config.pay_fast)
  @config = config
end

Instance Method Details

#create_checkout(**params) ⇒ Object



23
24
25
# File 'lib/paygate_pk/providers/pay_fast/client.rb', line 23

def create_checkout(**params)
  Checkout.new(config: @config).create!(**params)
end

#get_access_token(**params) ⇒ Object



15
16
17
# File 'lib/paygate_pk/providers/pay_fast/client.rb', line 15

def get_access_token(**params)
  Auth.new(config: @config).get_access_token(**params)
end

#get_bearer_token(**params) ⇒ Object



27
28
29
# File 'lib/paygate_pk/providers/pay_fast/client.rb', line 27

def get_bearer_token(**params)
  Tokenization::Token.new(config: @config).get(**params)
end

#instruments(**params) ⇒ Object



31
32
33
# File 'lib/paygate_pk/providers/pay_fast/client.rb', line 31

def instruments(**params)
  Tokenization::Instrument.new(config: @config).list(**params)
end

#verify_ipn!(params) ⇒ Object



19
20
21
# File 'lib/paygate_pk/providers/pay_fast/client.rb', line 19

def verify_ipn!(params)
  Webhook.new.verify!(params)
end