Class: Inttegro::Resources::PurchaseIntents

Inherits:
Object
  • Object
show all
Defined in:
lib/inttegro/resources/purchase_intents.rb

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ PurchaseIntents

Returns a new instance of PurchaseIntents.



7
8
9
# File 'lib/inttegro/resources/purchase_intents.rb', line 7

def initialize(http)
  @http = T.let(http, Inttegro::HTTPClient)
end

Instance Method Details

#cancel(id:) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/inttegro/resources/purchase_intents.rb', line 19

def cancel(id:)
  @http.post_resource(
    "/purchase_intents/cancel",
    Inttegro::PurchaseIntent, :purchase_intent,
    { id: id }
  )
end

#create(payload) ⇒ Object



11
12
13
# File 'lib/inttegro/resources/purchase_intents.rb', line 11

def create(payload)
  @http.post_resource("/purchase_intents/create", Inttegro::PurchaseIntent, :purchase_intent, payload)
end

#lookup(id:) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/inttegro/resources/purchase_intents.rb', line 27

def lookup(id:)
  @http.post_resource(
    "/purchase_intents/lookup",
    Inttegro::PurchaseIntent, :purchase_intent,
    { id: id }
  )
end

#page(payload = {}) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/inttegro/resources/purchase_intents.rb', line 35

def page(payload = {})
  @http.post_resource(
    "/purchase_intents/page",
    Inttegro::PurchaseIntentPage, :page,
    payload || {}
  )
end

#update(payload) ⇒ Object



15
16
17
# File 'lib/inttegro/resources/purchase_intents.rb', line 15

def update(payload)
  @http.post_resource("/purchase_intents/update", Inttegro::PurchaseIntent, :purchase_intent, payload)
end