Class: Etsy::PaymentTemplate

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/etsy/payment_template.rb

Class Method Summary collapse

Methods included from Model

included, #initialize, #result, #secret, #token

Class Method Details

.create(options = {}) ⇒ Object



10
11
12
13
# File 'lib/etsy/payment_template.rb', line 10

def self.create(options = {})
  options.merge!(:require_secure => true)
  post("/payments/templates", options)
end

.find(id, credentials = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/etsy/payment_template.rb', line 15

def self.find(id, credentials = {})
  options = {
    :access_token => credentials[:access_token],
    :access_secret => credentials[:access_secret],
    :require_secure => true
  }
  get("/payments/templates/#{id}", options)
end

.find_by_user(user, credentials = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/etsy/payment_template.rb', line 24

def self.find_by_user(user, credentials = {})
  options = {
    :access_token => credentials[:access_token],
    :access_secret => credentials[:access_secret],
    :require_secure => true
  }
  get("/users/#{user.id}/payments/templates", options)
end