Skip to content

Querying of customer's last 6 months of orders for risk information very inefficient #29

@varun-woolies

Description

@varun-woolies

When doing an authorization, the plugin needs to build up the riskInformation and needs the total number of orders placed by the customer in the last 6 months. The current implementation here is very inefficient, as it loads up all the orders for the last 6 months, only to use the total count field.

In our scenario, we've found that for certain customers

  1. The network IO and server CT query to load up all these orders is quite expensive (upto 5 seconds).
  2. The deserialization of all the payload is even more expensive and can take upto 10 seconds

The CommerceTools payment extension has a hard limit of a 15 seconds execution timeout. This often results in cybersource processing the auth payment, but the CT payment extension terminates the HTTP request since the plugin processing is not complete within 15 seconds, hence the customers get an error message, and order creation fails.

The customer keeps on retrying, same timeout issue happens, cybersource keeps on processing the auth payment on their end. Eventually the customer looks at their credit card statement, and realise they have been charged multiple times, resulting in a very bad customer experience.

Suggestions

  1. Can the building up of this risk information be made configurable so a client can turn it on/off as per their need
  2. Can the fetching of the total order count be made more efficient? Perhaps use GraphQL api?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions