Search in sources :

Example 1 with TransferReceipt

use of com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createTransferReceipt.

/**
 * Create the <code>TransferReceipt</code> XML object
 *
 * @param authenticate should authenticate?
 * @param receiptCode the receipt code
 * @return the <code>TransferReceipt</code> XML object
 */
public static TransferReceipt createTransferReceipt(boolean authenticate, int receiptCode) {
    TransferReceipt newTransferReceipt = TransferReceipt.Factory.newInstance();
    newTransferReceipt.setAuthenticate(authenticate);
    newTransferReceipt.setReceiptCode(receiptCode);
    return newTransferReceipt;
}
Also used : TransferReceipt(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt)

Example 2 with TransferReceipt

use of com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt in project axelor-open-suite by axelor.

the class ReceiptRequestElement method build.

@Override
public void build() throws AxelorException {
    EbicsRequest request;
    Header header;
    Body body;
    MutableHeaderType mutable;
    StaticHeaderType xstatic;
    TransferReceipt transferReceipt;
    SignedInfo signedInfo;
    mutable = EbicsXmlFactory.createMutableHeaderType("Receipt", null);
    xstatic = EbicsXmlFactory.createStaticHeaderType(session.getBankID(), transactionId);
    header = EbicsXmlFactory.createEbicsRequestHeader(true, mutable, xstatic);
    transferReceipt = EbicsXmlFactory.createTransferReceipt(true, 0);
    body = EbicsXmlFactory.createEbicsRequestBody(transferReceipt);
    request = EbicsXmlFactory.createEbicsRequest(1, "H003", header, body);
    document = EbicsXmlFactory.createEbicsRequestDocument(request);
    signedInfo = new SignedInfo(session.getUser(), getDigest());
    signedInfo.build();
    ((EbicsRequestDocument) document).getEbicsRequest().setAuthSignature(signedInfo.getSignatureType());
    ((EbicsRequestDocument) document).getEbicsRequest().getAuthSignature().setSignatureValue(EbicsXmlFactory.createSignatureValueType(signedInfo.sign(toByteArray())));
}
Also used : EbicsRequest(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest) MutableHeaderType(com.axelor.apps.account.ebics.schema.h003.MutableHeaderType) TransferReceipt(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt) Header(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header) EbicsRequestDocument(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument) StaticHeaderType(com.axelor.apps.account.ebics.schema.h003.StaticHeaderType) Body(com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)

Aggregations

TransferReceipt (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body.TransferReceipt)2 EbicsRequestDocument (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument)1 EbicsRequest (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest)1 Body (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Body)1 Header (com.axelor.apps.account.ebics.schema.h003.EbicsRequestDocument.EbicsRequest.Header)1 MutableHeaderType (com.axelor.apps.account.ebics.schema.h003.MutableHeaderType)1 StaticHeaderType (com.axelor.apps.account.ebics.schema.h003.StaticHeaderType)1