starkinfra 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/brcodepreview/brcodepreview.rb +12 -8
  3. data/lib/cardmethod/cardmethod.rb +1 -1
  4. data/lib/creditholmes/creditholmes.rb +160 -0
  5. data/lib/creditnote/creditnote.rb +19 -18
  6. data/lib/creditnote/invoice/discount.rb +1 -1
  7. data/lib/creditnote/invoice/invoice.rb +4 -3
  8. data/lib/creditnote/log.rb +16 -17
  9. data/lib/creditpreview/creditpreview.rb +2 -8
  10. data/lib/dynamicbrcode/dynamicbrcode.rb +3 -3
  11. data/lib/event/attempt.rb +1 -1
  12. data/lib/event/event.rb +1 -1
  13. data/lib/individualdocument/individualdocument.rb +165 -0
  14. data/lib/individualdocument/log.rb +125 -0
  15. data/lib/individualidentity/individualidentity.rb +193 -0
  16. data/lib/individualidentity/log.rb +124 -0
  17. data/lib/issuingcard/issuingcard.rb +11 -12
  18. data/lib/issuingcard/log.rb +19 -19
  19. data/lib/issuingdesign/issuingdesign.rb +138 -0
  20. data/lib/issuingembossingkit/issuingembossingkit.rb +121 -0
  21. data/lib/issuingembossingrequest/issuingembossingrequest.rb +210 -0
  22. data/lib/issuingembossingrequest/log.rb +128 -0
  23. data/lib/issuingholder/issuingholder.rb +8 -7
  24. data/lib/issuingholder/log.rb +17 -17
  25. data/lib/issuinginvoice/issuinginvoice.rb +6 -5
  26. data/lib/issuinginvoice/log.rb +16 -16
  27. data/lib/issuingproduct/issuingproduct.rb +2 -2
  28. data/lib/issuingpurchase/issuingpurchase.rb +15 -11
  29. data/lib/issuingpurchase/log.rb +15 -15
  30. data/lib/issuingrestock/issuingrestock.rb +162 -0
  31. data/lib/issuingrestock/log.rb +127 -0
  32. data/lib/issuingstock/issuingstock.rb +138 -0
  33. data/lib/issuingstock/log.rb +130 -0
  34. data/lib/issuingtransaction/issuingtransaction.rb +7 -6
  35. data/lib/issuingwithdrawal/issuingwithdrawal.rb +8 -11
  36. data/lib/pixchargeback/log.rb +12 -12
  37. data/lib/pixclaim/log.rb +13 -13
  38. data/lib/pixclaim/pixclaim.rb +4 -4
  39. data/lib/pixdomain/pixdomain.rb +1 -1
  40. data/lib/pixinfraction/log.rb +18 -18
  41. data/lib/pixinfraction/pixinfraction.rb +3 -3
  42. data/lib/pixkey/log.rb +18 -18
  43. data/lib/pixkey/pixkey.rb +4 -3
  44. data/lib/pixrequest/log.rb +22 -18
  45. data/lib/pixrequest/pixrequest.rb +3 -0
  46. data/lib/pixreversal/log.rb +1 -1
  47. data/lib/pixstatement/pixstatement.rb +1 -1
  48. data/lib/starkinfra.rb +13 -0
  49. data/lib/staticbrcode/staticbrcode.rb +8 -2
  50. data/lib/utils/bacenid.rb +1 -1
  51. data/lib/utils/request.rb +1 -1
  52. data/lib/webhook/webhook.rb +9 -9
  53. metadata +15 -2
@@ -0,0 +1,128 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative('IssuingEmbossingRequest')
4
+ require_relative('../utils/rest')
5
+ require_relative('../utils/checks')
6
+ require_relative('../utils/resource')
7
+
8
+ module StarkInfra
9
+ class IssuingEmbossingRequest
10
+ # # IssuingEmbossingRequest::Log object
11
+ #
12
+ # Every time an IssuingEmbossingRequest entity is updated, a corresponding IssuingEmbossingRequest::Log is generated for the entity. This log
13
+ # is never generated by the user, but it can be retrieved to check additional information on the IssuingEmbossingRequest.
14
+ #
15
+ # ## Attributes (return-only):
16
+ # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
17
+ # - request [IssuingEmbossingRequest]: IssuingEmbossingRequest entity to which the log refers to.
18
+ # - errors [list of string]: list of errors linked to this IssuingEmbossingRequest event.
19
+ # - type [string]: type of the IssuingEmbossingRequest event which triggered the log creation. ex: "created", "sending", "sent", "processing", "success", "failed"
20
+ # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
21
+ class Log < StarkInfra::Utils::Resource
22
+ attr_reader :id, :request,:errors,:type, :created
23
+ def initialize(id: nil, request: nil, errors: nil, type: nil, created: nil)
24
+ super(id)
25
+ @request = request
26
+ @type = type
27
+ @errors = errors
28
+ @created = StarkInfra::Utils::Checks.check_datetime(created)
29
+ end
30
+
31
+ # # Retrieve a specific IssuingEmbossingRequest::Log
32
+ #
33
+ # Receive a single IssuingEmbossingRequest::Log object previously created by the Stark Infra API by passing its id
34
+ #
35
+ # ## Parameters (required):
36
+ # - id [string]: object unique id. ex: '5656565656565656'
37
+ #
38
+ # ## Parameters (optional):
39
+ # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
40
+ #
41
+ # ## Return:
42
+ # - IssuingEmbossingRequest::Log object with updated attributes
43
+ def self.get(id, user: nil)
44
+ StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
45
+ end
46
+
47
+ # # Retrieve IssuingEmbossingRequest::Logs
48
+ #
49
+ # Receive a generator of IssuingEmbossingRequest::Log objects previously created in the Stark Infra API
50
+ #
51
+ # ## Parameters (optional):
52
+ # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
53
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
54
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
55
+ # - types [list of strings, default nil]: filter for log event types. ex: ["created", "sending", "sent", "processing", "success", "failed"]
56
+ # - request_ids [list of strings, default nil]: list of IssuingEmbossingRequest ids to filter logs. ex: ['5656565656565656', '4545454545454545']
57
+ # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
58
+ # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
59
+ #
60
+ # ## Return:
61
+ # - generator of IssuingEmbossingRequest::Log objects with updated attributes
62
+ def self.query(limit: nil, after: nil, before: nil, types: nil, request_ids: nil, ids: nil, user: nil)
63
+ after = StarkInfra::Utils::Checks.check_date(after)
64
+ before = StarkInfra::Utils::Checks.check_date(before)
65
+ StarkInfra::Utils::Rest.get_stream(
66
+ limit: limit,
67
+ after: after,
68
+ before: before,
69
+ types: types,
70
+ request_ids: request_ids,
71
+ ids: ids,
72
+ user: user,
73
+ **resource
74
+ )
75
+ end
76
+
77
+ # # Retrieve paged IssuingEmbossingRequest::Logs
78
+ #
79
+ # Receive a list of up to 100 IssuingEmbossingRequest::Log objects previously created in the Stark Infra API and the cursor to the next page.
80
+ # Use this function instead of query if you want to manually page your logs.
81
+ #
82
+ # ## Parameters (optional):
83
+ # - cursor [string, default nil]: cursor returned on the previous page function call
84
+ # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
85
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
86
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
87
+ # - types [list of strings, default nil]: filter for log event types. ex: ["created", "sending", "sent", "processing", "success", "failed"]
88
+ # - request_ids [list of strings, default nil]: list of IssuingEmbossingRequest ids to filter logs. ex: ['5656565656565656', '4545454545454545']
89
+ # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
90
+ # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
91
+ #
92
+ # ## Return:
93
+ # - list of IssuingEmbossingRequest::Log objects with updated attributes
94
+ # - Cursor to retrieve the next page of Log objects
95
+ def self.page(cursor: nil, limit: nil, after: nil, before: nil, types: nil, request_ids: nil, ids: nil, user: nil)
96
+ after = StarkInfra::Utils::Checks.check_date(after)
97
+ before = StarkInfra::Utils::Checks.check_date(before)
98
+ StarkInfra::Utils::Rest.get_page(
99
+ cursor: cursor,
100
+ limit: limit,
101
+ after: after,
102
+ before: before,
103
+ types: types,
104
+ request_ids: request_ids,
105
+ ids: ids,
106
+ user: user,
107
+ **resource
108
+ )
109
+ end
110
+
111
+ def self.resource
112
+ request_maker = StarkInfra::IssuingEmbossingRequest.resource[:resource_maker]
113
+ {
114
+ resource_name: 'IssuingEmbossingRequestLog',
115
+ resource_maker: proc { |json|
116
+ Log.new(
117
+ id: json['id'],
118
+ request: StarkInfra::Utils::API.from_api_json(request_maker, json['request']),
119
+ errors: json['errors'],
120
+ created: json['created'],
121
+ type: json['type']
122
+ )
123
+ }
124
+ }
125
+ end
126
+ end
127
+ end
128
+ end
@@ -83,12 +83,12 @@ module StarkInfra
83
83
  #
84
84
  # ## Parameters (optional):
85
85
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
86
- # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
87
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
88
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
86
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
87
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
89
88
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['active', 'blocked', 'canceled']
90
89
  # - tags [list of strings, default nil]: tags to filter retrieved objects. ex: ['tony', 'stark']
91
90
  # - expand [string, default nil]: fields to expand information. ex: ['rules']
91
+ # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
92
92
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
93
93
  #
94
94
  # ## Return:
@@ -111,17 +111,18 @@ module StarkInfra
111
111
 
112
112
  # # Retrieve paged IssuingHolders
113
113
  #
114
- # Receive a list of IssuingHolder objects previously created in the Stark Infra API and the cursor to the next page.
114
+ # Receive a list of up to 100 IssuingHolders objects previously created in the Stark Infra API and the cursor to the next page.
115
+ # Use this function instead of query if you want to manually page your logs.
115
116
  #
116
117
  # ## Parameters (optional):
117
118
  # - cursor [string, default nil]: cursor returned on the previous page function call.
118
119
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
119
- # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
120
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
121
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
120
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
121
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
122
122
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['active', 'blocked', 'canceled']
123
123
  # - tags [list of strings, default nil]: tags to filter retrieved objects. ex: ['tony', 'stark']
124
124
  # - expand [string, default nil]: fields to expand information. ex: ['rules']
125
+ # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
125
126
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
126
127
  #
127
128
  # ## Return:
@@ -9,10 +9,10 @@ module StarkInfra
9
9
  class IssuingHolder
10
10
  # # IssuingHolder::Log object
11
11
  #
12
- # Every time an IssuingHolder entity is updated, a corresponding IssuingHolder.Log is generated for the entity. This
12
+ # Every time an IssuingHolder entity is updated, a corresponding IssuingHolder::Log is generated for the entity. This
13
13
  # log is never generated by the user, but it can be retrieved to check additional information on the IssuingHolder.
14
14
  #
15
- # ## Attributes:
15
+ # ## Attributes (return-only):
16
16
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
17
17
  # - holder [IssuingHolder]: IssuingHolder entity to which the log refers to.
18
18
  # - type [string]: type of the IssuingHolder event which triggered the log creation. ex: 'blocked', 'canceled', 'created', 'unblocked', 'updated'
@@ -26,9 +26,9 @@ module StarkInfra
26
26
  @created = StarkInfra::Utils::Checks.check_datetime(created)
27
27
  end
28
28
 
29
- # # Retrieve a specific Log
29
+ # # Retrieve a specific IssuingHolder::Log
30
30
  #
31
- # Receive a single Log object previously created by the Stark Infra API by passing its id
31
+ # Receive a single IssuingHolder::Log object previously created by the Stark Infra API by passing its id
32
32
  #
33
33
  # ## Parameters (required):
34
34
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -37,26 +37,26 @@ module StarkInfra
37
37
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
38
38
  #
39
39
  # ## Return:
40
- # - Log object with updated attributes
40
+ # - IssuingHolder::Log object with updated attributes
41
41
  def self.get(id, user: nil)
42
42
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
43
43
  end
44
44
 
45
- # # Retrieve Logs
45
+ # # Retrieve IssuingHolder::Logs
46
46
  #
47
- # Receive a generator of Log objects previously created in the Stark Infra API
47
+ # Receive a generator of IssuingHolder::Log objects previously created in the Stark Infra API
48
48
  #
49
49
  # ## Parameters (optional):
50
50
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
51
- # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
52
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
53
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
51
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
52
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
54
53
  # - types [list of strings, default nil]: filter for log event types. ex: ['created', 'blocked']
55
54
  # - holder_ids [list of strings, default nil]: list of IssuingHolder ids to filter logs. ex: ['5656565656565656', '4545454545454545']
55
+ # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
56
56
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
57
57
  #
58
58
  # ## Return:
59
- # - generator of Log objects with updated attributes
59
+ # - generator of IssuingHolder::Log objects with updated attributes
60
60
  def self.query(limit: nil, after: nil, before: nil, types: nil, holder_ids: nil, user: nil)
61
61
  after = StarkInfra::Utils::Checks.check_date(after)
62
62
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -71,23 +71,23 @@ module StarkInfra
71
71
  )
72
72
  end
73
73
 
74
- # # Retrieve paged Logs
74
+ # # Retrieve paged IssuingHolder::Logs
75
75
  #
76
- # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
76
+ # Receive a list of up to 100 IssuingHolder::Log objects previously created in the Stark Infra API and the cursor to the next page.
77
77
  # Use this function instead of query if you want to manually page your holders.
78
78
  #
79
79
  # ## Parameters (optional):
80
80
  # - cursor [string, default nil]: cursor returned on the previous page function call
81
81
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
82
- # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
83
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
84
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
82
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
83
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
85
84
  # - types [list of strings, default nil]: filter for log event types. ex: ['created', 'blocked']
86
85
  # - holder_ids [list of strings, default nil]: list of IssuingHolder ids to filter logs. ex: ['5656565656565656', '4545454545454545']
86
+ # - ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
87
87
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
88
88
  #
89
89
  # ## Return:
90
- # - list of Log objects with updated attributes
90
+ # - list of IssuingHolder::Log objects with updated attributes
91
91
  # - cursor to retrieve the next page of Log objects
92
92
  def self.page(cursor: nil, limit: nil, after: nil, before: nil, types: nil, holder_ids: nil, user: nil)
93
93
  after = StarkInfra::Utils::Checks.check_date(after)
@@ -88,8 +88,8 @@ module StarkInfra
88
88
  #
89
89
  # ## Parameters (optional):
90
90
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
91
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
92
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
91
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
92
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
93
93
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['created', 'expired', 'overdue', 'paid']
94
94
  # - tags [list of strings, default nil]: tags to filter retrieved objects. ex: ['tony', 'stark']
95
95
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
@@ -112,13 +112,14 @@ module StarkInfra
112
112
 
113
113
  # # Retrieve paged IssuingInvoices
114
114
  #
115
- # Receive a list of IssuingInvoices objects previously created in the Stark Infra API and the cursor to the next page.
115
+ # Receive a list of up to 100 IssuingInvoices objects previously created in the Stark Infra API and the cursor to the next page.
116
+ # Use this function instead of query if you want to manually page your logs.
116
117
  #
117
118
  # ## Parameters (optional):
118
119
  # - cursor [string, default nil]: cursor returned on the previous page function call.
119
120
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
120
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
121
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
121
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
122
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
122
123
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['created', 'expired', 'overdue', 'paid']
123
124
  # - tags [list of strings, default nil]: tags to filter retrieved objects. ex: ['tony', 'stark']
124
125
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
@@ -13,7 +13,7 @@ module StarkInfra
13
13
  # This log is never generated by the user, but it can be retrieved to check additional information on the
14
14
  # IssuingInvoice.
15
15
  #
16
- # ## Attributes:
16
+ # ## Attributes (return-only):
17
17
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
18
18
  # - invoice [IssuingInvoice]: IssuingInvoice entity to which the log refers to.
19
19
  # - type [string]: type of the IssuingInvoice event which triggered the log creation. ex: 'created', 'credited', 'expired', 'overdue', 'paid'.
@@ -27,9 +27,9 @@ module StarkInfra
27
27
  @created = StarkInfra::Utils::Checks.check_datetime(created)
28
28
  end
29
29
 
30
- # # Retrieve a specific Log
30
+ # # Retrieve a specific IssuingInvoice::Log
31
31
  #
32
- # Receive a single Log object previously created by the Stark Infra API by its id
32
+ # Receive a single IssuingInvoice::Log object previously created by the Stark Infra API by its id
33
33
  #
34
34
  # ## Parameters (required):
35
35
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -38,25 +38,25 @@ module StarkInfra
38
38
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
39
39
  #
40
40
  # ## Return:
41
- # - Log object with updated attributes
41
+ # - IssuingInvoice::Log object with updated attributes
42
42
  def self.get(id, user: nil)
43
43
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
44
44
  end
45
45
 
46
- # # Retrieve Logs
46
+ # # Retrieve IssuingInvoice::Logs
47
47
  #
48
- # Receive a generator of Log objects previously created in the Stark Infra API
48
+ # Receive a generator of IssuingInvoice::Log objects previously created in the Stark Infra API
49
49
  #
50
50
  # ## Parameters (optional):
51
- # - ids [list of strings, default nil]: list of IssuingInvoice ids to filter logs. ex: ['5656565656565656', '4545454545454545']
52
51
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Max = 100. ex: 35
53
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
54
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
52
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
53
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
55
54
  # - types [list of strings, default nil]: filter for log event types. ex: ['created', 'credited', 'expired', 'overdue', 'paid']
55
+ # - ids [list of strings, default nil]: list of IssuingInvoice ids to filter logs. ex: ['5656565656565656', '4545454545454545']
56
56
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
57
57
  #
58
58
  # ## Return:
59
- # - generator of Log objects with updated attributes
59
+ # - generator of IssuingInvoice::Log objects with updated attributes
60
60
  def self.query(limit: nil, after: nil, before: nil, types: nil, user: nil)
61
61
  after = StarkInfra::Utils::Checks.check_date(after)
62
62
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -70,22 +70,22 @@ module StarkInfra
70
70
  )
71
71
  end
72
72
 
73
- # # Retrieve paged Logs
73
+ # # Retrieve paged IssuingInvoice::Logs
74
74
  #
75
- # Receive a list of up to 100 issuinginvoice.Log objects previously created in the Stark Infra API and the cursor
75
+ # Receive a list of up to 100 IssuingInvoice::Log objects previously created in the Stark Infra API and the cursor
76
76
  # to the next page. Use this function instead of query if you want to manually page your invoices.
77
77
  #
78
78
  # ## Parameters (optional):
79
79
  # - cursor [string, default nil]: cursor returned on the previous page function call
80
- # - ids [list of strings, default nil]: list of IssuingInvoice ids to filter logs. ex: ['5656565656565656', '4545454545454545']
81
80
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
82
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
83
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
81
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
82
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
84
83
  # - types [list of strings, default nil]: filter for log event types. ex: ['created', 'credited', 'expired', 'overdue', 'paid']
84
+ # - ids [list of strings, default nil]: list of IssuingInvoice ids to filter logs. ex: ['5656565656565656', '4545454545454545']
85
85
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
86
86
  #
87
87
  # ## Return:
88
- # - list of Log objects with updated attributes
88
+ # - list of IssuingInvoice::Log objects with updated attributes
89
89
  # - cursor to retrieve the next page of Log objects
90
90
  def self.page(cursor: nil, limit: nil, after: nil, before: nil, types: nil, user: nil)
91
91
  after = StarkInfra::Utils::Checks.check_date(after)
@@ -7,7 +7,7 @@ require_relative('../utils/resource')
7
7
  module StarkInfra
8
8
  # # IssuingProduct object
9
9
  #
10
- # The IssuingProduct object displays information of avaliable card products registered to your Workspace.
10
+ # The IssuingProduct object displays information of registered card products to your Workspace.
11
11
  # They represent a group of cards that begin with the same numbers (id) and offer the same product to end customers.
12
12
  #
13
13
  # ## Attributes (return-only):
@@ -30,7 +30,7 @@ module StarkInfra
30
30
 
31
31
  # # Retrieve IssuingProducts
32
32
  #
33
- # Receive a generator of available IssuingProduct objects previously registered to your workspace
33
+ # Receive a generator of IssuingProduct objects previously registered in the Stark Infra API
34
34
  #
35
35
  # ## Parameters (optional):
36
36
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
@@ -12,6 +12,7 @@ module StarkInfra
12
12
  # ## Attributes (return-only):
13
13
  # - id [string]: unique id returned when IssuingPurchase is created. ex: '5656565656565656'
14
14
  # - holder_name [string]: card holder name. ex: 'Tony Stark'
15
+ # - product_id [string]: unique card product number (BIN) registered within the card network. ex: "53810200"
15
16
  # - card_id [string]: unique id returned when IssuingCard is created. ex: '5656565656565656'
16
17
  # - card_ending [string]: last 4 digits of the card number. ex: '1234'
17
18
  # - purpose [string]: purchase purpose. ex: 'purchase'
@@ -47,14 +48,14 @@ module StarkInfra
47
48
  # - card_tags [list of strings]: tags of the IssuingCard responsible for this purchase. ex: ['travel', 'food']
48
49
  # - holder_tags [list of strings]: tags of the IssuingHolder responsible for this purchase. ex: ['technology', 'john snow']
49
50
  class IssuingPurchase < StarkInfra::Utils::Resource
50
- attr_reader :id, :holder_name, :card_id, :card_ending, :purpose, :amount, :tax, :issuer_amount, :issuer_currency_code,
51
+ attr_reader :id, :holder_name, :product_id, :card_id, :card_ending, :purpose, :amount, :tax, :issuer_amount, :issuer_currency_code,
51
52
  :issuer_currency_symbol, :merchant_amount, :merchant_currency_code, :merchant_currency_symbol,
52
53
  :merchant_category_code, :merchant_country_code, :acquirer_id, :merchant_id, :merchant_name,
53
54
  :merchant_fee, :wallet_id, :method_code, :score, :end_to_end_id, :tags, :zip_code,
54
55
  :issuing_transaction_ids, :status, :updated, :created, :is_partial_allowed, :card_tags, :holder_tags
55
56
 
56
57
  def initialize(
57
- id: nil, holder_name: nil, card_id: nil, card_ending: nil, purpose: nil, amount: nil, tax: nil, issuer_amount: nil,
58
+ id: nil, holder_name: nil, product_id: nil, card_id: nil, card_ending: nil, purpose: nil, amount: nil, tax: nil, issuer_amount: nil,
58
59
  issuer_currency_code: nil, issuer_currency_symbol: nil, merchant_amount: nil, merchant_currency_code: nil,
59
60
  merchant_currency_symbol: nil, merchant_category_code: nil, merchant_country_code: nil, acquirer_id: nil,
60
61
  merchant_id: nil, merchant_name: nil, merchant_fee: nil, wallet_id: nil, method_code: nil, score: nil,
@@ -63,6 +64,7 @@ module StarkInfra
63
64
  )
64
65
  super(id)
65
66
  @holder_name = holder_name
67
+ @product_id = product_id
66
68
  @card_id = card_id
67
69
  @card_ending = card_ending
68
70
  @purpose = purpose
@@ -112,19 +114,19 @@ module StarkInfra
112
114
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
113
115
  end
114
116
 
115
- # # Retrieve IssuingPurchase
117
+ # # Retrieve IssuingPurchases
116
118
  #
117
119
  # Receive a generator of IssuingPurchases objects previously created in the Stark Infra API
118
120
  #
119
121
  # ## Parameters (optional):
120
- # - ids [list of strings, default nil]: purchase IDs. ex: ['5656565656565656', '4545454545454545']
121
122
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
122
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 09)
123
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
123
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 09)
124
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
124
125
  # - end_to_end_ids [list of strings, default nil]: central bank's unique transaction ID. ex: 'E79457883202101262140HHX553UPqeq'
125
126
  # - holder_ids [list of strings, default nil]: card holder IDs. ex: ['5656565656565656', '4545454545454545']
126
127
  # - card_ids [list of strings, default nil]: card IDs. ex: ['5656565656565656', '4545454545454545']
127
128
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['approved', 'canceled', 'denied', 'confirmed', 'voided']
129
+ # - ids [list of strings, default nil]: purchase IDs. ex: ['5656565656565656', '4545454545454545']
128
130
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
129
131
  #
130
132
  # ## Return:
@@ -149,18 +151,19 @@ module StarkInfra
149
151
 
150
152
  # # Retrieve paged IssuingPurchases
151
153
  #
152
- # Receive a list of IssuingPurchase objects previously created in the Stark Infra API and the cursor to the next page.
154
+ # Receive a list of up to 100 IssuingPurchases objects previously created in the Stark Infra API and the cursor
155
+ # to the next page. Use this function instead of query if you want to manually page your invoices.
153
156
  #
154
157
  # ## Parameters (optional):
155
158
  # - cursor [string, default nil]: cursor returned on the previous page function call.
156
- # - ids [list of strings, default nil]: purchase IDs. ex: ['5656565656565656', '4545454545454545']
157
159
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
158
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
159
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
160
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
161
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
160
162
  # - end_to_end_ids [list of strings, default nil]: central bank's unique transaction ID. ex: 'E79457883202101262140HHX553UPqeq'
161
163
  # - holder_ids [list of strings, default nil]: card holder IDs. ex: ['5656565656565656', '4545454545454545']
162
164
  # - card_ids [list of strings, default nil]: card IDs. ex: ['5656565656565656', '4545454545454545']
163
165
  # - status [list of strings, default nil]: filter for status of retrieved objects. ex: ['approved', 'canceled', 'denied', 'confirmed', 'voided']
166
+ # - ids [list of strings, default nil]: purchase IDs. ex: ['5656565656565656', '4545454545454545']
164
167
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
165
168
  #
166
169
  # ## Return:
@@ -213,7 +216,7 @@ module StarkInfra
213
216
  )
214
217
  end
215
218
 
216
- # # Helps you respond to a IssuingPurchase authorization request
219
+ # # Helps you respond IssuingPurchase request
217
220
  #
218
221
  # ## Parameters (required):
219
222
  # - status [string]: sub-issuer response to the authorization. ex: 'approved' or 'denied'
@@ -247,6 +250,7 @@ module StarkInfra
247
250
  IssuingPurchase.new(
248
251
  id: json['id'],
249
252
  holder_name: json['holder_name'],
253
+ product_id: json['product_id'],
250
254
  card_id: json['card_id'],
251
255
  card_ending: json['card_ending'],
252
256
  purpose: json['purpose'],
@@ -12,7 +12,7 @@ module StarkInfra
12
12
  # Every time an IssuingPurchase entity is updated, a corresponding IssuingInvoice::Log is generated for the entity.
13
13
  # This Log is never generated by the user, but it can be retrieved to check additional information on the IssuingPurchase.
14
14
  #
15
- # ## Attributes:
15
+ # ## Attributes (return-only):
16
16
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
17
17
  # - purchase [IssuingPurchase]: IssuingPurchase entity to which the log refers to.
18
18
  # - issuing_transaction_id [string]: transaction ID related to the IssuingCard.
@@ -30,9 +30,9 @@ module StarkInfra
30
30
  @created = StarkInfra::Utils::Checks.check_datetime(created)
31
31
  end
32
32
 
33
- # # Retrieve a specific Log
33
+ # # Retrieve a specific IssuingPurchase::Log
34
34
  #
35
- # Receive a single Log object previously created by the Stark Infra API by passing its id
35
+ # Receive a single IssuingPurchase::Log object previously created by the Stark Infra API by passing its id
36
36
  #
37
37
  # ## Parameters (required):
38
38
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -41,26 +41,26 @@ module StarkInfra
41
41
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
42
42
  #
43
43
  # ## Return:
44
- # - Log object with updated attributes
44
+ # - IssuingPurchase::Log object with updated attributes
45
45
  def self.get(id, user: nil)
46
46
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
47
47
  end
48
48
 
49
- # # Retrieve Logs
49
+ # # Retrieve IssuingPurchase::Logs
50
50
  #
51
- # Receive a generator of Log objects previously created in the Stark Infra API
51
+ # Receive a generator of IssuingPurchase::Log objects previously created in the Stark Infra API
52
52
  #
53
53
  # ## Parameters (optional):
54
- # - ids [list of strings, default nil]: list of IssuingPurchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
55
54
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
56
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
57
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
55
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
56
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
58
57
  # - types [list of strings, default nil]: filter for log event types. ex: ['approved', 'canceled', 'confirmed', 'denied', 'reversed', 'voided']
59
58
  # - purchase_ids [list of strings, default nil]: list of Purchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
59
+ # - ids [list of strings, default nil]: list of IssuingPurchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
60
60
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
61
61
  #
62
62
  # ## Return:
63
- # - generator of Log objects with updated attributes
63
+ # - generator of IssuingPurchase::Log objects with updated attributes
64
64
  def self.query(ids: nil, limit: nil, after: nil, before: nil, types: nil, purchase_ids: nil, user: nil)
65
65
  after = StarkInfra::Utils::Checks.check_date(after)
66
66
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -76,23 +76,23 @@ module StarkInfra
76
76
  )
77
77
  end
78
78
 
79
- # # Retrieve paged Logs
79
+ # # Retrieve paged IssuingPurchase::Logs
80
80
  #
81
81
  # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
82
82
  # Use this function instead of query if you want to manually page your purchases.
83
83
  #
84
84
  # ## Parameters (optional):
85
85
  # - cursor [string, default nil]: cursor returned on the previous page function call
86
- # - ids [list of strings, default nil]: list of IssuingPurchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
87
86
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
88
- # - after [Date or string, default nil] date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
89
- # - before [Date or string, default nil] date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
87
+ # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
88
+ # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
90
89
  # - types [list of strings, default nil]: filter for log event types. ex: ['approved', 'canceled', 'confirmed', 'denied', 'reversed', 'voided']
91
90
  # - purchase_ids [list of strings, default nil]: list of Purchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
91
+ # - ids [list of strings, default nil]: list of IssuingPurchase ids to filter logs. ex: ['5656565656565656', '4545454545454545']
92
92
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if starkinfra.user was set before function call
93
93
  #
94
94
  # ## Return:
95
- # - list of Log objects with updated attributes
95
+ # - list of IssuingPurchase::Log objects with updated attributes
96
96
  # - cursor to retrieve the next page of Log objects
97
97
  def self.page(cursor: nil, ids: nil, limit: nil, after: nil, before: nil, types: nil, purchase_ids: nil, user: nil)
98
98
  after = StarkInfra::Utils::Checks.check_date(after)