public final class ChangeTransactionTimestamp extends UpdateActionImpl<Payment>
See also PaymentUpdateCommand.
withPaymentTransaction(client(), (Payment payment, Transaction transaction) -> {
final ZonedDateTime now = ZonedDateTime.now();
final Payment updatedPayment = client().executeBlocking(PaymentUpdateCommand.of(payment, ChangeTransactionTimestamp.of(now, transaction.getId())));
final Transaction updatedTransaction = updatedPayment.getTransactions().get(0);
assertThat(updatedTransaction.getTimestamp()).isEqualTo(now);
return updatedPayment;
});
See the test code.
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
getTimestamp() |
String |
getTransactionId() |
static ChangeTransactionTimestamp |
of(ZonedDateTime timestamp,
String transactionId) |
getAction
public static ChangeTransactionTimestamp of(ZonedDateTime timestamp, String transactionId)
public ZonedDateTime getTimestamp()
public String getTransactionId()