Class: JuspayCheckout::Customer

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

Class Method Summary collapse

Methods inherited from ExpressCheckout

credential_config, request

Class Method Details

.create(params = {}) ⇒ Object

DOC - www.juspay.in/docs/api/ec/?shell#create-customer Example request curl -X POST api.juspay.in/customers -u your_api_key: -d “[email protected]” -d “mobile_number=9000000001” -d “[email protected]” -d “first_name=Sandip” -d “last_name=Patil” -d “mobile_country_code=91”



22
23
24
# File 'lib/juspay_checkout/customer.rb', line 22

def create(params = {})
	JuspayCheckout::ExpressCheckout.request('/customers', 'post', params)
end

.get_details(customer_id) ⇒ Object



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

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

.update(params = {}) ⇒ Object

DOC - www.juspay.in/docs/api/ec/?shell#update-customer Example request curl -X POST api.juspay.in/customers/cst_om2l6ctlptxwxuzj -u your_api_key: -d “mobile_number=9000000002”

-d “[email protected]” -d “first_name=Sandip” -d “last_name=Patil” -d “mobile_country_code=91”



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

def update(params = {})
	JuspayCheckout::ExpressCheckout.request("/customers/#{params['customer_id']}", 'post', params.except(:customer_id))
end