Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Change Log

9th January 2024

Jonas Falk Nielsen

1.0

Doc created.

Introduction

The rator-insurance-no-squaretrade module is a client integration towards the Square trade insurance using jersey for its REST client implementation.

Include the maven artifact in the pom.xml of parent projects to use the functionality.

Maven Artifact

<dependency>  

    <groupId>com.cdrator.integration.insurance</groupId>
<artifactId>rator-insurance-no-squaretrade</artifactId>
<version>1.0-SNAPSHOT</version>

</dependency>

The following dependencies are also needed at runtime, if not already included in the client project, as they are provided scope in the integration module and thus does not get transitively added to a build:

com.cdrator.integration.utils.rator-utils-restutils
com.cdrator.core:rator-engine-api
com.cdrator.util.rator-logging
com.cdrator.workflow.hookpoint-stats
com.cdrator.workflow.hookpoint-documentation
com.fasterxml.jackson.core:jackson-databind
com.fasterxml.jackson.core:jackson-core
org.glassfish.jersey.media:jersey-media-json-jackson
javax.ws.rs:javax.ws.rs-api
org.glassfish.jersey.core:jersey-client
org.apache.commons:commons-lang3
com.google.guava:guava

Source code for the module can be found in bitbucket: https://bitbucket.org/cdrator/rator-insurance-no-squaretrade

Square Trade API Documentation

The API is documented in these pdf’s, note that as they are added as documents, they might not be up to date.

Implementation

The project consist of a new engine, as it is heavily dependent generic order and custom logic in the customer project.

Square Trade Order Inquiry Engine

The engine (com.cdrator.insurance.inquiryengine.SquareTradeOrderInquiryEngine) checks waiting generic orders with the partner code “SQUARE_TRADE”.
It used the response parameter “CHECK_DATE” set on the order to determine when to inquiry the specific order.

EngineParameters

One optional extra parameter exist:

Name

Description

Default value

SECONDS_BEFORE_CHECKING

Minimum amount of seconds passed before checking an order again.

300

EngineStartupCheck

Startup check implementation. No startup checks are required, so this just returns true. Exists to enable the implementation of startup checks if required.

EngineQueueLoader

Uses the broker to retrieve generic orders where:

  • status id is 2 (processing)

  • partner code is “SQUARE_TRADE”

  • more than SECONDS_BEFORE_CHECKING have passed since the record was last checked

EngineHandler

The EngineHandler will:

  • Receive a list of generic orders

  • Retrieve the status of the order from square trade

  • If response is either success or error, update the order

  • Regardless of the response, update the last checked date to sysdate

Configuration

Parameters

The following parameters are used in the rator-insurance-no-squaretrade module.

INSURANCE.SQUARE_TRADE

NAME

EXAMPLE VALUE

MANDATORY

DESCRIPTION

BASE_URL

api-stage4.squaretrade.com (test)

Yes

The base endpoint for the Telenor Wholesale REST API.

CLIENT_ID

N074R341V41u38u7C10533n0u9hR19h7

Yes

The value to use for the client_id part of the client_id:client_secret credentials that must be Base64-encoded and can then be used to call endpoint oauth/v2/token; see also parameter CLIENT_SECRET.

CLIENT_SECRET

4n07h3rF4k3V41u3

Yes

The value to use for the client_secret part of the client_id:client_secret credentials that must be Base64-encoded and can then be used to call endpoint oauth/v2/token; see also parameter CLIENT_ID.

USERNAME

api_F4k3V41u3

Yes

The value to use for the username argument in the call to endpoint oauth/v2/token; see also parameter PASSWORD.

PASSWORD

M0r3F4k3V41u3sF0r3v3r

Yes

The value to use for the password argument in the call to endpoint oauth/v2/token; see also parameter USERNAME.

TOKEN

No

If branded USERNAME,PASSWORD,CLIENT_ID, CLIENT_SECRET parameters are used, this parameter has to be created manually.

The currently valid token for authorization.

This will be automatically populated if there is only one set of credentials used. If multiple sets of credentials (USERNAME,PASSWORD,CLIENT_ID, CLIENT_SECRET) are used via branding of parameters, in combination with a set of non-branded/default credentials, this parameter has to be created beforehand, so as not to interfere with the non-branded/default one.

TOKEN_EXPIRY

No

If branded USERNAME,PASSWORD,CLIENT_ID, CLIENT_SECRET parameters are used, this parameter has to be created manually.

The point in time at which the current token will expire.

This will be automatically populated if there is only one set of credentials used. If multiple sets of credentials (USERNAME,PASSWORD,CLIENT_ID, CLIENT_SECRET) are used via branding of parameters, in combination with a set of non-branded/default credentials, this parameter has to be created beforehand, so as not to interfere with the non-branded/default one.

  • No labels