Module: ZaiPayment

Defined in:
lib/zai_payment.rb,
lib/zai_payment/client.rb,
lib/zai_payment/config.rb,
lib/zai_payment/errors.rb,
lib/zai_payment/version.rb,
lib/zai_payment/response.rb,
lib/zai_payment/resources/item.rb,
lib/zai_payment/resources/user.rb,
lib/zai_payment/auth/token_store.rb,
lib/zai_payment/resources/pay_id.rb,
lib/zai_payment/resources/webhook.rb,
lib/zai_payment/auth/token_provider.rb,
lib/zai_payment/resources/token_auth.rb,
lib/zai_payment/resources/bank_account.rb,
lib/zai_payment/resources/bpay_account.rb,
lib/zai_payment/resources/wallet_account.rb,
lib/zai_payment/resources/virtual_account.rb,
lib/zai_payment/resources/batch_transaction.rb,
lib/zai_payment/auth/token_stores/memory_store.rb

Defined Under Namespace

Modules: Auth, Errors, Resources Classes: Client, Config, Response

Constant Summary collapse

VERSION =
'2.9.0'

Class Method Summary collapse

Class Method Details

.authObject

Singleton auth token provider (uses default MemoryStore under the hood)



35
36
37
# File 'lib/zai_payment.rb', line 35

def auth
  @auth ||= ZaiPayment::Auth::TokenProvider.new(config: config)
end

.bank_accountsZaiPayment::Resources::BankAccount



68
69
70
# File 'lib/zai_payment.rb', line 68

def bank_accounts
  @bank_accounts ||= Resources::BankAccount.new(client: Client.new(base_endpoint: :core_base))
end

.batch_transactionsZaiPayment::Resources::BatchTransaction



78
79
80
# File 'lib/zai_payment.rb', line 78

def batch_transactions
  @batch_transactions ||= Resources::BatchTransaction.new(client: Client.new(base_endpoint: :core_base))
end

.bpay_accountsZaiPayment::Resources::BpayAccount



73
74
75
# File 'lib/zai_payment.rb', line 73

def bpay_accounts
  @bpay_accounts ||= Resources::BpayAccount.new(client: Client.new(base_endpoint: :core_base))
end

.clear_token!Object



42
# File 'lib/zai_payment.rb', line 42

def clear_token!     = auth.clear_token

.configObject



26
27
28
# File 'lib/zai_payment.rb', line 26

def config
  @config ||= Config.new
end

.configure {|config| ... } ⇒ Object

Yields:



30
31
32
# File 'lib/zai_payment.rb', line 30

def configure
  yield config
end

.itemsZaiPayment::Resources::Item



58
59
60
# File 'lib/zai_payment.rb', line 58

def items
  @items ||= Resources::Item.new(client: Client.new(base_endpoint: :core_base))
end

.pay_idsZaiPayment::Resources::PayId



93
94
95
# File 'lib/zai_payment.rb', line 93

def pay_ids
  @pay_ids ||= Resources::PayId.new
end

.refresh_token!Object



41
# File 'lib/zai_payment.rb', line 41

def refresh_token!   = auth.refresh_token

.tokenObject

--- Convenience one-liners ---



40
# File 'lib/zai_payment.rb', line 40

def token            = auth.bearer_token

.token_authsZaiPayment::Resources::TokenAuth



63
64
65
# File 'lib/zai_payment.rb', line 63

def token_auths
  @token_auths ||= Resources::TokenAuth.new(client: Client.new(base_endpoint: :core_base))
end

.token_expiryObject



43
# File 'lib/zai_payment.rb', line 43

def token_expiry     = auth.token_expiry

.token_typeObject



44
# File 'lib/zai_payment.rb', line 44

def token_type       = auth.token_type

.usersZaiPayment::Resources::User



53
54
55
# File 'lib/zai_payment.rb', line 53

def users
  @users ||= Resources::User.new(client: Client.new(base_endpoint: :core_base))
end

.virtual_accountsZaiPayment::Resources::VirtualAccount



88
89
90
# File 'lib/zai_payment.rb', line 88

def virtual_accounts
  @virtual_accounts ||= Resources::VirtualAccount.new
end

.wallet_accountsZaiPayment::Resources::WalletAccount



83
84
85
# File 'lib/zai_payment.rb', line 83

def wallet_accounts
  @wallet_accounts ||= Resources::WalletAccount.new(client: Client.new(base_endpoint: :core_base))
end

.webhooksZaiPayment::Resources::Webhook

--- Resource accessors ---



48
49
50
# File 'lib/zai_payment.rb', line 48

def webhooks
  @webhooks ||= Resources::Webhook.new(client: Client.new(base_endpoint: :va_base))
end