Class: PushPay::Merchant

Inherits:
Base
  • Object
show all
Defined in:
lib/pushpay/merchant.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PushPay::Base

Instance Method Details

#find(merchant_key) ⇒ Object

Get a specific merchant



6
7
8
# File 'lib/pushpay/merchant.rb', line 6

def find(merchant_key)
  client.get("/v1/merchant/#{merchant_key}")
end

#in_scope(**params) ⇒ Object

List merchants accessible to the current application



16
17
18
# File 'lib/pushpay/merchant.rb', line 16

def in_scope(**params)
  client.get("/v1/merchants/in-scope", params)
end

#near(latitude:, longitude:, country: nil, **params) ⇒ Object

Search for merchants near a location



21
22
23
24
25
26
# File 'lib/pushpay/merchant.rb', line 21

def near(latitude:, longitude:, country: nil, **params)
  query = { latitude: latitude, longitude: longitude }
  query[:country] = country if country
  query.merge!(params)
  client.get("/v1/merchants/near", query)
end

#search(**params) ⇒ Object

Search merchants by name or handle



11
12
13
# File 'lib/pushpay/merchant.rb', line 11

def search(**params)
  client.get("/v1/merchants", params)
end