All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.truelayer.java.payments.entities.paymentdetail.AttemptFailedPaymentDetail Maven / Gradle / Ivy

There is a newer version: 16.0.0
Show newest version
package com.truelayer.java.payments.entities.paymentdetail;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonValue;
import com.truelayer.java.entities.AuthorizationFlowWithConfiguration;
import com.truelayer.java.entities.PaymentSource;
import java.time.ZonedDateTime;
import java.util.Optional;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Value;

@Value
@EqualsAndHashCode(callSuper = false)
public class AttemptFailedPaymentDetail extends PaymentDetail {

    Status status = Status.ATTEMPT_FAILED;

    PaymentSource paymentSource;

    ZonedDateTime failedAt;

    FailureStage failureStage;

    String failureReason;

    AuthorizationFlowWithConfiguration authorizationFlow;

    @JsonGetter
    public Optional getAuthorizationFlow() {
        return Optional.ofNullable(authorizationFlow);
    }

    @RequiredArgsConstructor
    @Getter
    public enum FailureStage {
        AUTHORIZING("authorizing"),
        AUTHORIZED("authorized");

        @JsonValue
        private final String failureStage;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy