payabli 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/README.md +4 -1
  4. data/lib/payabli/client.rb +33 -4
  5. data/lib/payabli/customer/client.rb +1 -1
  6. data/lib/payabli/internal/http/raw_client.rb +28 -5
  7. data/lib/payabli/internal/oauth_provider.rb +67 -0
  8. data/lib/payabli/money_out/client.rb +7 -2
  9. data/lib/payabli/token/client.rb +51 -0
  10. data/lib/payabli/token/types/create_server_side_token_request.rb +17 -0
  11. data/lib/payabli/types/add_device_response.rb +4 -0
  12. data/lib/payabli/types/add_method_response.rb +4 -0
  13. data/lib/payabli/types/add_response_response.rb +4 -0
  14. data/lib/payabli/types/bill_pay_out_data.rb +15 -9
  15. data/lib/payabli/types/contacts_response.rb +3 -3
  16. data/lib/payabli/types/get_method_response_response_data_customers_item.rb +42 -0
  17. data/lib/payabli/types/get_pay_link_from_id_response.rb +4 -0
  18. data/lib/payabli/types/modify_approval_bill_response.rb +4 -0
  19. data/lib/payabli/types/notification_log_detail.rb +24 -0
  20. data/lib/payabli/types/payabli_access_token_response.rb +17 -0
  21. data/lib/payabli/types/query_payout_transaction_records_item.rb +54 -34
  22. data/lib/payabli/types/query_payout_transaction_records_item_payment_data.rb +16 -16
  23. data/lib/payabli/types/query_payout_transaction_summary.rb +17 -17
  24. data/lib/payabli/types/query_transaction_events.rb +2 -2
  25. data/lib/payabli/types/remove_device_response.rb +4 -0
  26. data/lib/payabli/types/set_approved_bill_response.rb +4 -0
  27. data/lib/payabli/types/token_error_response.rb +13 -0
  28. data/lib/payabli/types/tokenize_ach.rb +0 -2
  29. data/lib/payabli/types/tokenize_card.rb +2 -0
  30. data/lib/payabli/types/vendor_query_record.rb +45 -41
  31. data/lib/payabli/version.rb +1 -1
  32. data/lib/payabli.rb +18 -13
  33. data/reference.md +172 -78
  34. data/wiremock/docker-compose.test.yml +1 -1
  35. data/wiremock/wiremock-mappings.json +106 -80
  36. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 215e41e74ef3bd2fa5cf53366a25cce7d0d084eec1ec74067d49b05607d58271
4
- data.tar.gz: bd0c29b5a3d830ebe2ba870fe4b13a61a91a69abeda2b56345c3608aac8c394e
3
+ metadata.gz: ba6433fa0be5362832d5430527bae26321e6d8f10a8aa1a62366742fbce5b0a2
4
+ data.tar.gz: 427557254056844c433a4fc82e023b1144d5c82458aff1e5a77fb1264ed1a795
5
5
  SHA512:
6
- metadata.gz: a97fd769f512ef83d9ecbabfe846f91da4d1871c816d163e6ed77f067927b5260484cc425481dcac1d63d63bf5ee4adaa042220ed5ecb8002a1398c9808ced6a
7
- data.tar.gz: aa953f69cda7ae3ec828a9149c1c24f35079bed28933a7a408f83a36085f6390658b9994be3144551f277ba62149073d5c2ef294efa4ecb4aa7975a25be88e53
6
+ metadata.gz: f99db2b158290293363055837d01b63802afb3d81e5d3d2ff453599dd2578a56fd902f522de63b51c65744cb0e2a644183636b9d124e139a8ba15cdc3d65e226
7
+ data.tar.gz: 496bdb849ed1aeaf582a6c0af089da120cf00a1495a55948c4de04c7394d446d3ae8af055fb0ff71a0acb50a2fb6f2ffbf0aa911a3ee6ee3b45a17500f91a16b
data/.fern/metadata.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "cliVersion": "5.56.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
- "generatorVersion": "1.12.7",
4
+ "generatorVersion": "1.15.2",
5
5
  "generatorConfig": {
6
6
  "enableWireTests": true,
7
7
  "rubocopVariableNumberStyle": "snake_case"
8
8
  },
9
- "originGitCommit": "1aeb9b5f59cac476a429df4671f575ed07ab5731",
9
+ "originGitCommit": "4a292ff89b1a47f4e159d99e6b8ac1d9af84a653",
10
10
  "originGitCommitIsDirty": true,
11
11
  "invokedBy": "ci",
12
- "requestedVersion": "3.0.2",
12
+ "requestedVersion": "3.0.4",
13
13
  "ciProvider": "github",
14
- "sdkVersion": "3.0.2"
14
+ "sdkVersion": "3.0.4"
15
15
  }
data/README.md CHANGED
@@ -71,7 +71,10 @@ Instantiate and use the client with the following:
71
71
  ```ruby
72
72
  require "payabli"
73
73
 
74
- client = Payabli::Client.new(api_key: "<value>")
74
+ client = Payabli::Client.new(
75
+ client_id: "<clientId>",
76
+ client_secret: "<clientSecret>"
77
+ )
75
78
 
76
79
  client.money_in.getpaidv_2(
77
80
  customer_data: {
@@ -2,18 +2,42 @@
2
2
 
3
3
  module Payabli
4
4
  class Client
5
- # @param api_key [String]
6
5
  # @param base_url [String, nil]
6
+ # @param client_id [String, nil]
7
+ # @param client_secret [String, nil]
8
+ # @param api_key [String, nil]
9
+ # @param max_retries [Integer]
7
10
  #
8
11
  # @return [void]
9
- def initialize(api_key:, base_url: nil)
12
+ def initialize(base_url: nil, client_id: ENV.fetch("OAUTH_CLIENT_ID", nil), client_secret: ENV.fetch("OAUTH_CLIENT_SECRET", nil), api_key: nil, max_retries: 2)
13
+ if !client_id.to_s.empty? && !client_secret.to_s.empty?
14
+ # Create an unauthenticated client for the auth endpoint
15
+ auth_raw_client = Payabli::Internal::Http::RawClient.new(
16
+ base_url: base_url || Payabli::Environment::SANDBOX,
17
+ headers: {
18
+ "X-Fern-Language" => "Ruby"
19
+ }
20
+ )
21
+
22
+ # Create the auth client for token retrieval
23
+ auth_client = Payabli::Token::Client.new(client: auth_raw_client)
24
+
25
+ # Create the OAuth provider with the auth client and credentials
26
+ @auth_provider = Payabli::Internal::OAuthProvider.new(
27
+ auth_client: auth_client,
28
+ options: { base_url: base_url, client_id: client_id, client_secret: client_secret }
29
+ )
30
+ end
31
+
10
32
  @raw_client = Payabli::Internal::Http::RawClient.new(
11
33
  base_url: base_url || Payabli::Environment::SANDBOX,
12
34
  headers: {
13
- "User-Agent" => "payabli/3.0.2",
35
+ "User-Agent" => "payabli/3.0.4",
14
36
  "X-Fern-Language" => "Ruby",
15
37
  requestToken: api_key.to_s
16
- }
38
+ },
39
+ auth_provider: @auth_provider,
40
+ max_retries: max_retries
17
41
  )
18
42
  end
19
43
 
@@ -37,6 +61,11 @@ module Payabli
37
61
  @money_in ||= Payabli::MoneyIn::Client.new(client: @raw_client)
38
62
  end
39
63
 
64
+ # @return [Payabli::Token::Client]
65
+ def token
66
+ @token ||= Payabli::Token::Client.new(client: @raw_client)
67
+ end
68
+
40
69
  # @return [Payabli::Subscription::Client]
41
70
  def subscription
42
71
  @subscription ||= Payabli::Subscription::Client.new(client: @raw_client)
@@ -11,7 +11,7 @@ module Payabli
11
11
  end
12
12
 
13
13
  # Creates a customer in an entrypoint. An identifier is required to create customer records. Change your
14
- # identifier settings in Settings > Custom Fields in PartnerHub.
14
+ # identifier settings in Settings > Custom Fields in the Payabli Portal.
15
15
  # If you don't include an identifier, the record is rejected.
16
16
  #
17
17
  # @param request_options [Hash]
@@ -21,10 +21,14 @@ module Payabli
21
21
  # @param max_retries [Integer] The number of times to retry a failed request, defaults to 2.
22
22
  # @param timeout [Float] The timeout for the request, defaults to 60.0 seconds.
23
23
  # @param headers [Hash] The headers for the request.
24
- def initialize(base_url:, max_retries: 2, timeout: 60.0, headers: {})
24
+ # @param auth_provider [Object, nil] An optional auth provider responding to
25
+ # `auth_headers`. When present its headers are resolved on every request so
26
+ # token-based schemes (e.g. OAuth) can refresh an expired token mid-session.
27
+ def initialize(base_url:, max_retries: 2, timeout: 60.0, headers: {}, auth_provider: nil)
25
28
  @base_url = base_url
26
29
  @max_retries = max_retries
27
30
  @timeout = timeout
31
+ @auth_provider = auth_provider
28
32
  @default_headers = {
29
33
  "X-Fern-Language": "Ruby",
30
34
  "X-Fern-SDK-Name": "payabli",
@@ -36,6 +40,9 @@ module Payabli
36
40
  # @return [HTTP::Response] The HTTP response.
37
41
  def send(request)
38
42
  url = build_url(request)
43
+ # Resolve auth headers once per request (not per retry) so token-based
44
+ # providers refresh at most once here; static providers are cheap.
45
+ auth_headers = resolve_auth_headers
39
46
  attempt = 0
40
47
  response = nil
41
48
 
@@ -43,8 +50,9 @@ module Payabli
43
50
  http_request = build_http_request(
44
51
  url:,
45
52
  method: request.method,
46
- headers: request.encode_headers(protected_keys: @default_headers.keys),
47
- body: request.encode_body
53
+ headers: request.encode_headers(protected_keys: @default_headers.keys + auth_headers.keys),
54
+ body: request.encode_body,
55
+ auth_headers: auth_headers
48
56
  )
49
57
 
50
58
  conn = connect(url)
@@ -157,12 +165,27 @@ module Payabli
157
165
  "HTTP is only allowed for localhost. Use HTTPS or pass a localhost URL."
158
166
  end
159
167
 
168
+ # Resolves the auth headers to send with the next request. Delegates to the
169
+ # configured auth provider (if any) on every call so that token-based
170
+ # providers (e.g. OAuth client-credentials) can refresh an expired token
171
+ # before the request is sent. Returns an empty hash when no provider is set,
172
+ # which keeps the api-key / basic / bearer / no-auth paths unchanged.
173
+ # @return [Hash] The auth headers for the current request.
174
+ def resolve_auth_headers
175
+ return {} if @auth_provider.nil?
176
+
177
+ @auth_provider.auth_headers
178
+ end
179
+
160
180
  # @param url [URI::Generic] The url to the resource.
161
181
  # @param method [String] The HTTP method to use.
162
182
  # @param headers [Hash] The headers for the request.
163
183
  # @param body [String, nil] The body for the request.
184
+ # @param auth_headers [Hash] The auth headers resolved for this request. These
185
+ # take precedence over the static default headers but not over per-request
186
+ # headers, mirroring the previous baked-header precedence.
164
187
  # @return [HTTP::Request] The HTTP request.
165
- def build_http_request(url:, method:, headers: {}, body: nil)
188
+ def build_http_request(url:, method:, headers: {}, body: nil, auth_headers: {})
166
189
  request = Net::HTTPGenericRequest.new(
167
190
  method,
168
191
  !body.nil?,
@@ -170,7 +193,7 @@ module Payabli
170
193
  url
171
194
  )
172
195
 
173
- request_headers = @default_headers.merge(headers)
196
+ request_headers = @default_headers.merge(auth_headers).merge(headers)
174
197
  request_headers.each { |name, value| request[name] = value }
175
198
  request.body = body if body
176
199
 
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Internal
5
+ class OAuthProvider
6
+ BUFFER_IN_SECONDS = 120 # 2 minutes
7
+
8
+ # @param auth_client [untyped]
9
+ # @param options [Hash[String, untyped]]
10
+ #
11
+ # @return [void]
12
+ def initialize(auth_client:, options:)
13
+ @auth_client = auth_client
14
+ @options = options
15
+ @access_token = nil
16
+ @expires_at = nil
17
+ end
18
+
19
+ # Returns a cached access token, refreshing if necessary.
20
+ # Refreshes the token if it's nil, or if we're within the buffer period before expiration.
21
+ #
22
+ # @return [String]
23
+ def token
24
+ return refresh if @access_token.nil? || token_needs_refresh?
25
+
26
+ @access_token
27
+ end
28
+
29
+ # Returns the authentication headers to be included in requests.
30
+ #
31
+ # @return [Hash[String, String]]
32
+ def auth_headers
33
+ access_token = token
34
+ {
35
+ Authorization: "Bearer #{access_token}"
36
+ }
37
+ end
38
+
39
+ # Checks if the token needs to be refreshed.
40
+ # Returns true if the token will expire within the buffer period.
41
+ #
42
+ # @return [Boolean]
43
+ private def token_needs_refresh?
44
+ return true if @expires_at.nil?
45
+
46
+ Time.now >= (@expires_at - BUFFER_IN_SECONDS)
47
+ end
48
+
49
+ # Refreshes the access token by calling the token endpoint.
50
+ #
51
+ # @return [String]
52
+ private def refresh
53
+ request_params = {
54
+ client_id: @options[:client_id],
55
+ client_secret: @options[:client_secret]
56
+ }
57
+
58
+ token_response = @auth_client.create_server_side_token(**request_params)
59
+
60
+ @access_token = token_response.access_token
61
+ @expires_at = Time.now + token_response.expires_in
62
+
63
+ @access_token
64
+ end
65
+ end
66
+ end
67
+ end
@@ -18,13 +18,18 @@ module Payabli
18
18
  # When `autoCapture` is `true`, Payabli captures the transaction asynchronously after authorization. The response
19
19
  # confirms only that the transaction was authorized; it doesn't confirm that capture succeeded. To confirm
20
20
  # capture, listen for the
21
- # [`payout_transaction_approvedcaptured`](/developers/webhooks/payout-transaction-approved-captured) webhook
22
- # event.
21
+ # [`payout_transaction_approvedcaptured`](/developers/api-reference/webhooks-overview/payout-transaction-approved-captured)
22
+ # webhook event.
23
23
  #
24
24
  # If a velocity fraud alert is triggered, the endpoint returns a `202` response with `responseCode` `9051`, and
25
25
  # the authorization is held for risk review rather than rejected. If a risk policy blocks the transaction, the
26
26
  # endpoint returns a `422` response with `responseCode` `9005`, a terminal rejection.
27
27
  #
28
+ # For check payouts, Payabli validates the remit (mailing) address at authorization. If the address fails
29
+ # deliverability validation, the endpoint returns a `422` response and doesn't charge the paypoint. Correct the
30
+ # address and re-authorize. Other payout rails (ACH, RTP, virtual card, wire, and managed payables) aren't
31
+ # affected.
32
+ #
28
33
  # @param request_options [Hash]
29
34
  # @param params [Payabli::MoneyOut::Types::RequestOutAuthorize]
30
35
  # @option request_options [String] :base_url
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Token
5
+ class Client
6
+ # @param client [Payabli::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # Exchanges a client ID and client secret for a short-lived Bearer access token using the OAuth2
14
+ # client-credentials flow. Designed for server-to-server use: the credentials and the returned token stay on your
15
+ # backend. Send the returned `access_token` in the `Authorization` header as `Bearer <access_token>` on subsequent
16
+ # API calls. See the [OAuth authentication guide](/developers/oauth-authentication) for the full flow.
17
+ #
18
+ # @param request_options [Hash]
19
+ # @param params [Payabli::Token::Types::CreateServerSideTokenRequest]
20
+ # @option request_options [String] :base_url
21
+ # @option request_options [Hash{String => Object}] :additional_headers
22
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
23
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
24
+ # @option request_options [Integer] :timeout_in_seconds
25
+ #
26
+ # @return [Payabli::Types::PayabliAccessTokenResponse]
27
+ def create_server_side_token(request_options: {}, **params)
28
+ params = Payabli::Internal::Types::Utils.normalize_keys(params)
29
+ request = Payabli::Internal::JSON::Request.new(
30
+ base_url: request_options[:base_url],
31
+ method: "POST",
32
+ path: "v2/Token/serverside",
33
+ body: Payabli::Token::Types::CreateServerSideTokenRequest.new(params).to_h,
34
+ request_options: request_options
35
+ )
36
+ begin
37
+ response = @client.send(request)
38
+ rescue Net::HTTPRequestTimeout
39
+ raise Payabli::Errors::TimeoutError
40
+ end
41
+ code = response.code.to_i
42
+ if code.between?(200, 299)
43
+ Payabli::Types::PayabliAccessTokenResponse.load(response.body)
44
+ else
45
+ error_class = Payabli::Errors::ResponseError.subclass_for_code(code)
46
+ raise error_class.new(response.body, code: code)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Token
5
+ module Types
6
+ class CreateServerSideTokenRequest < Internal::Types::Model
7
+ field :client_id, -> { String }, optional: false, nullable: false, api_name: "clientId"
8
+
9
+ field :client_secret, -> { String }, optional: false, nullable: false, api_name: "clientSecret"
10
+
11
+ field :state, -> { String }, optional: true, nullable: false
12
+
13
+ field :permissions, -> { Internal::Types::Array[String] }, optional: true, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -3,6 +3,10 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class AddDeviceResponse < Internal::Types::Model
6
+ field :is_success, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSuccess"
7
+
8
+ field :response_text, -> { String }, optional: false, nullable: false, api_name: "responseText"
9
+
6
10
  field :page_identifier, -> { String }, optional: true, nullable: false, api_name: "pageIdentifier"
7
11
 
8
12
  field :response_data, -> { String }, optional: true, nullable: false, api_name: "responseData"
@@ -3,6 +3,10 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class AddMethodResponse < Internal::Types::Model
6
+ field :is_success, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSuccess"
7
+
8
+ field :response_text, -> { String }, optional: false, nullable: false, api_name: "responseText"
9
+
6
10
  field :response_data, -> { Payabli::Types::AddMethodResponseResponseData }, optional: true, nullable: false, api_name: "responseData"
7
11
  end
8
12
  end
@@ -3,6 +3,10 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class AddResponseResponse < Internal::Types::Model
6
+ field :is_success, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSuccess"
7
+
8
+ field :response_text, -> { String }, optional: false, nullable: false, api_name: "responseText"
9
+
6
10
  field :response_data, -> { Integer }, optional: true, nullable: false, api_name: "responseData"
7
11
  end
8
12
  end
@@ -5,27 +5,33 @@ module Payabli
5
5
  class BillPayOutData < Internal::Types::Model
6
6
  field :bill_id, -> { Integer }, optional: true, nullable: false, api_name: "billId"
7
7
 
8
- field :comments, -> { String }, optional: true, nullable: false
8
+ field :lot_number, -> { String }, optional: true, nullable: false, api_name: "LotNumber"
9
9
 
10
- field :due_date, -> { String }, optional: false, nullable: true, api_name: "dueDate"
10
+ field :accounting_field_1, -> { String }, optional: true, nullable: false, api_name: "AccountingField1"
11
11
 
12
- field :invoice_date, -> { String }, optional: false, nullable: true, api_name: "invoiceDate"
12
+ field :accounting_field_2, -> { String }, optional: true, nullable: false, api_name: "AccountingField2"
13
+
14
+ field :terms, -> { Payabli::Types::Terms }, optional: true, nullable: false, api_name: "Terms"
15
+
16
+ field :additional_data, -> { String }, optional: true, nullable: false, api_name: "AdditionalData"
17
+
18
+ field :attachments, -> { Internal::Types::Array[Payabli::Types::FileContent] }, optional: true, nullable: false
13
19
 
14
20
  field :invoice_number, -> { String }, optional: true, nullable: false, api_name: "invoiceNumber"
15
21
 
16
22
  field :net_amount, -> { String }, optional: true, nullable: false, api_name: "netAmount"
17
23
 
18
- field :discount, -> { String }, optional: true, nullable: false
24
+ field :invoice_date, -> { String }, optional: false, nullable: true, api_name: "invoiceDate"
19
25
 
20
- field :terms, -> { Payabli::Types::Terms }, optional: true, nullable: false, api_name: "Terms"
26
+ field :due_date, -> { String }, optional: false, nullable: true, api_name: "dueDate"
21
27
 
22
- field :accounting_field_1, -> { String }, optional: true, nullable: false, api_name: "AccountingField1"
28
+ field :comments, -> { String }, optional: true, nullable: false
23
29
 
24
- field :accounting_field_2, -> { String }, optional: true, nullable: false, api_name: "AccountingField2"
30
+ field :identifier, -> { String }, optional: true, nullable: false
25
31
 
26
- field :additional_data, -> { String }, optional: true, nullable: false, api_name: "AdditionalData"
32
+ field :discount, -> { String }, optional: true, nullable: false
27
33
 
28
- field :attachments, -> { Internal::Types::Array[Payabli::Types::FileContent] }, optional: true, nullable: false
34
+ field :total_amount, -> { String }, optional: true, nullable: false, api_name: "totalAmount"
29
35
  end
30
36
  end
31
37
  end
@@ -3,13 +3,13 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class ContactsResponse < Internal::Types::Model
6
- field :contact_email, -> { String }, optional: true, nullable: false, api_name: "ContactEmail"
7
-
8
6
  field :contact_name, -> { String }, optional: true, nullable: false, api_name: "ContactName"
9
7
 
10
- field :contact_phone, -> { String }, optional: true, nullable: false, api_name: "ContactPhone"
8
+ field :contact_email, -> { String }, optional: true, nullable: false, api_name: "ContactEmail"
11
9
 
12
10
  field :contact_title, -> { String }, optional: true, nullable: false, api_name: "ContactTitle"
11
+
12
+ field :contact_phone, -> { String }, optional: true, nullable: false, api_name: "ContactPhone"
13
13
  end
14
14
  end
15
15
  end
@@ -3,6 +3,48 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class GetMethodResponseResponseDataCustomersItem < Internal::Types::Model
6
+ field :additional_data, -> { Internal::Types::Hash[String, Internal::Types::Hash[String, Object]] }, optional: true, nullable: false, api_name: "additionalData"
7
+
8
+ field :billing_address_1, -> { String }, optional: true, nullable: false, api_name: "billingAddress1"
9
+
10
+ field :billing_address_2, -> { String }, optional: true, nullable: false, api_name: "billingAddress2"
11
+
12
+ field :billing_city, -> { String }, optional: true, nullable: false, api_name: "billingCity"
13
+
14
+ field :billing_country, -> { String }, optional: true, nullable: false, api_name: "billingCountry"
15
+
16
+ field :billing_email, -> { String }, optional: true, nullable: false, api_name: "billingEmail"
17
+
18
+ field :billing_phone, -> { String }, optional: true, nullable: false, api_name: "billingPhone"
19
+
20
+ field :billing_state, -> { String }, optional: true, nullable: false, api_name: "billingState"
21
+
22
+ field :billing_zip, -> { String }, optional: true, nullable: false, api_name: "billingZip"
23
+
24
+ field :company, -> { String }, optional: true, nullable: false
25
+
26
+ field :customer_id, -> { Integer }, optional: true, nullable: false, api_name: "customerId"
27
+
28
+ field :customer_number, -> { String }, optional: true, nullable: false, api_name: "customerNumber"
29
+
30
+ field :first_name, -> { String }, optional: true, nullable: false, api_name: "firstName"
31
+
32
+ field :identifier_fields, -> { Internal::Types::Array[String] }, optional: true, nullable: false, api_name: "identifierFields"
33
+
34
+ field :last_name, -> { String }, optional: true, nullable: false, api_name: "lastName"
35
+
36
+ field :shipping_address_1, -> { String }, optional: true, nullable: false, api_name: "shippingAddress1"
37
+
38
+ field :shipping_address_2, -> { String }, optional: true, nullable: false, api_name: "shippingAddress2"
39
+
40
+ field :shipping_city, -> { String }, optional: true, nullable: false, api_name: "shippingCity"
41
+
42
+ field :shipping_country, -> { String }, optional: true, nullable: false, api_name: "shippingCountry"
43
+
44
+ field :shipping_state, -> { String }, optional: true, nullable: false, api_name: "shippingState"
45
+
46
+ field :shipping_zip, -> { String }, optional: true, nullable: false, api_name: "shippingZip"
47
+
6
48
  field :balance, -> { Integer }, optional: true, nullable: false
7
49
 
8
50
  field :created, -> { String }, optional: true, nullable: false
@@ -3,6 +3,10 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class GetPayLinkFromIdResponse < Internal::Types::Model
6
+ field :is_success, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSuccess"
7
+
8
+ field :response_text, -> { String }, optional: false, nullable: false, api_name: "responseText"
9
+
6
10
  field :response_data, -> { Payabli::Types::PayabliPages }, optional: true, nullable: false, api_name: "responseData"
7
11
  end
8
12
  end
@@ -4,6 +4,10 @@ module Payabli
4
4
  module Types
5
5
  # Response from approval-modification endpoints.
6
6
  class ModifyApprovalBillResponse < Internal::Types::Model
7
+ field :is_success, -> { Internal::Types::Boolean }, optional: true, nullable: false, api_name: "isSuccess"
8
+
9
+ field :response_text, -> { String }, optional: false, nullable: false, api_name: "responseText"
10
+
7
11
  field :response_data, -> { Integer }, optional: true, nullable: false, api_name: "responseData"
8
12
  end
9
13
  end
@@ -3,6 +3,30 @@
3
3
  module Payabli
4
4
  module Types
5
5
  class NotificationLogDetail < Internal::Types::Model
6
+ field :id, -> { String }, optional: false, nullable: false
7
+
8
+ field :org_id, -> { Integer }, optional: false, nullable: true, api_name: "orgId"
9
+
10
+ field :paypoint_id, -> { Integer }, optional: false, nullable: true, api_name: "paypointId"
11
+
12
+ field :notification_event, -> { String }, optional: false, nullable: true, api_name: "notificationEvent"
13
+
14
+ field :target, -> { String }, optional: false, nullable: true
15
+
16
+ field :response_status, -> { String }, optional: false, nullable: true, api_name: "responseStatus"
17
+
18
+ field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
19
+
20
+ field :job_data, -> { String }, optional: false, nullable: true, api_name: "jobData"
21
+
22
+ field :created_date, -> { String }, optional: false, nullable: false, api_name: "createdDate"
23
+
24
+ field :success_date, -> { String }, optional: false, nullable: true, api_name: "successDate"
25
+
26
+ field :last_failed_date, -> { String }, optional: false, nullable: true, api_name: "lastFailedDate"
27
+
28
+ field :is_in_progress, -> { Internal::Types::Boolean }, optional: false, nullable: false, api_name: "isInProgress"
29
+
6
30
  field :web_headers, -> { Internal::Types::Array[Payabli::Types::StringStringKeyValuePair] }, optional: true, nullable: false, api_name: "webHeaders"
7
31
 
8
32
  field :response_headers, -> { Internal::Types::Array[Payabli::Types::KeyValueArray] }, optional: true, nullable: false, api_name: "responseHeaders"
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Payabli
4
+ module Types
5
+ # Successful response from the token endpoint. Returns the access token, its lifetime, and any state echoed from the
6
+ # request.
7
+ class PayabliAccessTokenResponse < Internal::Types::Model
8
+ field :token_type, -> { String }, optional: false, nullable: false
9
+
10
+ field :access_token, -> { String }, optional: false, nullable: false
11
+
12
+ field :expires_in, -> { Integer }, optional: false, nullable: false
13
+
14
+ field :state, -> { String }, optional: true, nullable: false
15
+ end
16
+ end
17
+ end