Search in sources :

Example 1 with GetSCAStatusResponse

use of net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetSCAStatusResponse in project styx by petafuel.

the class BasicAuthorisationService method getSCAStatus.

protected SCA.Status getSCAStatus(GetSCAStatusRequest xs2ARequest) throws BankRequestFailedException {
    this.setUrl(this.url + xs2ARequest.getServicePath());
    this.createBody(RequestType.GET);
    this.createHeaders(xs2ARequest);
    try (Response response = this.execute();
        Jsonb jsonb = JsonbBuilder.create()) {
        String responseBody = extractResponseBody(response, 200);
        GetSCAStatusResponse getSCAStatusResponse = jsonb.fromJson(responseBody, GetSCAStatusResponse.class);
        return getSCAStatusResponse.getScaStatus();
    } catch (Exception e) {
        throw new BankRequestFailedException(e.getMessage(), e);
    }
}
Also used : GetAuthorisationResponse(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetAuthorisationResponse) GetSCAStatusResponse(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetSCAStatusResponse) Response(okhttp3.Response) Jsonb(javax.json.bind.Jsonb) GetSCAStatusResponse(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetSCAStatusResponse) BankRequestFailedException(net.petafuel.styx.core.xs2a.exceptions.BankRequestFailedException) BankRequestFailedException(net.petafuel.styx.core.xs2a.exceptions.BankRequestFailedException)

Aggregations

Jsonb (javax.json.bind.Jsonb)1 BankRequestFailedException (net.petafuel.styx.core.xs2a.exceptions.BankRequestFailedException)1 GetAuthorisationResponse (net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetAuthorisationResponse)1 GetSCAStatusResponse (net.petafuel.styx.core.xs2a.standards.berlingroup.v1_3.http.GetSCAStatusResponse)1 Response (okhttp3.Response)1