Class: Payabli::Boarding::Client
- Inherits:
-
Object
- Object
- Payabli::Boarding::Client
- Defined in:
- lib/payabli/boarding/client.rb
Instance Method Summary collapse
-
#add_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00Responsedatanonobject
Creates a boarding application in an organization.
-
#add_service_to_paypoint_from_app(request_options: {}, **params) ⇒ Payabli::Types::CreateApplicationFromPaypointResponse
Creates a new boarding application linked to an existing paypoint as part of the multi-product boarding flow.
-
#delete_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00Responsedatanonobject
Deletes a boarding application by ID.
-
#get_application(request_options: {}, **params) ⇒ Payabli::Types::ApplicationDetailsRecord
Retrieves the details for a boarding application by ID.
-
#get_application_by_auth(request_options: {}, **params) ⇒ Payabli::Types::ApplicationQueryRecord
Gets a boarding application by authentication information.
-
#get_applications_by_paypoint_id(request_options: {}, **params) ⇒ Payabli::Types::QueryBoardingAppsListResponse
Returns all boarding applications associated with a specific paypoint, including those created through the multi-product boarding flow.
-
#get_by_id_link_application(request_options: {}, **params) ⇒ Payabli::Types::BoardingLinkQueryRecord
Retrieves details for a boarding link, by ID.
-
#get_by_template_id_link_application(request_options: {}, **params) ⇒ Payabli::Types::BoardingLinkQueryRecord
Get details for a boarding link using the boarding template ID.
-
#get_external_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00
Retrieves a link and the verification code used to log into an existing boarding application.
-
#get_link_application(request_options: {}, **params) ⇒ Payabli::Types::BoardingLinkQueryRecord
Retrieves the details for a boarding link, by reference name.
- #initialize(client:) ⇒ void constructor
-
#list_applications(request_options: {}, **params) ⇒ Payabli::Types::QueryBoardingAppsListResponse
Returns a list of boarding applications for an organization.
-
#list_boarding_links(request_options: {}, **params) ⇒ Payabli::Types::QueryBoardingLinksResponse
Return a list of boarding links for an organization.
-
#update_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00Responsedatanonobject
Updates a boarding application by ID.
Constructor Details
#initialize(client:) ⇒ void
9 10 11 |
# File 'lib/payabli/boarding/client.rb', line 9 def initialize(client:) @client = client end |
Instance Method Details
#add_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00Responsedatanonobject
Creates a boarding application in an organization. This endpoint requires an application API token.
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/payabli/boarding/client.rb', line 148 def add_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "Boarding/app", headers: headers, body: Payabli::Types::AddApplicationRequest.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::PayabliApiResponse00Responsedatanonobject.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#add_service_to_paypoint_from_app(request_options: {}, **params) ⇒ Payabli::Types::CreateApplicationFromPaypointResponse
Creates a new boarding application linked to an existing paypoint as part of the multi-product boarding flow. Use this endpoint to add new services to a paypoint without creating a duplicate record. The system copies eligible business, contact, banking, and address data from the paypoint to the new application based on 1:1 field matching. The merchant only needs to provide fields that are specific to the new service. See the Multi-product boarding guide for the full flow.
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 |
# File 'lib/payabli/boarding/client.rb', line 643 def add_service_to_paypoint_from_app(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "Boarding/applications", headers: headers, body: Payabli::Boarding::Types::CreateApplicationFromPaypointRequest.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::CreateApplicationFromPaypointResponse.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#delete_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00Responsedatanonobject
Deletes a boarding application by ID.
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/payabli/boarding/client.rb', line 228 def delete_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "DELETE", path: "Boarding/app/#{URI.encode_uri_component(params[:app_id].to_s)}", headers: headers, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::PayabliApiResponse00Responsedatanonobject.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_application(request_options: {}, **params) ⇒ Payabli::Types::ApplicationDetailsRecord
Retrieves the details for a boarding application by ID.
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/payabli/boarding/client.rb', line 267 def get_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Boarding/read/#{URI.encode_uri_component(params[:app_id].to_s)}", headers: headers, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::ApplicationDetailsRecord.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_application_by_auth(request_options: {}, **params) ⇒ Payabli::Types::ApplicationQueryRecord
Gets a boarding application by authentication information. This endpoint requires an application API token.
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/payabli/boarding/client.rb', line 310 def get_application_by_auth(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) request_data = Payabli::Boarding::Types::RequestAppByAuth.new(params).to_h non_body_param_names = %w[xId] body = request_data.except(*non_body_param_names) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "POST", path: "Boarding/read/#{URI.encode_uri_component(params[:x_id].to_s)}", headers: headers, body: body, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::ApplicationQueryRecord.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_applications_by_paypoint_id(request_options: {}, **params) ⇒ Payabli::Types::QueryBoardingAppsListResponse
Returns all boarding applications associated with a specific paypoint, including those created through the multi-product boarding flow. Use this endpoint to track underwriting progress across multiple service additions or to build reporting views. See the Multi-product boarding guide for the full flow.
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/payabli/boarding/client.rb', line 686 def get_applications_by_paypoint_id(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Boarding/applications/#{URI.encode_uri_component(params[:paypoint_id].to_s)}", headers: headers, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::QueryBoardingAppsListResponse.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_by_id_link_application(request_options: {}, **params) ⇒ Payabli::Types::BoardingLinkQueryRecord
Retrieves details for a boarding link, by ID.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/payabli/boarding/client.rb', line 354 def get_by_id_link_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Boarding/linkbyId/#{URI.encode_uri_component(params[:boarding_link_id].to_s)}", headers: headers, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::BoardingLinkQueryRecord.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_by_template_id_link_application(request_options: {}, **params) ⇒ Payabli::Types::BoardingLinkQueryRecord
Get details for a boarding link using the boarding template ID. This endpoint requires an application API token.
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/payabli/boarding/client.rb', line 393 def get_by_template_id_link_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Boarding/linkbyTemplate/#{URI.encode_uri_component(params[:template_id].to_s)}", headers: headers, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::BoardingLinkQueryRecord.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_external_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00
Retrieves a link and the verification code used to log into an existing boarding application. You can also use this endpoint to send a link and referenceId for an existing boarding application to an email address. The recipient can use the referenceId and email address to access and edit the application.
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/payabli/boarding/client.rb', line 439 def get_external_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["sendEmail"] = params[:send_email] if params.key?(:send_email) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "PUT", path: "Boarding/applink/#{URI.encode_uri_component(params[:app_id].to_s)}/#{URI.encode_uri_component(params[:mail_2].to_s)}", headers: headers, query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::PayabliApiResponse00.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#get_link_application(request_options: {}, **params) ⇒ Payabli::Types::BoardingLinkQueryRecord
Retrieves the details for a boarding link, by reference name. This endpoint requires an application API token.
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/payabli/boarding/client.rb', line 482 def get_link_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Boarding/link/#{URI.encode_uri_component(params[:boarding_link_reference].to_s)}", headers: headers, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::BoardingLinkQueryRecord.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_applications(request_options: {}, **params) ⇒ Payabli::Types::QueryBoardingAppsListResponse
Returns a list of boarding applications for an organization. Use filters to limit results. Include the
exportFormat query parameter to return the results as a file instead of a JSON response.
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/payabli/boarding/client.rb', line 532 def list_applications(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["exportFormat"] = params[:export_format] if params.key?(:export_format) query_params["fromRecord"] = params[:from_record] if params.key?(:from_record) query_params["limitRecord"] = params[:limit_record] if params.key?(:limit_record) query_params["parameters"] = params[:parameters] if params.key?(:parameters) query_params["sortBy"] = params[:sort_by] if params.key?(:sort_by) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Query/boarding/#{URI.encode_uri_component(params[:org_id].to_s)}", headers: headers, query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::QueryBoardingAppsListResponse.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_boarding_links(request_options: {}, **params) ⇒ Payabli::Types::QueryBoardingLinksResponse
Return a list of boarding links for an organization. Use filters to limit results.
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
# File 'lib/payabli/boarding/client.rb', line 588 def list_boarding_links(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) query_params = {} query_params["fromRecord"] = params[:from_record] if params.key?(:from_record) query_params["limitRecord"] = params[:limit_record] if params.key?(:limit_record) query_params["parameters"] = params[:parameters] if params.key?(:parameters) query_params["sortBy"] = params[:sort_by] if params.key?(:sort_by) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "GET", path: "Query/boardinglinks/#{URI.encode_uri_component(params[:org_id].to_s)}", headers: headers, query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::QueryBoardingLinksResponse.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#update_application(request_options: {}, **params) ⇒ Payabli::Types::PayabliApiResponse00Responsedatanonobject
Updates a boarding application by ID. This endpoint requires an application API token.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/payabli/boarding/client.rb', line 188 def update_application(request_options: {}, **params) params = Payabli::Internal::Types::Utils.normalize_keys(params) headers = @client.auth_headers_for_endpoint(security: [{ "BearerAuth" => [] }, { "APIKeyAuth" => [] }]) request = Payabli::Internal::JSON::Request.new( base_url: [:base_url], method: "PUT", path: "Boarding/app/#{URI.encode_uri_component(params[:app_id].to_s)}", headers: headers, body: Payabli::Types::ApplicationData.new(params).to_h, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Payabli::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Payabli::Types::PayabliApiResponse00Responsedatanonobject.load(response.body) else error_class = Payabli::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |