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

io.sphere.sdk.payments.TransactionDraftDsl Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.payments;

import com.fasterxml.jackson.annotation.JsonCreator;

import javax.annotation.Nullable;
import javax.money.MonetaryAmount;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Optional;

public final class TransactionDraftDsl extends TransactionDraftDslBase {
    @JsonCreator
    TransactionDraftDsl(final MonetaryAmount amount, final @Nullable String interactionId,
                        final @Nullable TransactionState state, final @Nullable ZonedDateTime timestamp, final TransactionType type) {
        super(amount, interactionId, state, Optional.ofNullable(timestamp)
                .map(value -> value.withZoneSameInstant(ZoneOffset.UTC))
                .orElse(null), type);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy