use of com.axelor.apps.account.ebics.schema.h003.ProductElementType in project axelor-open-suite by axelor.
the class UnsecuredRequestElement method build.
@Override
public void build() throws AxelorException {
Header header;
Body body;
EmptyMutableHeaderType mutable;
UnsecuredRequestStaticHeaderType xstatic;
ProductElementType productType;
OrderDetailsType orderDetails;
DataTransfer dataTransfer;
OrderData orderData;
EbicsUnsecuredRequest request;
orderDetails = EbicsXmlFactory.createOrderDetailsType("DZNNN", session.getUser().getNextOrderId(), orderType.getOrderType());
productType = EbicsXmlFactory.creatProductElementType(Optional.ofNullable(AuthUtils.getUser()).map(User::getLanguage).orElse(null), session.getProduct().getName());
try {
xstatic = EbicsXmlFactory.createUnsecuredRequestStaticHeaderType(session.getBankID(), session.getUser().getEbicsPartner().getPartnerId(), session.getUser().getUserId(), productType, orderDetails, session.getUser().getSecurityMedium());
mutable = EbicsXmlFactory.createEmptyMutableHeaderType();
header = EbicsXmlFactory.createHeader(true, mutable, xstatic);
orderData = EbicsXmlFactory.createOrderData(this.orderData);
dataTransfer = EbicsXmlFactory.createDataTransfer(orderData);
body = EbicsXmlFactory.createBody(dataTransfer);
request = EbicsXmlFactory.createEbicsUnsecuredRequest(header, body, 1, "H003");
document = EbicsXmlFactory.createEbicsUnsecuredRequestDocument(request);
} catch (AxelorException e) {
e.printStackTrace();
}
}
use of com.axelor.apps.account.ebics.schema.h003.ProductElementType 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;
}
use of com.axelor.apps.account.ebics.schema.h003.ProductElementType in project axelor-open-suite by axelor.
the class EbicsXmlFactory method createUnsecuredRequestStaticHeaderType.
/**
* Creates a new <code>EmptyMutableHeaderType</code> XML object
*
* @param hostId the host ID
* @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 security medium
* @return the <code>EmptyMutableHeaderType</code> XML object
*/
public static UnsecuredRequestStaticHeaderType createUnsecuredRequestStaticHeaderType(String hostId, String partnerId, String userId, ProductElementType product, OrderDetailsType orderDetails, String securityMedium) {
UnsecuredRequestStaticHeaderType newUnsecuredRequestStaticHeaderType = UnsecuredRequestStaticHeaderType.Factory.newInstance();
newUnsecuredRequestStaticHeaderType.setHostID(hostId);
newUnsecuredRequestStaticHeaderType.setPartnerID(partnerId);
newUnsecuredRequestStaticHeaderType.setUserID(userId);
newUnsecuredRequestStaticHeaderType.setProduct(product);
newUnsecuredRequestStaticHeaderType.setOrderDetails(orderDetails);
newUnsecuredRequestStaticHeaderType.setSecurityMedium(securityMedium);
return newUnsecuredRequestStaticHeaderType;
}
use of com.axelor.apps.account.ebics.schema.h003.ProductElementType 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);
}
use of com.axelor.apps.account.ebics.schema.h003.ProductElementType in project axelor-open-suite by axelor.
the class EbicsXmlFactory method creatProductElementType.
/**
* Creates a new <code>ProductElementType</code> XML object
*
* @param language the language
* @param product the product name
* @return the <code>ProductElementType</code> XML object
*/
public static ProductElementType creatProductElementType(String language, String product) {
ProductElementType newProductElementType = ProductElementType.Factory.newInstance();
newProductElementType.setLanguage(language);
newProductElementType.setStringValue(product);
return newProductElementType;
}
Aggregations