Class: PaymentGateway::Mundipagg::Customer
- Inherits:
-
Base
- Object
- Base
- PaymentGateway::Mundipagg::Customer
show all
- Defined in:
- lib/payment_gateway/mundipagg/customer.rb
Constant Summary
Constants inherited
from Base
Base::API_URL
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#any? ⇒ Boolean
21
22
23
|
# File 'lib/payment_gateway/mundipagg/customer.rb', line 21
def any?
list&.any?
end
|
#create(customer_data) ⇒ Object
25
26
27
28
|
# File 'lib/payment_gateway/mundipagg/customer.rb', line 25
def create(customer_data)
creation_url = "#{API_URL}/customers"
request(:post, creation_url, body: create_customer_body(customer_data))
end
|
#find(options) ⇒ Object
10
11
12
13
|
# File 'lib/payment_gateway/mundipagg/customer.rb', line 10
def find(options)
list_url = "#{API_URL}/customers"
request(:get, list_url, params: options)
end
|
#list ⇒ Object
15
16
17
18
19
|
# File 'lib/payment_gateway/mundipagg/customer.rb', line 15
def list
list_url = "#{API_URL}/customers"
response = request(:get, list_url)
response.parse['data']
end
|
#show(customer_id) ⇒ Object
5
6
7
8
|
# File 'lib/payment_gateway/mundipagg/customer.rb', line 5
def show(customer_id)
url = "#{API_URL}/customers/#{customer_id}"
request(:get, url)
end
|