Class: Straddle::Resources::Customers::Review

Inherits:
Object
  • Object
show all
Defined in:
lib/straddle/resources/customers/review.rb,
sig/straddle/resources/customers/review.rbs

Overview

Customers are individuals or businesses that send or receive payments through your integration.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Review

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Review.

Parameters:



91
92
93
# File 'lib/straddle/resources/customers/review.rb', line 91

def initialize(client:)
  @client = client
end

Instance Method Details

#list(id, correlation_id: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::Customers::CustomerReviewResponse

Returns the results of a customer's identity and fraud review. The response includes decisions, risk and correlation scores, reason codes, watchlist matches, and network alerts.

Parameters:

  • id (String) —

    Unique identifier for the customer.

  • correlation_id (String) —

    Optional client-generated identifier for tracing a series of related requests.

  • request_id (String) —

    Optional client-generated identifier for tracing one request.

  • straddle_account_id (String) —

    For platform requests, the embedded account UUID that sets the request scope.

  • request_options (Straddle::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/straddle/resources/customers/review.rb', line 28

def list(id, params = {})
  parsed, options = Straddle::Customers::ReviewListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/customers/%1$s/review", id],
    headers:
      parsed.transform_keys(
        correlation_id: "correlation-id",
        request_id: "request-id",
        straddle_account_id: "straddle-account-id"
      ),
    model: Straddle::Customers::CustomerReviewResponse,
    options: options
  )
end

#set_verification_decision(id, status:, correlation_id: nil, idempotency_key: nil, request_id: nil, straddle_account_id: nil, request_options: {}) ⇒ Straddle::Models::CustomerResponse

Some parameter documentations has been truncated, see Models::Customers::ReviewSetVerificationDecisionParams for more details.

Updates the verification decision for a customer. The customer's current status must be review.

Parameters:

  • id (String) —

    Path param: Unique identifier for the customer.

  • status (Symbol, Straddle::Models::Customers::ReviewSetVerificationDecisionParams::Status) —

    Body param: The final status of the customer review.

  • correlation_id (String) —

    Header param: Optional client-generated identifier for tracing a series of relat

  • idempotency_key (String) —

    Header param: Optional client-generated key for an idempotent request.

  • request_id (String) —

    Header param: Optional client-generated identifier for tracing one request.

  • straddle_account_id (String) —

    Header param: For platform requests, the embedded account UUID that sets the req

  • request_options (Straddle::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/straddle/resources/customers/review.rb', line 70

def set_verification_decision(id, params)
  parsed, options = Straddle::Customers::ReviewSetVerificationDecisionParams.dump_request(params)
  header_params = {
    correlation_id: "correlation-id",
    idempotency_key: "idempotency-key",
    request_id: "request-id",
    straddle_account_id: "straddle-account-id"
  }
  @client.request(
    method: :patch,
    path: ["v1/customers/%1$s/review", id],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Straddle::CustomerResponse,
    options: options
  )
end