Class: SynapsePayments::Subscriptions

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse_payments/subscriptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Subscriptions

Returns a new instance of Subscriptions.



4
5
6
# File 'lib/synapse_payments/subscriptions.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#allObject



8
9
10
# File 'lib/synapse_payments/subscriptions.rb', line 8

def all
  @client.get(path: '/subscriptions')
end

#create(url:, scope:) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/synapse_payments/subscriptions.rb', line 12

def create(url:, scope:)
  data = {
    url: url,
    scope: scope
  }

  @client.post(path: "/subscriptions", json: data)
end

#find(id) ⇒ Object



21
22
23
# File 'lib/synapse_payments/subscriptions.rb', line 21

def find(id)
  @client.get(path: "/subscriptions/#{id}")
end

#update(id, data) ⇒ Object



25
26
27
# File 'lib/synapse_payments/subscriptions.rb', line 25

def update(id, data)
  @client.patch(path: "/subscriptions/#{id}", json: data)
end