Last active
December 27, 2015 11:49
-
-
Save esaounkine/7321807 to your computer and use it in GitHub Desktop.
pacs 008 001 auto reply with 056
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Initialize a request for recall message (camt.056) with default values | |
FIToFIPaymentCancellationRequest fiToFIPaymentCancellationRequest = new FIToFIPaymentCancellationRequest( | |
"GENERATEDASSIGNMENTID", // the assignment id | |
"XXXXXBIC", // the assigner bank BIC | |
"YYYYYBIC" // the assignee bank BIC | |
); | |
//Construct the message reply information | |
//Here we are requesting a recall for a message with reason code DUPL (dulicate sending) | |
Vector<MsgReplyInfo> msgReplyInfo = new Vector<MsgReplyInfo>(); | |
ReasonCode rc = new ReasonCode(ReasonCode.CD, "DUPL", null, null); | |
//The message reply info has the transaction Id of the payment we want to return, the reason code info, a return Id we generate, | |
//an instruction id and the settlement date of the payment. | |
MsgReplyInfo mri = new MsgReplyInfo("CB2013103008JR113303E03123860000001", rc, MsgReplyInfo.MSGID_BASED, "RETURNID", "", new Date()); | |
msgReplyInfo.add(mri); | |
//our message is now ready to be generated! | |
FIToFIPaymentCancellationRequest replyMsg = (FIToFIPaymentCancellationRequest) message.autoReply(fiToFIPaymentCancellationRequest, msgReplyInfo); | |
//and here it is | |
return replyMsg.getMessageAsXML(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment