Class: JuspayCheckout::Wallet

Inherits:
ExpressCheckout show all
Defined in:
lib/juspay_checkout/wallet.rb

Class Method Summary collapse

Methods inherited from ExpressCheckout

credential_config, request

Class Method Details

.authenticate(wallet_id) ⇒ Object

DOC - www.juspay.in/docs/api/ec/?shell#authenticate curl -X POST api.juspay.in/wallets/$wallet_id \ -u your_api_key: \ -d “command=authenticate”



49
50
51
# File 'lib/juspay_checkout/wallet.rb', line 49

def authenticate(wallet_id)
	JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: "authenticate"})
end

.create(customer_id, wallet) ⇒ Object

DOC - www.juspay.in/docs/api/ec/?shell#create curl -X POST api.juspay.in/customers/$customer_id/wallets -u your_api_key: -d “gateway=MOBIKWIK” -d “command=authenticate”



24
25
26
# File 'lib/juspay_checkout/wallet.rb', line 24

def create(customer_id, wallet)
	JuspayCheckout::ExpressCheckout.request("/customers/#{customer_id}/wallets", 'post', {command: "authenticate", gateway: wallet})
end

DOC - www.juspay.in/docs/api/ec/?shell#delink curl -X POST api.juspay.in/wallets/$wallet_id -u your_api_key: -d “command=delink”



41
42
43
# File 'lib/juspay_checkout/wallet.rb', line 41

def delink(wallet_id)
	JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: 'delink'})
end

.get_details(wallet_id) ⇒ Object



15
16
17
# File 'lib/juspay_checkout/wallet.rb', line 15

def get_details(wallet_id)
	JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'get')
end

.get_list(customer_id) ⇒ Object



8
9
10
# File 'lib/juspay_checkout/wallet.rb', line 8

def get_list(customer_id)
	JuspayCheckout::ExpressCheckout.request("/customers/#{customer_id}/wallets", 'get')
end

DOC - www.juspay.in/docs/api/ec/?shell#link curl -X POST api.juspay.in/wallets/$wallet_id -u your_api_key: -d “command=link” -d “otp=345678”



33
34
35
# File 'lib/juspay_checkout/wallet.rb', line 33

def link(wallet_id, otp)
	JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: 'link', otp: otp})
end

.refresh(wallet_id) ⇒ Object

DOC - www.juspay.in/docs/api/ec/?shell#refresh curl -X POST api.juspay.in/wallets/$wallet_id -u your_api_key: -d “command=refresh”



57
58
59
# File 'lib/juspay_checkout/wallet.rb', line 57

def refresh(wallet_id)
	JuspayCheckout::ExpressCheckout.request("/wallets/#{wallet_id}", 'post', {command: 'refresh'})
end