Search in sources :

Example 1 with NoPubKeyDigestsRequestStaticHeaderType

use of com.axelor.apps.account.ebics.schema.h003.NoPubKeyDigestsRequestStaticHeaderType in project axelor-open-suite by axelor.

the class EbicsXmlFactory method createNoPubKeyDigestsRequestStaticHeaderType.

/**
 * Creates a new <code>NoPubKeyDigestsRequestStaticHeaderType</code> XML object
 *
 * @param hostId the host ID
 * @param nonce a random nonce
 * @param timestamp the current time stamp
 * @param partnerId the partner ID
 * @param userId the user ID
 * @param product the <code>ProductElementType</code> element
 * @param orderDetails the <code>OrderDetailsType</code> element
 * @param securityMedium the user security medium
 * @return
 */
public static NoPubKeyDigestsRequestStaticHeaderType createNoPubKeyDigestsRequestStaticHeaderType(String hostId, byte[] nonce, Calendar timestamp, String partnerId, String userId, ProductElementType product, OrderDetailsType orderDetails, String securityMedium) {
    NoPubKeyDigestsRequestStaticHeaderType newNoPubKeyDigestsRequestStaticHeaderType = NoPubKeyDigestsRequestStaticHeaderType.Factory.newInstance();
    newNoPubKeyDigestsRequestStaticHeaderType.setHostID(hostId);
    newNoPubKeyDigestsRequestStaticHeaderType.setNonce(nonce);
    newNoPubKeyDigestsRequestStaticHeaderType.setTimestamp(timestamp);
    newNoPubKeyDigestsRequestStaticHeaderType.setPartnerID(partnerId);
    newNoPubKeyDigestsRequestStaticHeaderType.setUserID(userId);
    newNoPubKeyDigestsRequestStaticHeaderType.setProduct(product);
    newNoPubKeyDigestsRequestStaticHeaderType.setOrderDetails(orderDetails);
    newNoPubKeyDigestsRequestStaticHeaderType.setSecurityMedium(securityMedium);
    return newNoPubKeyDigestsRequestStaticHeaderType;
}
Also used : NoPubKeyDigestsRequestStaticHeaderType(com.axelor.apps.account.ebics.schema.h003.NoPubKeyDigestsRequestStaticHeaderType)

Example 2 with NoPubKeyDigestsRequestStaticHeaderType

use of com.axelor.apps.account.ebics.schema.h003.NoPubKeyDigestsRequestStaticHeaderType in project axelor-open-suite by axelor.

the class NoPubKeyDigestsRequestElement method build.

@Override
public void build() throws AxelorException {
    EbicsNoPubKeyDigestsRequest request;
    Body body;
    Header header;
    EmptyMutableHeaderType mutable;
    NoPubKeyDigestsRequestStaticHeaderType xstatic;
    ProductElementType product;
    OrderDetailsType orderDetails;
    EbicsUser ebicsUser = session.getUser();
    EbicsPartner ebicsPartner = ebicsUser.getEbicsPartner();
    OrderAttribute orderAttribute = new OrderAttribute(OrderType.HPB, ebicsPartner.getEbicsTypeSelect());
    orderAttribute.build();
    product = EbicsXmlFactory.creatProductElementType(session.getProduct().getLanguage(), session.getProduct().getName());
    orderDetails = EbicsXmlFactory.createOrderDetailsType(orderAttribute.getOrderAttributes(), null, OrderType.HPB.getOrderType());
    xstatic = EbicsXmlFactory.createNoPubKeyDigestsRequestStaticHeaderType(session.getBankID(), EbicsUtils.generateNonce(), Calendar.getInstance(), ebicsPartner.getPartnerId(), ebicsUser.getUserId(), product, orderDetails, ebicsUser.getSecurityMedium());
    mutable = EbicsXmlFactory.createEmptyMutableHeaderType();
    header = EbicsXmlFactory.createDigestsRequestHeader(true, mutable, xstatic);
    body = EbicsXmlFactory.createDigestsRequestBody();
    request = EbicsXmlFactory.createEbicsNoPubKeyDigestsRequest(1, "H003", header, body);
    document = EbicsXmlFactory.createEbicsNoPubKeyDigestsRequestDocument(request);
}
Also used : OrderDetailsType(com.axelor.apps.account.ebics.schema.h003.OrderDetailsType) Header(com.axelor.apps.account.ebics.schema.h003.EbicsNoPubKeyDigestsRequestDocument.EbicsNoPubKeyDigestsRequest.Header) EbicsNoPubKeyDigestsRequest(com.axelor.apps.account.ebics.schema.h003.EbicsNoPubKeyDigestsRequestDocument.EbicsNoPubKeyDigestsRequest) EbicsUser(com.axelor.apps.bankpayment.db.EbicsUser) OrderAttribute(com.axelor.apps.bankpayment.ebics.client.OrderAttribute) ProductElementType(com.axelor.apps.account.ebics.schema.h003.ProductElementType) EbicsPartner(com.axelor.apps.bankpayment.db.EbicsPartner) Body(com.axelor.apps.account.ebics.schema.h003.EbicsNoPubKeyDigestsRequestDocument.EbicsNoPubKeyDigestsRequest.Body) NoPubKeyDigestsRequestStaticHeaderType(com.axelor.apps.account.ebics.schema.h003.NoPubKeyDigestsRequestStaticHeaderType) EmptyMutableHeaderType(com.axelor.apps.account.ebics.schema.h003.EmptyMutableHeaderType)

Aggregations

NoPubKeyDigestsRequestStaticHeaderType (com.axelor.apps.account.ebics.schema.h003.NoPubKeyDigestsRequestStaticHeaderType)2 EbicsNoPubKeyDigestsRequest (com.axelor.apps.account.ebics.schema.h003.EbicsNoPubKeyDigestsRequestDocument.EbicsNoPubKeyDigestsRequest)1 Body (com.axelor.apps.account.ebics.schema.h003.EbicsNoPubKeyDigestsRequestDocument.EbicsNoPubKeyDigestsRequest.Body)1 Header (com.axelor.apps.account.ebics.schema.h003.EbicsNoPubKeyDigestsRequestDocument.EbicsNoPubKeyDigestsRequest.Header)1 EmptyMutableHeaderType (com.axelor.apps.account.ebics.schema.h003.EmptyMutableHeaderType)1 OrderDetailsType (com.axelor.apps.account.ebics.schema.h003.OrderDetailsType)1 ProductElementType (com.axelor.apps.account.ebics.schema.h003.ProductElementType)1 EbicsPartner (com.axelor.apps.bankpayment.db.EbicsPartner)1 EbicsUser (com.axelor.apps.bankpayment.db.EbicsUser)1 OrderAttribute (com.axelor.apps.bankpayment.ebics.client.OrderAttribute)1