Class: Sink::Resources::Cards

Inherits:
Object
  • Object
show all
Defined in:
lib/sink/resources/cards.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Cards



7
8
9
# File 'lib/sink/resources/cards.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Sink::Models::Card

Create a new virtual or physical card. Parameters ‘pin`, `shippingAddress`, and

`product_id` only apply to physical cards.


83
84
85
86
87
88
89
90
91
92
# File 'lib/sink/resources/cards.rb', line 83

def create(params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#create_aliased(params = {}, opts = {}) ⇒ Sink::Models::Card

Create a new virtual or physical card. Parameters ‘pin`, `shippingAddress`, and

`product_id` only apply to physical cards.


266
267
268
269
270
271
272
273
274
275
# File 'lib/sink/resources/cards.rb', line 266

def create_aliased(params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#create_aliased_deprecated(params = {}, opts = {}) ⇒ Sink::Models::Card

Create a new virtual or physical card. Parameters ‘pin`, `shippingAddress`, and

`product_id` only apply to physical cards.


349
350
351
352
353
354
355
356
357
358
# File 'lib/sink/resources/cards.rb', line 349

def create_aliased_deprecated(params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#deprecated_all_but_go_diff_message(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config for all languages, but with a different method in go.


366
367
368
369
370
371
372
373
# File 'lib/sink/resources/cards.rb', line 366

def deprecated_all_but_go_diff_message(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method_all_but_go_diff_message",
    model: NilClass
  }
  @client.request(req, opts)
end

#deprecated_all_diff_message(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config for all languages, but with a different method in go.


381
382
383
384
385
386
387
388
# File 'lib/sink/resources/cards.rb', line 381

def deprecated_all_diff_message(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method_all_but_go_diff_message",
    model: NilClass
  }
  @client.request(req, opts)
end

#deprecated_method(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config.


396
397
398
399
400
401
402
403
# File 'lib/sink/resources/cards.rb', line 396

def deprecated_method(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method",
    model: NilClass
  }
  @client.request(req, opts)
end

#deprecated_only_go(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config for go only.


411
412
413
414
415
416
417
418
# File 'lib/sink/resources/cards.rb', line 411

def deprecated_only_go(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method_only_go",
    model: NilClass
  }
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Sink::Models::CardListResponse

List cards.



184
185
186
187
188
189
190
191
192
# File 'lib/sink/resources/cards.rb', line 184

def list(params = {}, opts = {})
  req = {
    method: :get,
    path: "/cards",
    query: params,
    model: Sink::Models::CardListResponse
  }
  @client.request(req, opts)
end

#list_not_paginated(card_token, opts = {}) ⇒ Sink::Models::Card

Get card configuration such as spend limit and state.



426
427
428
429
430
431
432
433
# File 'lib/sink/resources/cards.rb', line 426

def list_not_paginated(card_token, opts = {})
  req = {
    method: :get,
    path: "/cards/#{card_token}",
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#provision_foo(card_token, params = {}, opts = {}) ⇒ Sink::Models::CardProvisionFooResponse

Allow your cardholders to directly add payment cards to the device’s digital

wallet (e.g. Apple Pay) with one touch from your app.

This requires some additional setup and configuration. Please
[Contact Us](https://lithic.com/contact) or your Customer Success representative
for more information.


461
462
463
464
465
466
467
468
469
470
# File 'lib/sink/resources/cards.rb', line 461

def provision_foo(card_token, params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards/#{card_token}/provision",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::CardProvisionFooResponse
  }
  @client.request(req, opts)
end

#reissue(card_token, params = {}, opts = {}) ⇒ Sink::Models::Card

Initiate print and shipment of a duplicate card.

Only applies to cards of type `PHYSICAL` [beta].


496
497
498
499
500
501
502
503
504
505
# File 'lib/sink/resources/cards.rb', line 496

def reissue(card_token, params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards/#{card_token}/reissue",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#retrieve(card_token, opts = {}) ⇒ Sink::Models::Card

Get card configuration such as spend limit and state.



100
101
102
103
104
105
106
107
# File 'lib/sink/resources/cards.rb', line 100

def retrieve(card_token, opts = {})
  req = {
    method: :get,
    path: "/cards/#{card_token}",
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#update(card_token, params = {}, opts = {}) ⇒ Sink::Models::Card

Update the specified properties of the card. Unsupplied properties will remain

unchanged. `pin` parameter only applies to physical cards.

_Note: setting a card to a `CLOSED` state is a final action that cannot be
undone._


156
157
158
159
160
161
162
163
164
165
# File 'lib/sink/resources/cards.rb', line 156

def update(card_token, params = {}, opts = {})
  req = {
    method: :patch,
    path: "/cards/#{card_token}",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end