Search in sources :

Example 1 with SettlementReceipt

use of io.tbd.tbdex.protocol.messages.SettlementReceipt in project tbdex-protocol by TBD54566975.

the class SettlementDetailsProcessor method process.

@Override
public Message process(Message message) {
    Preconditions.checkState(message.type() == MessageType.SettlementDetails);
    SettlementDetails settlementDetails = getBody(message);
    paymentProcessor.process(settlementDetails, message.threadID());
    String messageId = UUID.randomUUID().toString();
    return new Message.Builder(messageId, message.threadID(), message.to(), message.from()).build(new SettlementReceipt("receipt"));
}
Also used : SettlementReceipt(io.tbd.tbdex.protocol.messages.SettlementReceipt) Message(io.tbd.tbdex.protocol.core.Message) SettlementDetails(io.tbd.tbdex.protocol.messages.SettlementDetails)

Aggregations

Message (io.tbd.tbdex.protocol.core.Message)1 SettlementDetails (io.tbd.tbdex.protocol.messages.SettlementDetails)1 SettlementReceipt (io.tbd.tbdex.protocol.messages.SettlementReceipt)1