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 io.sphere.sdk.types.CustomFields;

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, CustomFields custom, final @Nullable String interactionId,
                        final @Nullable TransactionState state, final @Nullable ZonedDateTime timestamp, final TransactionType type) {
        super(amount, custom, interactionId, state, Optional.ofNullable(timestamp)
                .map(value -> value.withZoneSameInstant(ZoneOffset.UTC))
                .orElse(null), type);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy