Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
nameidblue0

This section describes how a custom provisioning provider payment gateway can be created. 


What does this section cover?

Table of Contents

...

  1. Define the custom payment gateway in payment gateways metadata file.
  2. Create a custom enum to define authentication setting parameters. (optional)
  3. Create a custom business object class extending com.crm.businessobject.paymentgateway.CRMBOPaymentGatewaySettingBean.
  4. Create  a user interface class extending com.crm.process.paymentgateway.CRMUIPaymentGatewaySettingBean
  5. Create a custom process class extending com.crm.process.paymentgateway.CRMProcessPaymentGatewayBean
  6. Create a custom search page.
  7. Create a custom summary page for payment gateway requests.
  8. Create a custom data entry page for the payment gateway.
  9. Define the new menu options in menu options metadata file.
  10. Define a custom module in modules metadata file.

...

  1. . Note that the process class name should start with the custom project directory name

...

  1. .
  2. Set up the payment gateway through the payment gateways page.

For this example we assume that <custom_project> = payeezy  Custom

1. Payment Gateways Metadata File

The new custom payment gateway must be defined in paymentgateways.xml file which is located under <custom_project>/src/main/resources/metadata/ directory. 

Ui expand
titleProvisioning providers metadata file
Code Block
languagexml
titlepaymentgateways.xml
collapsetrue
<paymentgatewaysconfig>
	<paymentgateways>
		<paymentgateway>
			<protocol>PAYEEZY</protocol>
			<name>Payeezy</name>
			<processejbname>ejb/PAYEEZYCRMProcessPayeezyGateway</processejbname>
			<paymentmethods>
				<paymentmethod>
					<type>CREDIT_CARD</type>
					<name>key_credit_card</name>
					<controlVerification>true</controlVerification>
				</paymentmethod>
			</paymentmethods>
			<generalparameters>
				<generalparameter>
					<generalparameterid>mode</generalparameterid>
					<generalparametername>key_mode</generalparametername>
					<generalparametertype>java.lang.String</generalparametertype>
				</generalparameter>
			</generalparameters>
		</paymentgateway>
	</paymentgateways>
</paymentgatewaysconfig>

2. Provisioning Parameters Enum

This enum will be used to define the authentication setting parameters. Note that 'order' property will be used to define the parameter's order on the screen.

Code Block
languagejava
titlePayeezyParameter.java
linenumberstrue
collapsetrue
package payeezy.dataobject.paymentgateway.payeezy;
import com.crm.dataobject.ICRMLookupEnum;

public enum PayeezyParameter implements ICRMLookupEnum{
	
	MODE("key_mode", "String",1),
	TEST_URL("key_url", "String",2),
	TEST_MERCHANT_TOKEN("key_merchant_token", "String",3),
	TEST_TA_TOKEN("key_transarmor_token", "String",4),
	TEST_API_KEY("key_api_key", "String",5),
	TEST_API_SECRET("key_api_secret", "String",6),
	TEST_JS_SECURITY_KEY("key_js_security_key", "String",7),
	LIVE_URL("key_url", "String",2),
	LIVE_MERCHANT_TOKEN("key_merchant_token", "String",3),
	LIVE_TA_TOKEN("key_transarmor_token", "String",4),
	LIVE_API_KEY("key_api_key", "String",5),
	LIVE_API_SECRET("key_api_secret", "String",6),
	LIVE_JS_SECURITY_KEY("key_js_security_key", "String",7);

	private String label;
	private String type;
	private Integer order;
	 
	private PayeezyParameter(String label, String type, Integer order) {
		this.label = label;
		this.type = type;
		this.order = order;
	}
	@Override
	public String getLabel() {
		return label;
	}
	public String getType() {
		return type;
	}
	public Integer getOrder() {
		return order;
	}
}

3. Payment Gateway Business Object Class

The new custom business object class must extend com.crm.businessobject.paymentgateway.CRMBOPaymentGatewaySettingBean

 

Code Block
languagejava
titlePAYEEZYCRMBOPayeezyPaymentGatewaySettingBean.java
linenumberstrue
collapsetrue
package payeezy.businessobject.paymentgateway.payeezy;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import com.crm.businessobject.CRMValidatorBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayParameterBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayParameterValueBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewaySettingBean;
import com.crm.businessobject.platform.CRMBOCurrencyBean;
import com.crm.dataobject.CRMDO;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayParameter;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayParameterValue;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewaySetting;
import com.crm.dataobject.paymentgateway.PaymentGatewayCardBrand;
import com.crm.dataobject.paymentgateway.PaymentGatewayLifeCycleState;
import com.crm.dataobject.platform.CRMDOCurrency;
import com.crm.exception.DAOException;
import com.crm.exception.MandatoryFieldException;
import com.crm.framework.service.ServiceUtil;
import payeezy.dataobject.paymentgateway.payeezy.PayeezyParameter;
import payeezy.dataobject.paymentgateway.payeezy.PayeezyMode;
/**
 * Session Bean implementation class PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean
 */
@Stateless
@LocalBean
public class PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean extends CRMBOPaymentGatewaySettingBean {
       
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@EJB private CRMValidatorBean validatorBean;
	@EJB private CRMBOCurrencyBean currencyBean;
	@EJB private CRMBOPaymentGatewayParameterBean paymentGatewayParameterBean;
	@EJB private CRMBOPaymentGatewayParameterValueBean paymentGatewayParameterValueBean;
	
	public final static String GENERAL_PARAMETERS = "GENERAL_PARAMETERS";
	public final static String PROTOCOL = "PAYEEZY";
	/**
     * @see CRMBOPaymentGatewaySettingBean#CRMBOPaymentGatewaySettingBean()
     */
    public PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean() {
        super();
    }
    /**
     * Constructs a payment gateway setting.
     * 
     * @param mainDTO - the main data object
     * @return a payment gateway setting
     * @throws Exception
     */
	@Override
	protected CRMDO constructDO(CRMDO mainDTO) throws Exception {
		
		CRMDOPaymentGatewaySetting paymentGatewaySetting = (CRMDOPaymentGatewaySetting)super.constructDO(mainDTO);
		
		paymentGatewaySetting.setPaymentGatewayProtocol(PROTOCOL);
		paymentGatewaySetting.setLifeCycleState(PaymentGatewayLifeCycleState.NOT_EFFECTIVE);
		return paymentGatewaySetting;		
	}
	
	
	/**
	 * Validates a payeezy payment gateway setting on save.
	 * 
	 * @param dto - the payment gateway setting to validate
	 * @throws Exception
	 */
	@Override
	protected void validateDOonSave(CRMDO dto) throws Exception {
		super.validateDOonSave(dto);
		CRMDOPaymentGatewaySetting paymentGatewaySetting = (CRMDOPaymentGatewaySetting)dto;			
		validateAuthenticationSettings(paymentGatewaySetting);
	}
    
	
	/**
	 * Validates the authentication settings of the payment gateway setting
     * 
     * @param paymentGatewaySetting - the payment gateway setting to validate
     * @throws Exception
     */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	private void validateAuthenticationSettings(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		if(paymentGatewaySetting.getPaymentGatewayParameters()==null || !ServiceUtil.isInitialized(paymentGatewaySetting.getPaymentGatewayParameters()))
		{
			paymentGatewaySetting.setPaymentGatewayParameters(new HashSet(paymentGatewayParameterBean.load(paymentGatewaySetting)));
		}
		PayeezyMode mode = getMode(paymentGatewaySetting.getPaymentGatewayParameters());
		if(mode==null)
		{
			throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.MODE.getLabel());
		}
		
		if(mode.equals(PayeezyMode.TEST))
		{
			if(!exists(PayeezyParameter.TEST_MERCHANT_TOKEN, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_MERCHANT_TOKEN.getLabel());
			}
			if(!exists(PayeezyParameter.TEST_API_KEY, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_API_KEY.getLabel());
			}
			if(!exists(PayeezyParameter.TEST_API_SECRET, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_API_SECRET.getLabel());
			}
			if(!exists(PayeezyParameter.TEST_URL, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.TEST_URL.getLabel());
			}
		}
		else if(mode.equals(PayeezyMode.LIVE))
		{
			if(!exists(PayeezyParameter.LIVE_MERCHANT_TOKEN, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_MERCHANT_TOKEN.getLabel());
			}
			if(!exists(PayeezyParameter.LIVE_API_KEY, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_API_KEY.getLabel());
			}
			if(!exists(PayeezyParameter.LIVE_API_SECRET, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_API_SECRET.getLabel());
			}
			if(!exists(PayeezyParameter.LIVE_URL, paymentGatewaySetting.getPaymentGatewayParameters()))
			{
				throw new MandatoryFieldException(getCRMSession(), PayeezyParameter.LIVE_URL.getLabel());
			}
		}
	}
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	private PayeezyMode getMode(Set<CRMDOPaymentGatewayParameter> parameters) throws DAOException, Exception{
		PayeezyMode mode = null;
		if(parameters!=null)
		{
			Iterator<CRMDOPaymentGatewayParameter> iter = parameters.iterator();
			while(iter.hasNext())
			{
				CRMDOPaymentGatewayParameter parameter = iter.next();
				if(parameter!=null &&
					
						parameter.getName()!=null &&
						parameter.getName().equals(PayeezyParameter.MODE.toString()))
				{
					Set<CRMDOPaymentGatewayParameterValue> values = parameter.getParameterValues();
					
					if(values==null || !ServiceUtil.isInitialized(values))
					{
						values = new HashSet(paymentGatewayParameterValueBean.load(parameter));
					}
					
					if(values!=null)
					{
						Iterator<CRMDOPaymentGatewayParameterValue> valueIter = values.iterator();
						while(valueIter.hasNext())
						{
							CRMDOPaymentGatewayParameterValue value = valueIter.next();
							if(value!=null)
							{
								mode = PayeezyMode.valueOf(PayeezyMode.class,value.getStringValue());
								break;
							}
						}
					}
				}
				
				if(mode!=null)
				{
					break;
				}
			}
		}
		
		
		return mode;
	}
	
	private boolean exists(PayeezyParameter PayeezyParameter, Set<CRMDOPaymentGatewayParameter> parameters){
		boolean exists = false;
		
		if(parameters!=null)
		{
			for(CRMDOPaymentGatewayParameter parameter:parameters)
			{
				if(parameter!=null &&
						parameter.getName()!=null &&
						parameter.getName().equals(PayeezyParameter.toString()) &&
						parameter.getParameterValues()!=null &&
						parameter.getParameterValues().size()>0)
				{
					
					Iterator<CRMDOPaymentGatewayParameterValue> iter = parameter.getParameterValues().iterator();
					while(iter.hasNext())
					{
						CRMDOPaymentGatewayParameterValue value = iter.next();
						if(value.getStringValue()!=null)
						{
							exists  = true;
							break;
						}
					}
					
					if(exists)
					{
						break;
					}
				}
			}
		}
		
		return exists;
	}
	
	
	/**
	 * Constructs an XML file from a payment gateway setting.
	 * 
	 * @param paymentGatewaySetting - the payment gateway setting to get the values from
	 * @return the payment gateway setting
	 * @throws Exception
	 */
	@Override
	public CRMDOPaymentGatewaySetting setXMLFromObjects(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
			
		return paymentGatewaySetting;
	}
	
	/**
	 * Sets the values of a payment gateway setting from an XML file.
	 * 
	 * @param paymentGatewaySetting - the payment gateway setting to set the values for
	 * @return the updated payment gateway setting
	 * @throws Exception
	 */
	@Override
	public CRMDOPaymentGatewaySetting setObjectsFromXML(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		
		return paymentGatewaySetting;
	}
	
	/**
     * Loads the payeezy payment gateway setting.
     * 
     * @return a payeezy payment gateway setting
     * @throws Exception
     */
	public CRMDOPaymentGatewaySetting load() throws Exception {
		return loadByProtocol(PROTOCOL);
	}
	
	/**
     * Loads the effective payeezy payment gateway setting.
     * 
     * @return the effective payeezy payment gateway setting
     * @throws Exception
     */
	public CRMDOPaymentGatewaySetting loadEffective() throws Exception {
		return loadEffective(PROTOCOL);
	}
	
	/**
     * Loads the effective payeezy payment gateway setting.
     * 
	 * @param applicationServerFiltering - if true, result will be filtered based on allowed application servers
     * @return the effective payeezy payment gateway setting
     * @throws Exception
     */
	public CRMDOPaymentGatewaySetting loadEffective(Boolean applicationServerFiltering) throws Exception {
		return loadEffective(PROTOCOL, applicationServerFiltering);
	}
	
	/**
     * Returns the mandatory fields of a payeezy payment gateway setting.
     * 
     * @param dto - the payeezy payment gateway setting to return the mandatory fields for
     * @return the mandatory fields of the payeezy payment gateway setting
     * @throws Exception
     */
	@Override
	protected LinkedHashMap<String, String> getMandatoryFields(CRMDO dto) throws Exception {
		LinkedHashMap<String, String> mandatoryFields = new LinkedHashMap<String,String>();
		
		mandatoryFields.put("key_name", "name");
		mandatoryFields.put("key_alternative_code", "altCode");
		mandatoryFields.put("key_life_cycle_state", "lifeCycleState");
		mandatoryFields.put("key_payment_gateway", "paymentGatewayProtocol");
	
		return mandatoryFields;
	}
	
	
	/**
	 * Validates the uniqueness of a payment gateway setting.
	 * 
	 * @param paymentGatewaySetting - the payment gateway setting to validate
	 * @throws Exception
	 */
	@Override
	protected void validateUniqueness(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
				
		String[] fieldNames = new String[] {"name", "altCode", "paymentGatewayProtocol"};
		String[] msgKeys = new String[] {"Name", "Alternative Code", "Protocol"};
		
		validatorBean.validateUniqueRecordAgainstDb(
				paymentGatewaySetting, 
				fieldNames, 
				msgKeys, 
				"Payeezy Payment Gateway Setting", 
				true, 
				null);
	}
	@Override
	public CRMDOPaymentGatewaySetting initializeParameters(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception
	{
		return paymentGatewaySetting;
	}
	
	/**
	 * Get the currencies which are supported by payeezy
	 * 
	 * @return a list of all the currencies which are supported by payeezy  
	 * @throws Exception
	 */
	public ArrayList<CRMDO> getSupportedCurrencies(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		
		ArrayList<CRMDO> supportedCurrencies = currencyBean.loadAltenativeCurrencies();
		CRMDOCurrency defaultCurrency = getCRMSession().getGeneralSettings().getDefaultCurrency();
					
		if (supportedCurrencies!=null && supportedCurrencies.size()>0)
		{
			Boolean defaultFound=false;
			for (int i=0; i<supportedCurrencies.size(); i++)
			{
				CRMDOCurrency currency = (CRMDOCurrency) supportedCurrencies.get(i);
				if(currency.equals(defaultCurrency))
				{
					defaultFound=true;
					break;
				}
			}
			
			if(!defaultFound)
			{
				supportedCurrencies.add(defaultCurrency);			
			}
		}
				
		return supportedCurrencies;
	}
	
	/**
	 * Returns the card brand based on the payeezy card type
	 * @param cardType - the given payeezy card type
	 * @return the card brand
	 */
	public String getCardBrand(String cardType){
		String brand = null;
		if(cardType!=null)
		{
			if(cardType.equalsIgnoreCase("American Express"))
			{
				brand = PaymentGatewayCardBrand.AMERICAN_EXPRESS.toString();
			}
			else if(cardType.equalsIgnoreCase("Discover"))
			{
				brand = PaymentGatewayCardBrand.DISCOVER.toString();
			}
			else if(cardType.equalsIgnoreCase("MasterCard"))
			{
				brand = PaymentGatewayCardBrand.MASTER_CARD.toString();
			}
			else if(cardType.equalsIgnoreCase("Visa"))
			{
				brand = PaymentGatewayCardBrand.VISA.toString();
			}
			else
			{
				brand = PaymentGatewayCardBrand.UNKNOWN.toString();
			}
		}
		
		return brand;
	}
	
	/**
	 * Returns the card type based on the card brand
	 * @param cardType - the given card brand
	 * @return the card brand
	 */
	public String getCardType(String brand){
		String cardType = null;
		if(brand!=null)
		{
			if(brand.equals(PaymentGatewayCardBrand.AMERICAN_EXPRESS.toString()))
			{
				cardType ="American Express";
			}
			else if(brand.equals(PaymentGatewayCardBrand.DISCOVER.toString()))
			{
				cardType = "Discover";
			}
			else if(brand.equals(PaymentGatewayCardBrand.MASTER_CARD.toString()))
			{
				cardType = "MasterCard";
			}
			else if(brand.equals(PaymentGatewayCardBrand.VISA.toString()))
			{
				cardType = "Visa";
			}
		}
		
		return cardType;
	}
}

4. User Interface Classes

a. Payment Gateway User Interface Class

The payment gateway user interface class should extend com.crm.process.paymentgateway.CRMUIPaymentGatewaySettingBean.

Code Block
languagejava
titlePAYEEZYCRMUIPayeezyPaymentGatewaySettingBean.java
linenumberstrue
collapsetrue
package payeezy.process.paymentgateway.payeezy;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayCurrencyBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayParameterBean;
import com.crm.businessobject.paymentgateway.CRMBOPaymentGatewayParameterValueBean;
import com.crm.dataobject.CRMDO;
import com.crm.dataobject.financialtransactions.PaymentCancellationType;
import com.crm.dataobject.financialtransactions.PaymentMethod;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayCurrency;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayParameter;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewayParameterValue;
import com.crm.dataobject.paymentgateway.CRMDOPaymentGatewaySetting;
import com.crm.dataobject.paymentgateway.PaymentGatewayLifeCycleState;
import com.crm.dataobject.paymentgateway.PaymentGatewayParameter;
import com.crm.dataobject.platform.CurrenciesScope;
import com.crm.framework.main.LookupBuilder;
import com.crm.process.paymentgateway.CRMUIPaymentGatewaySettingBean;
import payeezy.businessobject.paymentgateway.payeezy.PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean;
import payeezy.dataobject.paymentgateway.payeezy.PayeezyMode;
import payeezy.dataobject.paymentgateway.payeezy.PayeezyParameter;
/**
 * Session Bean implementation class PAYEEZYCRMUIPayeezyPaymentGatewaySettingBean
 */
@Stateless
@LocalBean
public class PAYEEZYCRMUIPayeezyPaymentGatewaySettingBean extends CRMUIPaymentGatewaySettingBean {
       
   
	private static final long serialVersionUID = 1L;
	
	@EJB private PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean payeezyPaymentGatewaySettingBean;
	@EJB private CRMBOPaymentGatewayCurrencyBean paymentGatewayCurrencyBean;
	@EJB private CRMBOPaymentGatewayParameterBean paymentGatewayParameterBean;
	@EJB private CRMBOPaymentGatewayParameterValueBean paymentGatewayParameterValueBean;
	/**
     * @see CRMUIPaymentGatewaySettingBean#CRMUIPaymentGatewaySettingBean()
     */
    public PAYEEZYCRMUIPayeezyPaymentGatewaySettingBean() {
        super();
    }
    
    /**
     * Loads a payment gateway setting form.
     * 
     * @param id - the payment gateway setting id to load
     * @return the loaded form
     * @throws Exception
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public CRMDOPaymentGatewaySetting loadForm(String id) throws Exception {
    	
    	CRMDOPaymentGatewaySetting setting = (CRMDOPaymentGatewaySetting)payeezyPaymentGatewaySettingBean.load(id);
    	
    	setting	= payeezyPaymentGatewaySettingBean.setObjectsFromXML(setting);
    	setting	= payeezyPaymentGatewaySettingBean.initializeParameters(setting);
    	setting = setFinancialInformation(setting);
    	setting.setCurrenciesScope(CurrenciesScope.ALLOW_ALL_CURRENCIES);
    	
    	setting.setPaymentGatewayCurrencies(new HashSet(loadCurrenciesTab(setting)));
    	
    	if((setting.getCurrencies()!=null && setting.getCurrencies().size()>0) ||
    			(setting.getPaymentGatewayCurrencies()!=null && setting.getPaymentGatewayCurrencies().size()>0))
    	{
    		setting.setCurrenciesScope(CurrenciesScope.ALLOW_SPECIFIC_CURRENCIES);
    	}
    	
    	setting = setPaymentGatewayParameters(setting);
    	
    	return setting;
    }
    
    
    /**
     * Loads a payment gateway setting form.
     * 
     * @return the loaded form
     * @throws Exception
     */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public CRMDOPaymentGatewaySetting loadForm() throws Exception {
		
		CRMDOPaymentGatewaySetting setting= payeezyPaymentGatewaySettingBean.load();
		
    	if (setting==null)
    	{
        	setting = createButton();
    	}
    	else
    	{
    		setting = payeezyPaymentGatewaySettingBean.setObjectsFromXML(setting);
        	setting	= payeezyPaymentGatewaySettingBean.initializeParameters(setting);
        	setting = setFinancialInformation(setting);
    	}
    	
    	setting.setCurrenciesScope(CurrenciesScope.ALLOW_ALL_CURRENCIES);
    	
    	setting.setPaymentGatewayCurrencies(new HashSet(loadCurrenciesTab(setting)));
    	
    	if((setting.getCurrencies()!=null && setting.getCurrencies().size()>0) ||
    			(setting.getPaymentGatewayCurrencies()!=null && setting.getPaymentGatewayCurrencies().size()>0))
    	{
    		setting.setCurrenciesScope(CurrenciesScope.ALLOW_SPECIFIC_CURRENCIES);
    	}
    	
    	setting = setPaymentGatewayParameters(setting);
		
		return setting;
		
    }
    
    
    @SuppressWarnings({ "unchecked", "rawtypes" })
	private CRMDOPaymentGatewaySetting setPaymentGatewayParameters(CRMDOPaymentGatewaySetting setting) throws Exception{
    	Set<PaymentGatewayParameter> paymentGatewayParameters = new HashSet<PaymentGatewayParameter>();
    	
    	setting.setPaymentGatewayParameters(new HashSet(paymentGatewayParameterBean.load(setting)));
    	
    	PayeezyParameter[] braintreeParameters = PayeezyParameter.values();
    	for(PayeezyParameter braintreeParameter:braintreeParameters)
    	{
    		PaymentGatewayParameter paymentGatewayParameter = get(setting.getPaymentGatewayParameters(), braintreeParameter, setting);
    		paymentGatewayParameters.add(paymentGatewayParameter);
    	}
    	
    	setting.setGatewayParameters(paymentGatewayParameters);
    	
    	setting = setParametersVisibility(setting);
    	
    	return setting;
    }
    
    
    private PaymentGatewayParameter get(Set<CRMDOPaymentGatewayParameter> parameters, PayeezyParameter braintreeParameter, CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception{
    	PaymentGatewayParameter paymentGatewayParameter = null;
    	CRMDOPaymentGatewayParameter parameter = null;
    	CRMDOPaymentGatewayParameterValue paymentGatewayParameterValue=null;
    	if(parameters!=null)
    	{
    		Iterator<CRMDOPaymentGatewayParameter> iter = parameters.iterator();
    		while(iter.hasNext())
    		{
    			CRMDOPaymentGatewayParameter existingParameter = iter.next();
    			if(existingParameter!=null && existingParameter.getName()!=null && existingParameter.getName().equals(braintreeParameter.toString()))
    			{
    				parameter = existingParameter;
    				ArrayList<CRMDO> paymentGatewayParameterValues= paymentGatewayParameterValueBean.load(parameter);
    				if(paymentGatewayParameterValues!=null && !paymentGatewayParameterValues.isEmpty())
    				{
    					paymentGatewayParameterValue = (CRMDOPaymentGatewayParameterValue) paymentGatewayParameterValues.get(0);
    				}
    				break;
    			}
    		}
    	}

    	if(parameter==null)
    	{
    		parameter =(CRMDOPaymentGatewayParameter) paymentGatewayParameterBean.construct(paymentGatewaySetting);
    		parameter.setType(PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean.GENERAL_PARAMETERS);
    		parameter.setName(braintreeParameter.toString());
    	}
    	
    	if(paymentGatewayParameterValue==null)
    	{
    		paymentGatewayParameterValue=(CRMDOPaymentGatewayParameterValue) paymentGatewayParameterValueBean.construct(parameter);
    	}
    	if(braintreeParameter.equals(PayeezyParameter.MODE) && paymentGatewayParameterValue.getStringValue()==null)
    	{
    		paymentGatewayParameterValue.setStringValue(PayeezyMode.TEST.toString());
    	}
    	parameter.setAlias("name", braintreeParameter.getLabel());
    	
    	paymentGatewayParameter=new PaymentGatewayParameter();
    	paymentGatewayParameter.setParameter(parameter);
    	paymentGatewayParameter.setValue(paymentGatewayParameterValue);
    	paymentGatewayParameter.setType(braintreeParameter.getType());
    	paymentGatewayParameter.setOrder(braintreeParameter.getOrder());
    	return paymentGatewayParameter;
    }
    
    
    
    /**
     * Creates a payment gateway setting.
     * 
     * @return a payment gateway setting.
     * @throws Exception
     */
    public CRMDOPaymentGatewaySetting createButton() throws Exception {
    	return createButton(PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean.PROTOCOL);
    }
    
    /**
     * Creates a payment gateway setting.
     * 
     * @param paymentGateway - the payment gateway to create the payment gateway setting
     * @return a payment gateway setting.
     * @throws Exception
     */
    public CRMDOPaymentGatewaySetting createButton(String paymentGateway) throws Exception {
    	
    	CRMDOPaymentGatewaySetting setting = null;
    	
    	if (paymentGateway!=null)
    	{    	
	    	if (paymentGateway.equals(PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean.PROTOCOL))
	    	{
	    		setting = (CRMDOPaymentGatewaySetting)payeezyPaymentGatewaySettingBean.construct(null);
	    	}
	    	
	    	setting = setPaymentGatewayParameters(setting);
    	}
    	
    	return setting;
    }
    
    
    /**
     * Saves a payment gateway setting.
     * 
     * @param paymentGatewaySetting - the payment gateway setting to save
     * @return the saved payment gateway setting
     * @throws Exception
     */
    public CRMDOPaymentGatewaySetting saveButton(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
    	
    	String paymentGateway = paymentGatewaySetting.getPaymentGatewayProtocol();
    	
    	if (paymentGateway.equals(PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean.PROTOCOL))
    	{
    		paymentGatewaySetting 	= setPaymentGatewayParametersToSave(paymentGatewaySetting);
    		paymentGatewaySetting	= (CRMDOPaymentGatewaySetting)payeezyPaymentGatewaySettingBean.validateOnSave(paymentGatewaySetting);
    		paymentGatewaySetting	= (CRMDOPaymentGatewaySetting)payeezyPaymentGatewaySettingBean.save(paymentGatewaySetting);
    	}
    	return paymentGatewaySetting;
    }
    
    /**
     * Loads a payment gateway setting form.
     * 
     * @param paymentGatewaySetting - the payment gateway setting to load
     * @return the loaded form
     * @throws Exception
     */
	public CRMDOPaymentGatewaySetting editButton(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		return (paymentGatewaySetting!=null && !paymentGatewaySetting.isNew()) ? loadForm(paymentGatewaySetting.getId()) : loadForm();
	}
	
	
	/**
     * Deletes a payment gateway setting.
     * 
     * @param paymentGatewaySetting - the payment gateway setting to delete
     * @return the deleted payment gateway setting 
     * @throws Exception
     */
	public CRMDOPaymentGatewaySetting deleteButton(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		
		String paymentGateway = paymentGatewaySetting.getPaymentGatewayProtocol();
    	
    	if (paymentGateway.equals(PAYEEZYCRMBOPayeezyPaymentGatewaySettingBean.PROTOCOL))
    	{
    		return (CRMDOPaymentGatewaySetting)payeezyPaymentGatewaySettingBean.validateAndDelete(paymentGatewaySetting);
    	}
    	
		return paymentGatewaySetting;
	}
	
	/**
	 * Adds a payment cancellation type to payment gateway setting.
	 * 
	 * @return the loaded payment cancellation type
	 * @throws Exception
	 */
	@Override
	public PaymentCancellationType addPaymentCancellationTypeButton() throws Exception {
		return new PaymentCancellationType();
	}
	/**
	 * Removes a list of payment cancellation types from a payment gateway setting.
	 * 
	 * @param dtoList - a list of payment cancellation types to delete
	 * @return the updated list
	 * @throws Exception
	 */
	@Override
	public ArrayList<CRMDO> removePaymentCancellationTypeButton(ArrayList<CRMDO> dtoList) throws Exception {
		return setDeleted(dtoList);
	}
	
	/**
	 * Adds a payment method to payment gateway setting.
	 * 
	 * @return the loaded payment method
	 * @throws Exception
	 */
	@Override
	public PaymentMethod addPaymentMethodButton() throws Exception {
		return new PaymentMethod();
	}
	/**
	 * Removes a list of payment methods from a payment gateway setting.
	 * 
	 * @param dtoList - a list of payment methods to delete
	 * @return the updated list
	 * @throws Exception
	 */
	@Override
	public ArrayList<CRMDO> removePaymentMethodButton(ArrayList<CRMDO> dtoList) throws Exception {
		return setDeleted(dtoList);
	}
	
	/**
	 * Sets the payment gateway setting's life cycle state to Not Effective
	 * @param paymentGatewaySetting - he payment gateway setting to change its life cycle state
	 * @return the payment gateway setting
	 * @throws Exception
	 */
	public CRMDOPaymentGatewaySetting setNotEffective(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		paymentGatewaySetting.setLifeCycleState(PaymentGatewayLifeCycleState.NOT_EFFECTIVE);
		paymentGatewaySetting = (CRMDOPaymentGatewaySetting) payeezyPaymentGatewaySettingBean.validateOnSave(paymentGatewaySetting);
		paymentGatewaySetting = (CRMDOPaymentGatewaySetting) payeezyPaymentGatewaySettingBean.save(paymentGatewaySetting);
		
		return paymentGatewaySetting;
		
	}
   	
	/**
	 * Loads the payment gateway mode options.
	 *  
	 * @return the payment gateway mode options
	 * @throws Exception
	 */
	public LookupBuilder getModeOptions() throws Exception {
		return getModeOptions(null);
	}
	
	/**
	 * Loads the payment gateway mode options.
	 *  
	 * @param emptyValue - an empty value for mode 
	 * @return the payment gateway mode options
	 * @throws Exception
	 */
	public LookupBuilder getModeOptions(String emptyValue) throws Exception {
		
		LookupBuilder builder = new LookupBuilder();
		
		if (emptyValue!=null)
		{
			builder.build("", emptyValue);
		}
		PayeezyMode[] modes = PayeezyMode.values();
		
		for (int i=0; i<modes.length; i++)
		{
			PayeezyMode mode = modes[i];
			builder.build(mode.toString(), mode.getLabel());
		}
		
		return builder;
	}
	
	/**
	 * Adds a currency to payment gateway setting.
	 * 
	 * @return the newly created payment gateway currency
	 * @throws Exception
	 */
	public CRMDOPaymentGatewayCurrency addCurrencyButton(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		return (CRMDOPaymentGatewayCurrency) paymentGatewayCurrencyBean.construct(paymentGatewaySetting);
	}
	
	/**
	 * Loads the currencies of a payment gateway setting
	 * 
	 * @param paymentGatewaySetting - the payment gateway setting to load the currencies for
	 * @return a list of payment gateway currencies
	 * @throws Exception
	 */
	public ArrayList<CRMDO> loadCurrenciesTab(CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		ArrayList<CRMDO> dtos = paymentGatewayCurrencyBean.load(paymentGatewaySetting);
		return dtos;
	}
	
	/**
	 * Resets the supported currencies of the given payment gateway
	 * @param paymentGateway - the payment gateway to reset the currencies for
	 * @return the updated payment gateway
	 * @throws Exception 
	 */	
	@Override
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public CRMDOPaymentGatewaySetting resetCurrencies(CRMDOPaymentGatewaySetting paymentGateway) throws Exception
	{
		if(paymentGateway.getPaymentGatewayCurrencies()!=null)
		{		
			setDeleted(new ArrayList(paymentGateway.getPaymentGatewayCurrencies()));
		}
		
		return paymentGateway;
	}
	
	public CRMDOPaymentGatewaySetting setParametersVisibility(CRMDOPaymentGatewaySetting paymentGateway) throws Exception
	{
		if(paymentGateway.getGatewayParameters()!=null)
		{		
			PayeezyMode mode = getMode(paymentGateway.getGatewayParameters());
			Iterator<PaymentGatewayParameter> iter = paymentGateway.getGatewayParameters().iterator();
			while(iter.hasNext())
			{
				PaymentGatewayParameter parameter = iter.next();
				if(parameter!=null && 
						parameter.getParameter()!=null &&
						parameter.getParameter().getName()!=null)
				{
					if	(parameter.getParameter().getName().equals(PayeezyParameter.TEST_URL.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.TEST_API_KEY.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.TEST_API_SECRET.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.TEST_JS_SECURITY_KEY.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.TEST_MERCHANT_TOKEN.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.TEST_TA_TOKEN.toString()))
					{
						if(mode!=null && mode.equals(PayeezyMode.TEST))
						{
							parameter.setIsVisible(new Integer(1));
						}
						else if(mode!=null && mode.equals(PayeezyMode.LIVE))
						{
							parameter.setIsVisible(new Integer(0));
						}
					}
					if	(parameter.getParameter().getName().equals(PayeezyParameter.LIVE_URL.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.LIVE_API_KEY.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.LIVE_API_SECRET.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.LIVE_JS_SECURITY_KEY.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.LIVE_MERCHANT_TOKEN.toString()) ||
							parameter.getParameter().getName().equals(PayeezyParameter.LIVE_TA_TOKEN.toString()))
					{
						if(mode!=null && mode.equals(PayeezyMode.TEST))
						{
							parameter.setIsVisible(new Integer(0));
						}
						else if(mode!=null && mode.equals(PayeezyMode.LIVE))
						{
							parameter.setIsVisible(new Integer(1));
						}
					}
					else
					{
						parameter.setIsVisible(new Integer(1));
					}
				}
			}
		}
		return paymentGateway;
	}
	
	private PayeezyMode getMode(Set<PaymentGatewayParameter> paymentGatewayParameters){
		PayeezyMode mode = null;
		if(paymentGatewayParameters!=null)
		{
			Iterator<PaymentGatewayParameter> iter = paymentGatewayParameters.iterator();
			while(iter.hasNext())
			{
				PaymentGatewayParameter parameter = iter.next();
				if(parameter!=null &&
						parameter.getParameter()!=null &&
						parameter.getParameter().getName()!=null &&
						parameter.getParameter().getName().equals(PayeezyParameter.MODE.toString()) &&
						parameter.getValue()!=null &&
						parameter.getValue().getStringValue()!=null)
				{
					mode = PayeezyMode.valueOf(PayeezyMode.class,parameter.getValue().getStringValue());
					break;
				}
			}
		}
		
		
		return mode;
	}
}

5. Provisioning Provider Process Class

a. Create Class and Implement a Method for Each Action

Use @Stateless(mappedName = "ejb/MYCOMPANYCRMProcessTucanoProvider") to define the mapped name of the provisioning provider EJB. The mapped name should match the one defined in provisioningproviders.xml metadata file.

The new process class must extend com.crm.process.provisioning.CRMProcessProviderBean and implement the following methods (which are defined as abstract in CRMProcessProviderBean parent class):

Note that the value of PORVIDER_PROTOCOL must be the same as <provproviderprotocol> tag's value as defined in provisioningproviders.xml 

  1. public String getProtocol()

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProviderBean.java
    linenumberstrue
    collapsetrue
    @Stateless(mappedName = "ejb/MYCOMPANYCRMProcessTucanoProvider")
    @LocalBean
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	
    	public static String PROVIDER_PROTOCOL = "TUCANO";
    	
        /**
         * Default constructor. 
         */
    	public MYCOMPANYCRMProcessTucanoProviderBean() {
            super();
        }
    	public String getProtocol() throws Exception {
    		return PROVIDER_PROTOCOL;
    	}
    	...
    }
  2. public CRMDOProvProvider setObjectsFromXML(CRMDOProvProvider provProvider)

    This method is called whenever loadProvider(), loadEffectiveProvider(String protocol) and loadEffectiveProvider(String protocol , Boolean applicationServerFiltering) methods of CRMProcessProviderBean are called.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    
    	@EJB private MYCOMPANYCRMBOTucanoProviderBean tucanoProviderBean;
    	...
    	public CRMDOProvProvider setObjectsFromXML(CRMDOProvProvider provProvider) throws Exception {
    		
    		provProvider = tucanoProviderBean.setObjectsFromXML(provProvider);
    		
    		return provProvider;
    	}
    	...
    }
  3. public void processAddServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices, ArrayList<ProviderInstalledItem> providerInstalledItems)

    This method is called whenever an 'Add Service' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processAddServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> providerServices, ArrayList<ProviderInstalledItem> providerInstalledItems)throws Exception {
    		
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    	}
    	...
    }
  4. public void processAmendBundleServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)

    This method is called whenever an 'Amend Bundled' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processAmendBundleServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)
    			throws Exception {
    		...
    	}
    	...
    }
  5. public void processRemoveServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)

    This method is called whenever a 'Remove Service' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processRemoveServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		
    		//addedProviderServices in case of regret the swap  
    		//The "Activating an AlphaNetworks Tucano Services Process" is performed for the services that will be restored (i.e. the services that the subscriber had before the service swap)
    		activateTucanoServices(subscriptionAction, provProvider, subscription, addedProviderServices);
    		
    		ArrayList<ProviderService> authorisedServices = getAuthorisedServices(removedProviderServices);
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, authorisedServices);
    	}
    	...
    }
  6. public void processSwapServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices)

    This method is called whenever a 'Swap Service' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processSwapServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderService> addedProviderServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		
    		ArrayList<ProviderService> effectiveServices = getEffectiveServices(addedProviderServices);
    		activateTucanoServices(subscriptionAction, provProvider, subscription, effectiveServices);
    		
    		ArrayList<ProviderService> authorisedServices = getAuthorisedServices(removedProviderServices);
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, authorisedServices);
    	}
    	...
    }
  7. public void processStartServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Start Service' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processStartServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    	}
    	...
    }
  8. public void processStopServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Stop Service' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processStopServiceSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    	}
    	...
    }
  9. public void processAddInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems)

    This method is called whenever an 'Add Installed Item' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processAddInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		addTucanoSTBs(subscriptionAction, provProvider, subscription, providerInstalledItems);
    		
    	}
    	...
    }
  10. public void processRemoveInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems)

    This method is called whenever a 'Remove Installed Item' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processRemoveInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> providerInstalledItems) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		removeTucanoSTBs(subscriptionAction, provProvider, subscription, providerInstalledItems);
    		if(subscription.getLifeCycleState()==null)
    		{
    			subscription.setLifeCycleState(subscriptionBean.getLifeCycleState(subscription, getCurrentDate()));
    		}
    		if(subscription.getLifeCycleState()!=null 
    				&& (subscription.getLifeCycleState().equals(SubscriptionLifeCycleState.CANCELLED) 
    						|| subscription.getLifeCycleState().equals(SubscriptionLifeCycleState.REGRETTED) )
    				&& !installedItemExists(subscription, provProvider))
    		{
    			updateSubscriptionProvisioningParameter(PROVIDER_PROTOCOL, subscription, USERNAME, null, subscription.getNumber(), SubProvProviderLifeCycleState.CANCELLED);
    		}	
    	}
    	...
    }
  11. public void processSwapInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> removedProviderInstalledItems, ArrayList<ProviderInstalledItem> addedProviderInstalledItems)

    This method is called whenever a 'Swap Installed Item' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processSwapInstalledItemSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderInstalledItem> removedProviderInstalledItems,ArrayList<ProviderInstalledItem> addedProviderInstalledItems) throws Exception {
    		
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		addTucanoSTBs(subscriptionAction, provProvider, subscription, addedProviderInstalledItems);
    		
    		removeTucanoSTBs(subscriptionAction, provProvider, subscription, removedProviderInstalledItems);
    	}
    	...
    }
  12. public void processChangeSubscriptionDistributionSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> removedProviderServices, ArrayList<ProviderInstalledItem> removedProviderInstalledItems, ArrayList<ProviderService> addedProviderServices, ArrayList<ProviderInstalledItem> addedProviderInstalledItems)

    This method is called whenever a 'Change Subscription Distribution' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processChangeSubscriptionDistributionSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,
    																		ArrayList<ProviderService> removedProviderServices,
    																		ArrayList<ProviderInstalledItem> removedProviderInstalledItems,
    																		ArrayList<ProviderService> addedProviderServices,
    																		ArrayList<ProviderInstalledItem> addedProviderInstalledItems) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		
    		activateTucanoServices(subscriptionAction, provProvider, subscription, addedProviderServices);
    		
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, removedProviderServices);
    		addTucanoSTBs(subscriptionAction, provProvider, subscription, addedProviderInstalledItems);
    		
    		removeTucanoSTBs(subscriptionAction, provProvider, subscription, removedProviderInstalledItems);
    	}
    	...
    }
  13. public void processBecomeSubscriberSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices, ArrayList<ProviderInstalledItem> providerInstalledItems)

    This method is called whenever a 'Become Subscriber' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processBecomeSubscriberSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,
    														  ArrayList<ProviderService> providerServices, 
    														  ArrayList<ProviderInstalledItem> providerInstalledItems) throws Exception {
    		
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		
    		createNewTucanoAccount(subscriptionAction, provProvider, subscription, providerServices, providerInstalledItems);
    	}
    	...
    }
  14. public void processActivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever an 'Activate Subscription' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processActivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		
    		activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    	}
    	...
    }
  15. public void processDeactivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Deactivate Subscription' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processDeactivateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    	}
    	...
    }
  16. public void processTerminateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Terminate Subscription' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	public static String PROVIDER_PROTOCOL = "TUCANO";
    	public static String USERNAME = "USERNAME";
    	...
    	@Override
    	public void processTerminateSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    		
    		if(!installedItemExists(subscription, provProvider))
    		{
    			updateSubscriptionProvisioningParameter(PROVIDER_PROTOCOL, subscription, USERNAME, null, subscription.getNumber(), SubProvProviderLifeCycleState.CANCELLED);
    		}
    	}
    	...
    }
  17. public void processRestSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Rest Subscription' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processRestSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    		
    	}
    	...
    }
  18. public void processEndSubscriptionRestingSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever an 'End Subscription Resting' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processEndSubscriptionRestingSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    		
    	}
    	...
    }
  19. public void processShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Short Term Activation' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);	
    	}
    	...
    }
  20. public void processEndShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever an 'End Short Term Activation' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processEndShortTermActivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    		
    	}
    	...
    }
  21. public void processShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever a 'Short Term Deactivation' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		deactivateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);	
    	}
    	...
    }
  22. public void processEndShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices)

    This method is called whenever an 'End Short Term Deactivation' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processEndShortTermDeactivationSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderService> providerServices) throws Exception {
    		CRMDOProvProvider provProvider = loadProvider();
    		CRMDOSubscription subscription = subscriptionAction.getSubscription();
    		activateTucanoServices(subscriptionAction, provProvider, subscription, providerServices);
    	}
    	...
    }
  23.  public void processAddServiceUsageSubscriptionAction(CRMDOSubscriptionAction subscriptionAction, ArrayList<ProviderUsageDataRecord> protocolProviderUdrs)

    This method is called whenever an 'Add Service Usage' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processAddServiceUsageSubscriptionAction(CRMDOSubscriptionAction subscriptionAction,ArrayList<ProviderUsageDataRecord> protocolProviderUdrs) throws Exception {
    		...
    	}
    	...
    }
  24. public void processCancelledUDRs(ArrayList<ProviderUsageDataRecord> providerUsageDataRecords)

    This method is called whenever a 'Cancel UDR' action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processCancelledUDRs(ArrayList<ProviderUsageDataRecord> providerUsageDataRecords) throws Exception {
    		...
    	}
    	...
    }
  25. public void processResetSubscription(CRMDOProvProvider provProvider, CRMDOSubscription subscription)

    This method is callled whenever a 'Reset Subscription' subscription action is executed.

    Code Block
    languagejava
    titleMYCOMPANYCRMProcessTucanoProvider.java
    linenumberstrue
    collapsetrue
    public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
    	...
    	@Override
    	public void processResetSubscription(CRMDOProvProvider provProvider, CRMDOSubscription subscription) throws Exception {
    		String processName = ProvisioningRequestProcessName.RESET.toString();
    		
    		if(!isSubscriptionProvisioned(subscription.getId()) && ifSubscriptionServiceProvisionedExists(subscription.getId(), provProvider.getId()))
    		{
    			createNewTucanoAccount(provProvider, subscription, null, null, processName, null);
    		}
    		ArrayList<ProviderService> providerServicesForDeactivation = getProviderServicesForDeactivation(subscription, provProvider);
    		
    		if(providerServicesForDeactivation != null && providerServicesForDeactivation.size() > 0)
    		{
    			deactivateTucanoServices(provProvider, subscription, providerServicesForDeactivation, processName, null);
    		}	
    		
    		ArrayList<ProviderService> providerServicesForActivation = getProviderServicesForActivation(subscription, provProvider);
    		
    		if(providerServicesForActivation != null && providerServicesForActivation.size() > 0)
    		{
    			activateTucanoServices(provProvider, subscription, providerServicesForActivation, processName, null);
    		}
    		
    		ArrayList<ProviderInstalledItem> providerInstalledItemsForActivation = getProviderInstalledItemsForActivation(subscription, provProvider);
    		
    		if(providerInstalledItemsForActivation != null && providerInstalledItemsForActivation.size() > 0)
    		{
    			addTucanoSTBs(provProvider, subscription, providerInstalledItemsForActivation, processName, null);
    		}
    		
    		ArrayList<ProviderInstalledItem> providerInstalledItemsForDeactivation = getProviderInstalledItemsForDeactivation(subscription, provProvider);
    		
    		if(providerInstalledItemsForDeactivation != null && providerInstalledItemsForDeactivation.size() > 0)
    		{
    			removeTucanoSTBs(provProvider, subscription, providerInstalledItemsForDeactivation, processName, null);
    		}
    	}
    	...
    }

b. Create and Process Provisioning Requests

In the following example, you can see how a provisioning request for adding services, can be created and processed.

Code Block
languagejava
titleMYCOMPANYCRMBOTucanoProviderBean.java
linenumberstrue
collapsetrue
public class MYCOMPANYCRMProcessTucanoProviderBean extends CRMProcessProviderBean {
	...
	private CRMDOProvisioningRequest processActivateOptionsProvisioningRequest(		CRMDOProvProvider provProvider, 
																					CRMDOSubscription subscription,
																					CRMDOSubProvProviderParameter subProvProviderParameter,
																					ArrayList<ProviderService> providerServices,
																					String processName, 
																					String processID,
																					TucanoAuthenticationToken tucanoAuthenticationToken) throws Exception {
		
		//The provisioning request parameters to be created 
		HashMap<String,Object> parameterValues = new HashMap<String,Object>();
 
		//The subscription provisioning parameter
		parameterValues.put(ProvisioningRequestParameterType.SUB_PROVISIONING_PARAMETER_ID.toString(), subProvProviderParameter);
		
		//A list of service CA IDs
		ArrayList<Integer> optionIds = new ArrayList<Integer>();
	    ArrayList<CRMDOSubProvisioningDistribution> subProvDistributions = new ArrayList<CRMDOSubProvisioningDistribution>();
		for(int i=0; i<providerServices.size(); i++)
		{
			optionIds.add(new Integer(tucanoProviderBean.getServiceCAID(provProvider,providerServices.get(i).getProduct())));
			subProvDistributions.add(providerServices.get(i).getSubProvisioningDistribution());
		}
 
		//The subscription provisioning distributor linked with the service
		parameterValues.put(ProvisioningRequestParameterType.SERVICE_CA_ID.toString(),optionIds);
		//The subscription service CA ID
		parameterValues.put(ProvisioningRequestParameterType.SERVICE_SUB_PROVISIONING_DISTRIBUTION_ID.toString(),subProvDistributions);
		
		//Create and save the porvisioning request and provisioning request parameters
		CRMDOProvisioningRequest provisioningRequest = createProvisioningRequest(	provProvider,
																					ProvisioningRequestTypeCode.ACTIVATE_OPTIONS.toString(), 
																					getCurrentDate(), 
																					parameterValues, 
																					"addOptions", 
																					null, 
																					processName, 
																					processID, 
																					subscription);
		
		Boolean success = false;
		String request = null;
		String result = null;
		
		//Send request to TUCANO and set values of request, success and result
		{...}
		//
		
		if(success)
		{
			provisioningRequest.setRequest(request+" / "result);
			completeProvisioningRequest(request+" / "result, getCurrentDate(),subProvDistributions,null,null,null,null);
		}
		else
		{
			rejectProvisioningRequest(provisioningRequest, result, subProvDistributions,null,null,null,null);
		}
		
		return provisioningRequest;
	}
	...
}

6. Summary Pages

You will need to create one main summary page for provisioning requests, and two that will be used by the main as drill-downs: one for provisioning request parameters and one for provisioning request process information.

For more information on creating custom summary pages go to Customize Summary Pages.

a. Provisioning Requests

Ui expand
titleProvisioning Requests

Note that PROVPROVIDERS.PROVPROVIDERPROTOCOL must be equal to <provproviderprotocol> tag's value as defined in provisioningproviders.xml file.

Code Block
languagexml
titlerequests.xml
linenumberstrue
collapsetrue
<summary>
	<title>key_provider_requests</title>
	<sql>FROM PROVISIONINGREQUESTS 
		LEFT JOIN USERS CREATEDBY ON CREATEDBY.USERID = PROVISIONINGREQUESTS.PROVREQCREATEDBYUSERID
		LEFT JOIN USERS UPDATEDBY ON UPDATEDBY.USERID = PROVISIONINGREQUESTS.PROVREQUPDATEDBYUSERID
		LEFT JOIN OUUNITS CREATEDBYUNIT ON CREATEDBYUNIT.OUUID = PROVISIONINGREQUESTS.PROVREQCREATEDBYOUUID
		LEFT JOIN OUUNITS UPDATEDBYUNIT ON UPDATEDBYUNIT.OUUID = PROVISIONINGREQUESTS.PROVREQUPDATEDBYOUUID
		LEFT JOIN PROVPROVIDERS ON PROVPROVIDERS.PROVPROVIDERID = PROVISIONINGREQUESTS.PROVPROVIDERID
		LEFT JOIN SUBSCRIPTIONS ON SUBSCRIPTIONS.SUBID = PROVISIONINGREQUESTS.SUBID
		WHERE PROVISIONINGREQUESTS.PROVREQDELETED = 0 AND PROVPROVIDERS.PROVPROVIDERPROTOCOL = 'TUCANO'
	</sql>
	<rowsperpage>20</rowsperpage>
	<primaryfield>PROVISIONINGREQUESTS.PROVREQID</primaryfield>
	<mainlinkfield>PROVREQNUM</mainlinkfield>
	<orderbyfields>PROVISIONINGREQUESTS.PROVREQCREATEDDATE DESC</orderbyfields>
	<multiselect>true</multiselect>
	<module>CUSTOM_TUCANO</module>
	<fieldlist>
		<!-- external filters -->
		<field>
			<fieldname>PROVPROVIDERS.PROVPROVIDERID</fieldname>
			<filtertextoption>equal</filtertextoption>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQID</fieldname>
			<filtertextoption>equal</filtertextoption>
		</field>
		<!-- basic search -->
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQNUM</fieldname>
			<caption>key_number</caption>
			<filter>true</filter>
		</field>
		<field>
			<fieldname>TYPE_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQTYPECODE</fieldfunction>
			<caption>key_type</caption>
			<filter>true</filter>
			<fixedlookup>ejb/MYCOMPANYCRMUITucanoServiceProvisioningRequest.getTypeOptions:key_all</fixedlookup>
		</field>
		<field>
			<fieldname>LIFECYCLESTATE_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.LIFECYCLESTATE</fieldfunction>
			<caption>key_life_cycle_state</caption>
			<filter>true</filter>
			<fixedlookup>ejb/MYCOMPANYCRMUITucanoServiceProvisioningRequest.getLifeCycleStateOptions:key_all</fixedlookup>
		</field>
		<field>
			<fieldname>PRIORITY_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQPRIORITY</fieldfunction>
			<caption>key_priority</caption>
			<filter>true</filter>
			<fixedlookup>ejb/MYCOMPANYCRMUITucanoServiceProvisioningRequest.getPriorityOptions:key_all</fixedlookup>
		</field>
		
		<field>
			<fieldname>SUBSCRIPTIONS.SUBID</fieldname>
			<caption>key_subscription</caption>
			<filter>true</filter>
			<fieldtype>string</fieldtype>
			<filterlookupname>dataset;subscriptions.load;subid;subnum</filterlookupname>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQSCHEDULEDDATE</fieldname>
			<caption>key_scheduled_date</caption>
			<filter>true</filter>
			<fieldtype>date</fieldtype>
			<filtertextoption>range</filtertextoption>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQEXECUTIONDATE</fieldname>
			<caption>key_executed_date</caption>
			<filter>true</filter>
			<fieldtype>date</fieldtype>
			<filtertextoption>range</filtertextoption>
		</field>
		<field>
			<fieldname>PROCESSNAME_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROCESSNAME</fieldfunction>
			<caption>key_process_name</caption>
			<filter>true</filter>
			<filtertextoption>equal</filtertextoption>
			<fixedlookup>ejb/MYCOMPANYCRMUITucanoServiceProvisioningRequest.getProvRequestProcessNameOptions:key_all</fixedlookup>
		</field>
		<field>
			<fieldname>PROCESSID_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROCESSID</fieldfunction>
			<caption>key_process_run</caption>
			<filter>true</filter>
			<filtertextoption>equal</filtertextoption>
				<filterlookupname>dataset;processrun.tucano.load;PROCESSRUNLOGID;PROCESSRUNLOGNUM:PROCESSID:PROCESSRUNLOGSTATUS:PROCESSRUNLOGSTARTDATE:PROCESSRUNLOGENDDATE</filterlookupname>
		</field>
		<field>
			<fieldname>STB_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQID</fieldfunction>
			<caption>key_installed_item</caption>
			<filter>true</filter>
			<fieldtype>string</fieldtype>
			<filtercondition> 
			PROVISIONINGREQUESTS.PROVREQID IN (
				SELECT PROVREQUESTPARAMETERS.PROVREQID FROM PROVREQUESTPARAMETERS
				INNER JOIN INSTALLEDITEMS ON PROVREQPARAMNAME IN (
					'SERVICE_CA_ID',
					'STB_CA_ID'
				)
				AND INSTALLEDITEMS.INSTITEMALTCODE = PROVREQUESTPARAMETERS.PROVREQPARAMCHARVALUE
				WHERE INSTALLEDITEMS.INSTITEMID IN ('#1') 
				AND PROVREQUESTPARAMETERS.PROVREQPARAMDELETED = 0
			)
			</filtercondition>
			<filterlookupname>dataset;inventory.loadinstalleditem;institemid;institemserialnum</filterlookupname>
		</field>
		<!-- advanced search -->
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQERRORCODE</fieldname>
			<caption>key_error_code</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQERRORDESC</fieldname>
			<caption>key_error_description</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
		</field>
		<field>
			<fieldname>CREATEDBYUSER_FILTER</fieldname>
			<fieldfunction>CREATEDBY.USERID</fieldfunction>
			<caption>key_created_by_user</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
			<filterlookupname>dataset;users.load;userid;username:name</filterlookupname>
		</field>
		<field>
			<fieldname>CREATEDBYUNIT_FILTER</fieldname>
			<fieldfunction>CREATEDBYUNIT.OUUID</fieldfunction>
			<caption>key_created_by_unit</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
			<filterlookupname>dataset;networkmanagement.loadunits;ouuid;ouuname:ougname:oucname</filterlookupname>
		</field>
		<field>
			<fieldname>PROVREQCREATEDDATE_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQCREATEDDATE</fieldfunction>
			<fieldtype>date</fieldtype>
			<caption>key_date_created</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
			<filtertextoption>range</filtertextoption>
		</field>
		<field>
			<fieldname>UPDATEDBYUSER_FILTER</fieldname>
			<fieldfunction>UPDATEDBY.USERID</fieldfunction>
			<caption>key_updated_by_user</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
			<filterlookupname>dataset;users.load;userid;username:name</filterlookupname>
		</field>
		<field>
			<fieldname>UPDATEDBYUNIT_FILTER</fieldname>
			<fieldfunction>UPDATEDBYUNIT.OUUID</fieldfunction>
			<caption>key_updated_by_unit</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
			<filterlookupname>dataset;networkmanagement.loadunits;ouuid;ouuname:ougname:oucname</filterlookupname>
		</field>
		<field>
			<fieldname>PROVREQUPDATEDDATE_FILTER</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQUPDATEDDATE</fieldfunction>
			<fieldtype>date</fieldtype>
			<caption>key_date_updated</caption>
			<filter>true</filter>
			<filteronexpand>true</filteronexpand>
			<filtertextoption>range</filtertextoption>
		</field>
		<!-- fields -->
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQNUM</fieldname>
			<caption>key_number</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>TYPE</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQTYPECODE</fieldfunction>
			<caption>key_type</caption>
			<summary>true</summary>
			<fixedlookup>ejb/CRMUITucanoServiceProvisioningRequest.getTypeOptions:key_n/a</fixedlookup>
		</field>
		<field>
			<fieldname>LIFECYCLESTATE</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.LIFECYCLESTATE</fieldfunction>
			<caption>key_life_cycle_state</caption>
			<summary>true</summary>
			<fixedlookup>ejb/CRMUITucanoServiceProvisioningRequest.getLifeCycleStateOptions:key_n/a</fixedlookup>
		</field>
		<field>
			<fieldname>SCHEDULEDDATE</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQSCHEDULEDDATE</fieldfunction>
			<caption>key_scheduled_date</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>EXECUTIONDATE</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQEXECUTIONDATE</fieldfunction>
			<caption>key_executed_date</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>SUBSCRIPTIONS.SUBNUM</fieldname>
			<caption>key_subscription</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>CREATEDBYUSERNAME</fieldname>
			<fieldfunction>CREATEDBY.USERNAME</fieldfunction>
			<caption>key_created_by_user</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>UPDATEDBYUSERNAME</fieldname>
			<fieldfunction>UPDATEDBY.USERNAME</fieldfunction>
			<caption>key_updated_by_user</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>CREATEDBYUNITOUUNAME</fieldname>
			<fieldfunction>CREATEDBYUNIT.OUUNAME</fieldfunction>
			<caption>key_created_by_unit</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>UPDATEDBYUNITOUUNAME</fieldname>
			<fieldfunction>UPDATEDBYUNIT.OUUNAME</fieldfunction>
			<caption>key_updated_by_unit</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQCREATEDDATE</fieldname>
			<fieldtype>date</fieldtype>
			<caption>key_date_created</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQUPDATEDDATE</fieldname>
			<fieldtype>date</fieldtype>
			<caption>key_date_updated</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQREQUEST</fieldname>
			<caption>key_request</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQRESPONSE</fieldname>
			<caption>key_response</caption>
			<expand>true</expand>
		</field>
		<!-- drilldowns -->
		<field>
			<fieldname>PARAMETERS_DD</fieldname>
			<fieldfunction>''</fieldfunction>
			<caption>key_parameters</caption>
			<summary>true</summary>
			<fieldtype>label</fieldtype>
			<label>key_parameters</label>
			<link>drilldown:provisioning/tucano/request_parameters;hidefilters~true~PROVREQUESTPARAMETERS.PROVREQID~((PROVISIONINGREQUESTS.PROVREQID))</link>
		</field>
		<field>
			<fieldname>PROCESSINFORMATION_DD</fieldname>
			<fieldfunction>''</fieldfunction>
			<caption>key_process_information</caption>
			<summary>true</summary>
			<fieldtype>label</fieldtype>
			<label>key_process_information</label>
			<link>drilldown:provisioning/tucano/request_processInformation;hidefilters~true~PROVISIONINGREQUESTS.PROVREQID~((PROVISIONINGREQUESTS.PROVREQID))</link>
		</field>
	</fieldlist>
</summary>

Image Removed

b. Provisioning Request Parameters

Ui expand
titleProvisioning Parameters
Code Block
languagexml
titlerequest_parameters.xml
linenumberstrue
collapsetrue
<summary>
	<title>key_provisioning_request_parameters</title>
	<sql>FROM PROVREQUESTPARAMETERS
		LEFT JOIN USERS CREATEDBY ON CREATEDBY.USERID = PROVREQUESTPARAMETERS.PROVREQPARAMCREATEDBYUSERID
		LEFT JOIN USERS UPDATEDBY ON UPDATEDBY.USERID = PROVREQUESTPARAMETERS.PROVREQPARAMUPDATEDBYUSERID
		LEFT JOIN OUUNITS CREATEDBYUNIT ON CREATEDBYUNIT.OUUID = PROVREQUESTPARAMETERS.PROVREQPARAMCREATEDBYOUUID
		LEFT JOIN OUUNITS UPDATEDBYUNIT ON UPDATEDBYUNIT.OUUID = PROVREQUESTPARAMETERS.PROVREQPARAMUPDATEDBYOUUID
		LEFT JOIN PROVISIONINGREQUESTS ON PROVISIONINGREQUESTS.PROVREQID = PROVREQUESTPARAMETERS.PROVREQID
		WHERE PROVREQUESTPARAMETERS.PROVREQPARAMDELETED = 0
	</sql>
	<rowsperpage>20</rowsperpage>
	<primaryfield>PROVREQUESTPARAMETERS.PROVREQPARAMID</primaryfield>
	<mainlinkfield>PROVREQUESTPARAMETERS.PROVREQPARAMID</mainlinkfield>
	<autosearch>true</autosearch>
	<hidefindbutton>true</hidefindbutton>
	<module>CUSTOM_TUCANO</module>
	<fieldlist>
		<!-- external filters -->
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQID</fieldname>
			<filtertextoption>equal</filtertextoption>
		</field>
		<!-- basic search -->
		<!-- advanced search -->
		<!-- fields -->
		<field>
			<fieldname>TYPE</fieldname>
			<fieldfunction>PROVREQUESTPARAMETERS.PROVREQPARAMNAME</fieldfunction>
			<caption>key_name</caption>
			<summary>true</summary>
			<fixedlookup>ejb/MYCOMPANYCRMUITucanoServiceProvisioningRequest.getParameterTypeOptions:key_n/a</fixedlookup>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMSTRINGVALUE</fieldname>
			<caption>key_string_value</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMINTEGERVALUE</fieldname>
			<caption>key_integer_value</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMDATEVALUE</fieldname>
			<caption>key_date_value</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMFLOATVALUE</fieldname>
			<caption>key_float_value</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMCHARVALUE</fieldname>
			<caption>key_char_value</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>CREATEDBYUSERNAME</fieldname>
			<fieldfunction>CREATEDBY.USERNAME</fieldfunction>
			<caption>key_created_by_user</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>UPDATEDBYUSERNAME</fieldname>
			<fieldfunction>UPDATEDBY.USERNAME</fieldfunction>
			<caption>key_updated_by_user</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>CREATEDBYUNITOUUNAME</fieldname>
			<fieldfunction>CREATEDBYUNIT.OUUNAME</fieldfunction>
			<caption>key_created_by_unit</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>UPDATEDBYUNITOUUNAME</fieldname>
			<fieldfunction>UPDATEDBYUNIT.OUUNAME</fieldfunction>
			<caption>key_updated_by_unit</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMCREATEDDATE</fieldname>
			<fieldtype>date</fieldtype>
			<caption>key_date_created</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVREQUESTPARAMETERS.PROVREQPARAMUPDATEDDATE</fieldname>
			<fieldtype>date</fieldtype>
			<caption>key_date_updated</caption>
			<expand>true</expand>
		</field>
		<!-- drilldowns -->
	</fieldlist>
</summary>

Image Removed

c. Provisioning Request Process Information

Ui expand
titleProcess Information
Code Block
languagexml
titlerequest_parameters.xml
linenumberstrue
collapsetrue
<summary>
	<title>key_provisioning_request_parameters</title>
	<sql>FROM PROVISIONINGREQUESTS
		LEFT JOIN USERS CREATEDBY ON CREATEDBY.USERID = PROVISIONINGREQUESTS.PROVREQCREATEDBYUSERID
		LEFT JOIN USERS UPDATEDBY ON UPDATEDBY.USERID = PROVISIONINGREQUESTS.PROVREQUPDATEDBYUSERID
		LEFT JOIN OUUNITS CREATEDBYUNIT ON CREATEDBYUNIT.OUUID = PROVISIONINGREQUESTS.PROVREQCREATEDBYOUUID
		LEFT JOIN OUUNITS UPDATEDBYUNIT ON UPDATEDBYUNIT.OUUID = PROVISIONINGREQUESTS.PROVREQUPDATEDBYOUUID
		LEFT JOIN PROCESSRUNLOG ON PROCESSRUNLOG.PROCESSRUNLOGID = PROVISIONINGREQUESTS.PROCESSID
		WHERE 1 = 1
	</sql>
	<rowsperpage>20</rowsperpage>
	<primaryfield>PROVISIONINGREQUESTS.PROVREQID</primaryfield>
	<mainlinkfield>PROVISIONINGREQUESTS.PROVREQID</mainlinkfield>
	<autosearch>true</autosearch>
	<hidefindbutton>true</hidefindbutton>
	<module>CUSTOM_TUCANO</module>
	<fieldlist>
		<!-- external filters -->
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQID</fieldname>
			<filtertextoption>equal</filtertextoption>
		</field>
		<!-- basic search -->
		<!-- advanced search -->
		<!-- fields -->
		<field>
			<fieldname>PROCESSNAME</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROCESSNAME</fieldfunction>
			<caption>key_process_name</caption>
			<summary>true</summary>
			<fixedlookup>ejb/MYCOMPANYCRMUITucanoServiceProvisioningRequest.getProvRequestProcessNameOptions:key_n/a</fixedlookup>
		</field>
		<field>
			<fieldname>PROCESSRUNDEFINITION</fieldname>
			<fieldfunction>PROCESSRUNLOG.PROCESSRUNLOGNUM</fieldfunction>
			<caption>key_process_run</caption>
			<summary>true</summary>
		</field>
		
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQPROVREFNUM</fieldname>
			<caption>key_reference_number</caption>
			<summary>true</summary>
		</field>
		<field>
			<fieldname>PRIORITY</fieldname>
			<fieldfunction>PROVISIONINGREQUESTS.PROVREQPRIORITY</fieldfunction>
			<caption>key_priority</caption>
			<summary>true</summary>
			<fixedlookup>ejb/CRMUITucanoServiceProvisioningRequest.getPriorityOptions:key_n/a</fixedlookup>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQERRORCODE</fieldname>
			<caption>key_error_code</caption>
			<summary>true</summary>
		</field>

		<field>
			<fieldname>CREATEDBYUSERNAME</fieldname>
			<fieldfunction>CREATEDBY.USERNAME</fieldfunction>
			<caption>key_created_by_user</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>UPDATEDBYUSERNAME</fieldname>
			<fieldfunction>UPDATEDBY.USERNAME</fieldfunction>
			<caption>key_updated_by_user</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>CREATEDBYUNITOUUNAME</fieldname>
			<fieldfunction>CREATEDBYUNIT.OUUNAME</fieldfunction>
			<caption>key_created_by_unit</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>UPDATEDBYUNITOUUNAME</fieldname>
			<fieldfunction>UPDATEDBYUNIT.OUUNAME</fieldfunction>
			<caption>key_updated_by_unit</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQCREATEDDATE</fieldname>
			<fieldtype>date</fieldtype>
			<caption>key_date_created</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQUPDATEDDATE</fieldname>
			<fieldtype>date</fieldtype>
			<caption>key_date_updated</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQERRORDESC</fieldname>
			<caption>key_error_description</caption>
			<expand>true</expand>
		</field>
		<field>
			<fieldname>PROVISIONINGREQUESTS.PROVREQREQUEST</fieldname>
			<caption>key_request</caption>
			<summary>false</summary>
			<expand>true</expand>
			<available>true</available>
			<filter>false</filter>
		</field>
		<!-- drilldowns -->
	</fieldlist>
</summary>

Image Removed

7. Data Entry Page

You will need to create one data entry page for the provisioning provider. For more information on creating custom data entry pages go to Customize Data Entry Pages.

Ui expand
titleProvisioning Provider

Note that, generic components should be used for Log Information and Allowed Application Servers sections.

Code Block
titleproviderCustom.xml
linenumberstrue
collapsetrue
<page>
	<id>provisioning/tucano/provider</id>
	<name>key_provisioning_provider</name>
	<datapath>number</datapath>
	<module>CUSTOM_TUCANO</module>
	<functioncall>
		<functions>
			<function>
			</function>
		</functions>
	</functioncall>
	<datasources>
		<datasource>
			<key>form</key>
			<classname>com.crm.web.generator.datasource.DTODatasource</classname>
		</datasource>
	</datasources>
	<mainmenu>
		<components>
			<component>
				<id>cmpEdit</id>
				<name>key_edit</name>
				<visiblemodes>read</visiblemodes>
				<elements>
					<button>
						<id>btnEdit</id>
						<name>key_edit</name>
						<visibilityconditions>'[[getValue,java.lang.String,isEditable]]'!='0'</visibilityconditions>
						<setmode>edit</setmode>
						<refresh>page</refresh>
						<disableonclick>true</disableonclick>
						<functioncall>
							<functions>
								<function>
									<type>ejb</type>
									<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
									<functionname>editButton</functionname>
									<resultaction>replace</resultaction>
									<datatype>root</datatype>
									<parameters>
										<parameter>
											<value>[[getDTO]]</value>
											<datatype>java.lang.Object</datatype>
										</parameter>
									</parameters>
								</function>
							</functions>
						</functioncall>
					</button>
					<button>
						<id>btnEdit</id>
						<name>key_edit</name>
						<visibilityconditions>'[[getValue,java.lang.String,isEditable]]'=='0'</visibilityconditions>
						<style>TopToolbarItemsDisabled</style>
					</button>
				</elements>
			</component>
			<component>
				<id>cmpSave</id>
				<name>key_save</name>
				<visiblemodes>edit,new</visiblemodes>
				<elements>
					<button>
						<id>btnSave</id>
						<name>key_save</name>
						<setmode>read</setmode>
						<refresh>page</refresh>
						<functioncall>
							<functions>
								<function>
									<type>ejb</type>
									<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
									<functionname>saveButton</functionname>
									<resultaction>replace</resultaction>
									<datatype>root</datatype>
									<parameters>
										<parameter>
											<value>[[getDTO]]</value>
											<datatype>java.lang.Object</datatype>
										</parameter>
									</parameters>
								</function>
							</functions>
						</functioncall>
					</button>
				</elements>
			</component>
			<component>
				<id>cmpCancel</id>
				<name>key_cancel</name>
				<visiblemodes>edit,new</visiblemodes>
				<elements>
					<button>
						<id>btnCancel</id>
						<name>key_cancel</name>
						<setmode>read</setmode>
						<refresh>page</refresh>
						<disableonclick>true</disableonclick>
						<functioncall>
							<functions>
								<function>
									<type>ejb</type>
									<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
									<functionname>loadForm</functionname>
									<resultaction>replace</resultaction>
									<datatype>root</datatype>
								</function>
							</functions>
						</functioncall>
					</button>
				</elements>
			</component>
		</components>
	</mainmenu>
	<main>
		<components>
			<component>
				<id>cmpName</id>
				<name>key_name</name>
				<elements>
					<textbox>
						<id>txtName</id>
						<label>key_name</label>
						<datapath>name</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			<component>
				<id>cmpProvisioningProtocol</id>
				<name>key_provisioning_protocol</name>
				<elements>
					<textbox>
						<id>txtProvisioningProtocol</id>
						<label>key_provisioning_protocol</label>
						<datapath>protocol</datapath>
						<datatype>java.lang.String</datatype>
						<readonly>true</readonly>
					</textbox>
				</elements>
			</component>
			<component>
				<id>cmpAltCode</id>
				<name>key_alternative_code</name>
				<elements>
					<textbox>
						<id>txtAltCode</id>
						<label>key_alternative_code</label>
						<datapath>altCode</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			<component>
				<id>cmpLifeCycleState</id>
				<name>key_life_cycle_state</name>
				<elements>
					<selectbox>
						<id>slbLifeCycleState</id>
						<label>key_life_cycle_state</label>
						<lookuptype>ejb</lookuptype>
						<datapath>lifeCycleState</datapath>
						<datatype>enum</datatype>
						<refresh>page</refresh>
						<classname>com.crm.dataobject.provisioning.ProvProviderLifeCycleState</classname>
						<reload>true</reload>
						<onload>
							<type>ejb</type>
							<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
							<functionname>getLifeCycleStateOptions</functionname>
						</onload>
					</selectbox>
				</elements>
			</component>
			<component>
				<id>cmpURL</id>
				<name>key_url</name>
				<elements>
					<textbox>
						<id>txtURL</id>
						<label>key_url</label>
						<datapath>provisioningParameters/url</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpIdentityKey</id>
				<name>key_identity_key</name>
				<elements>
					<password>
						<id>pswIdentityKey</id>
						<label>key_identity_key</label>
						<datapath>provisioningParameters/identityKey</datapath>
						<datatype>java.lang.String</datatype>
					</password>
				</elements>
			</component>
			
			<component>
				<id>cmpUsername</id>
				<name>key_username</name>
				<elements>
					<textbox>
						<id>txtUsername</id>
						<label>key_username</label>
						<datapath>provisioningParameters/username</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpPassword</id>
				<name>key_password</name>
				<elements>
					<password>
						<id>pswPassword</id>
						<label>key_password</label>
						<datapath>provisioningParameters/password</datapath>
						<datatype>java.lang.String</datatype>
					</password>
				</elements>
			</component>
			
			<component>
				<id>cmpAddressCountry</id>
				<name>key_address_country</name>
				<elements>
					<textbox>
						<id>txtAddressCountry</id>
						<label>key_address_country</label>
						<datapath>provisioningParameters/addressCountry</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpLanguageID</id>
				<name>key_language_id</name>
				<elements>
					<textbox>
						<id>txtLanguageID</id>
						<label>key_language_id</label>
						<datapath>provisioningParameters/languageID</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpDefaultProductID</id>
				<name>key_default_product_id</name>
				<elements>
					<textbox>
						<id>txtDefaultProductID</id>
						<label>key_default_product_id</label>
						<datapath>provisioningParameters/defaultProductID</datapath>
						<datatype>java.lang.Integer</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpSTBMaterialID</id>
				<name>key_stb_material_id</name>
				<elements>
					<textbox>
						<id>txtSTBMaterialID</id>
						<label>key_stb_material_id</label>
						<datapath>provisioningParameters/stbMaterialID</datapath>
						<datatype>java.lang.Integer</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpProviderID</id>
				<name>key_provider_id</name>
				<elements>
					<textbox>
						<id>txtProviderID</id>
						<label>key_provider_id</label>
						<datapath>provisioningParameters/providerID</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpTVEAdapter</id>
				<name>key_tve_adapter</name>
				<elements>
					<textbox>
						<id>txtTVEAdapter</id>
						<label>key_tve_adapter</label>
						<datapath>provisioningParameters/tveAdapter</datapath>
						<datatype>java.lang.String</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpJWTKey</id>
				<name>key_jwt_key</name>
				<elements>
					<password>
						<id>pswJWTKey</id>
						<label>key_jwt_key</label>
						<datapath>provisioningParameters/jwtKey</datapath>
						<datatype>java.lang.String</datatype>
					</password>
				</elements>
			</component>
			
			<component>
				<id>cmpJWTExpirationTime</id>
				<name>key_jwt_expiration_time_in_seconds</name>
				<elements>
					<textbox>
						<id>txtJWTExpirationTime</id>
						<label>key_jwt_expiration_time_in_seconds</label>
						<datapath>provisioningParameters/jwtExpirationTimeInSeconds</datapath>
						<datatype>java.lang.Integer</datatype>
					</textbox>
				</elements>
			</component>
			
			<component>
				<id>cmpDistributorsDrilldown</id>
				<name>key_distributors</name>
				<elements>
					<drilldown>
						<id>ddDistributors</id>
						<tabid>tabDistributors</tabid>
					</drilldown>
				</elements>
			</component>
			
			<component>
				<id>cmpServicesDrilldown</id>
				<name>key_services</name>
				<elements>
					<drilldown>
						<id>ddServices</id>
						<tabid>tabServices</tabid>
					</drilldown>
				</elements>
			</component>
			
			<component>
				<id>cmpDevicesDrilldown</id>
				<name>key_devices</name>
				<elements>
					<drilldown>
						<id>ddDevices</id>
						<tabid>tabDevices</tabid>
					</drilldown>
				</elements>
			</component>
		</components>
	</main>
	<details>
		<tabs>
			<tab>
				<id>tabDevices</id>
				<name>key_stb</name>
				<reload>true</reload>
				<datasourcesetkey>physicalGoods</datasourcesetkey>
				<rowvisibilityconditions>
				'[[getValue,java.lang.String,physicalGoods[CURRENT_ROW]/value]]'=='DECODER'
				</rowvisibilityconditions>
				<functioncall>
					<functions>
						<function>
							<type>ejb</type>
							<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
							<functionname>loadPhysicalGoodsTab</functionname>
							<resultaction>setreplace</resultaction>
							<datapath>physicalGoods</datapath>
							<datasourcesetkey>physicalGoods</datasourcesetkey>
							<parameters>
								<parameter>
									<value>[[getDTO]]</value>
									<datatype>java.lang.Object</datatype>
								</parameter>
							</parameters>
						</function>
					</functions>
				</functioncall>
				<tabmenu>
					<components>
						<component>
							<id>cmpAdd</id>
							<name>key_add</name>
							<visiblemodes>edit,new</visiblemodes>
							<elements>
								<modal>
									<id>mdlAdd</id>
									<name>key_add</name>
									<type>search</type>
									<refresh>tab,tabDevices</refresh>
									<datasetname>products.loadtypes</datasetname>
									<datasetreturnhiddenfield>PRODTYPEID</datasetreturnhiddenfield>
									<filter>PRODUCTTYPES.PRODTYPECLASSIFICATION='PHYSICALGOODS'</filter>
									<assignments>
										<assignment>
											<datapath>modal</datapath>
											<datatype>alias</datatype>
										</assignment>
									</assignments>
									<onclosefunction>
										<functions>
											<function>
												<type>ejb</type>
												<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
												<functionname>addSetTopBoxButton</functionname>
												<resultaction>setappend</resultaction>
												<datapath>physicalGoods</datapath>
												<datasourcesetkey>physicalGoods</datasourcesetkey>
												<parameters>
													<parameter>
														<value>[[getDTO]]</value>
														<datatype>java.lang.Object</datatype>
													</parameter>
													<parameter>
														<value>[[getAlias,java.lang.String,modal]]</value>
														<datatype>java.util.ArrayList</datatype>
													</parameter>
												</parameters>
											</function>
										</functions>
									</onclosefunction>
								</modal>
							</elements>
						</component>
						<component>
							<id>cmpRemove</id>
							<name>key_remove</name>
							<visiblemodes>edit,new</visiblemodes>
							<elements>
								<button>
									<id>btnRemove</id>
									<name>key_remove</name>
									<refresh>tab,tabDevices</refresh>
									<functioncall>
										<functions>
											<function>
												<type>ejb</type>
												<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
												<functionname>removePhysicalGoodButton</functionname>
												<datasourcesetkey>physicalGoods</datasourcesetkey>
												<resultaction>markdeleted</resultaction>
												<parameters>
													<parameter>
														<value>[[getSelectedDTOs,java.lang.String,physicalGoods]]</value>
														<datatype>java.lang.Object</datatype>
													</parameter>
												</parameters>
											</function>
										</functions>
									</functioncall>
								</button>
							</elements>
						</component>
					</components>
				</tabmenu>
				<components>
					<component>
						<id>cmpSelect</id>
						<name />
						<elements>
							<rowselector>
								<id>rowID</id>
								<datapath>id</datapath>
							</rowselector>
						</elements>
					</component>
					<component>
						<id>cmpProductType</id>
						<name>key_product_type</name>
						<elements>
							<textbox>
								<id>txtProduct</id>
								<datapath>productType/name</datapath>
								<readonly>true</readonly>
							</textbox>
						</elements>
					</component>
					<component>
						<id>cmpProductDescription</id>
						<name>key_description</name>
						<elements>
							<textbox>
								<id>txtProductDescription</id>
								<datapath>productType/description</datapath>
								<readonly>true</readonly>
							</textbox>
						</elements>
					</component>
				</components>
			</tab>
			
			<tab>
				<id>tabServices</id>
				<name>key_services</name>
				<datasourcesetkey>services</datasourcesetkey>
				<functioncall>
					<functions>
						<function>
							<type>ejb</type>
							<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
							<functionname>loadServicesTab</functionname>
							<resultaction>setreplace</resultaction>
							<datapath>services</datapath>
							<datasourcesetkey>services</datasourcesetkey>
							<parameters>
								<parameter>
									<value>[[getDTO]]</value>
									<datatype>java.lang.Object</datatype>
								</parameter>
							</parameters>
						</function>
					</functions>
				</functioncall>
				<tabmenu>
					<components>
						<component>
							<id>cmpAdd</id>
							<name>key_add</name>
							<visiblemodes>edit,new</visiblemodes>
							<elements>
								<modal>
									<id>mdlAdd</id>
									<name>key_add</name>
									<type>search</type>
									<refresh>tab,tabServices;tab,tabDistributors</refresh>
									<datasetname>products.loadservices</datasetname>
									<datasetreturnhiddenfield>PRODID</datasetreturnhiddenfield>
									<assignments>
										<assignment>
											<datapath>modal</datapath>
											<datatype>alias</datatype>
										</assignment>
									</assignments>
									<onclosefunction>
										<functions>
											<function>
												<type>ejb</type>
												<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
												<functionname>addServiceButton</functionname>
												<resultaction>setappend</resultaction>
												<datapath>services</datapath>
												<datasourcesetkey>services</datasourcesetkey>
												<parameters>
													<parameter>
														<value>[[getDTO]]</value>
														<datatype>java.lang.Object</datatype>
													</parameter>
													<parameter>
														<value>[[getAlias,java.lang.String,modal]]</value>
														<datatype>java.util.ArrayList</datatype>
													</parameter>
												</parameters>
											</function>
										</functions>
									</onclosefunction>
								</modal>
							</elements>
						</component>
						<component>
							<id>cmpRemove</id>
							<name>key_remove</name>
							<visiblemodes>new,edit</visiblemodes>
							<elements>
								<button>
									<id>btnRemove</id>
									<name>key_remove</name>
									<refresh>tab,tabServices;tab,tabDistributors</refresh>
									<functioncall>
										<functions>
											<function>
												<type>ejb</type>
												<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
												<functionname>removeServiceButton</functionname>
												<datasourcesetkey>services</datasourcesetkey>
												<resultaction>markdeleted</resultaction>
												<parameters>
													<parameter>
														<value>[[getSelectedDTOs,java.lang.String,services]]</value>
														<datatype>java.lang.Object</datatype>
													</parameter>
												</parameters>
											</function>
										</functions>
									</functioncall>
								</button>
							</elements>
						</component>
					</components>
				</tabmenu>
				<components>
					<component>
						<id>cmpSelect</id>
						<name/>
						<elements>
							<rowselector>
								<id>rowID</id>
								<datapath>id</datapath>
							</rowselector>
						</elements>
					</component>
					<component>
						<id>cmpProduct</id>
						<name>key_product</name>
						<elements>
							<textbox>
								<id>txtProduct</id>
								<datapath>product/code</datapath>
								<readonly>true</readonly>
							</textbox>
						</elements>
					</component>
					<component>
						<id>cmpProductDescription</id>
						<name>key_description</name>
						<elements>
							<textbox>
								<id>txtProductDescription</id>
								<datapath>product/description</datapath>
								<readonly>true</readonly>
							</textbox>
						</elements>
					</component>
					<component>
						<id>cmpProductIdentifier</id>
						<name>key_provisioning_system_identifier</name>
						<elements>
							<textbox>
								<id>txtProductIdentifier</id>
								<datapath>value</datapath>
							</textbox>
						</elements>
					</component>
				</components>
			</tab>
			<tab>
				<id>tabDistributors</id>
				<name>key_distributors</name>
				<datasourcesetkey>provisioningDistributors</datasourcesetkey>
				<functioncall>
					<functions>
						<function>
							<type>ejb</type>
							<classname>ejb/MYCOMPANYCRMUITucanoServiceProvider</classname>
							<functionname>loadDistributorsTab</functionname>
							<resultaction>setreplace</resultaction>
							<datapath>provisioningDistributors</datapath>
							<datasourcesetkey>provisioningDistributors</datasourcesetkey>
							<parameters>
								<parameter>
									<value>[[getDTO]]</value>
									<datatype>java.lang.Object</datatype>
								</parameter>
							</parameters>
						</function>
					</functions>
				</functioncall>
				<components>
					
					<component>
						<id>cmpDistributorName</id>
						<name>key_name</name>
						<elements>
							<textbox>
								<id>txtDistributorName</id>
								<datapath>name</datapath>
							</textbox>
						</elements>
					</component>
					<component>
						<id>cmpDistributorAltCode</id>
						<name>key_alternative_code</name>
						<elements>
							<textbox>
								<id>txtDistributorAltCode</id>
								<datapath>altCode</datapath>
							</textbox>
						</elements>
					</component>
					<component>
						<id>cmpDistributorDescription</id>
						<name>key_description</name>
						<elements>
							<textbox>
								<id>txtDistributorDescription</id>
								<datapath>description</datapath>
							</textbox>
						</elements>
					</component>
				</components>
			</tab>
		</tabs>
	</details>
</page>
Code Block
titleproviderCustomlayout.xml
linenumberstrue
collapsetrue
<page>
	<mainmenu>
		<components>
			<component><id>cmpEdit</id></component>
			<component><id>cmpSave</id></component>
			<component><id>cmpCancel</id></component>
			<component><id>cmpActions</id></component>
		</components>
	</mainmenu>
	<main>
		<view>
			<type>areas</type>
			<screenareas>
				<screenarea>
					<leftscreenarea>
						<sections>
							<section><id>secMainInformation</id></section>
                            <section><id>secDistributors</id></section> 
							<section><id>secServices</id></section>
							<section><id>secPhysicalGoods</id></section>
							<section><id>secAllowedApplicationServers</id></section>
 							<section><id>secLogInformation</id></section>
						</sections>
					</leftscreenarea>
				</screenarea>
			</screenareas>
		</view>
		<sections>
			<section>
				<id>secMainInformation</id>
				<name>key_main_information</name>
				<disable>false</disable>
				<subsections>
					<id>secProvider</id>
					<id>secConnectionParameters</id>
				</subsections>
			</section>
			<section>
				<id>secProvider</id>
				<name>key_provider_information</name>
				<disable>false</disable>
				<instruction>key_instruction_billing_provisioning_tucano_provider_main_information_provider</instruction>
				<left>
					<columns>2</columns>
					<components>
						<component><id>cmpName</id></component>
						<component><id>cmpProvisioningProtocol</id></component>
						<component><id>cmpAltCode</id></component>
						<component>
							<id>file:general/description_rowspan_2.xml</id>
							<rowspan>2</rowspan>
						</component>
						<component><id>cmpLifeCycleState</id></component>
					</components>
				</left>
			</section>
			<section>
				<id>secConnectionParameters</id>
				<name>key_connection_parameters</name>
				<disable>false</disable>
				<instruction>key_instruction_billing_provisioning_tucano_provider_main_information_connection_parameters</instruction>
				<left>
					<columns>2</columns>
					<components>
						<component><id>cmpURL</id></component>
						<component><id>cmpIdentityKey</id></component>
						<component><id>cmpUsername</id></component>
						<component><id>cmpPassword</id></component>
						<component><id>cmpAddressCountry</id></component>
						<component><id>cmpLanguageID</id></component>
						<component><id>cmpDefaultProductID</id></component>
						<component><id>cmpSTBMaterialID</id></component>
						<component><id>cmpProviderID</id></component>
						<component><id>cmpTVEAdapter</id></component>
						<component><id>cmpJWTKey</id></component>
						<component><id>cmpJWTExpirationTime</id></component>
					</components>
				</left>
			</section>
			
			 <section>
				<id>secServices</id>
				<name>key_services</name>
				<disable>false</disable>
				<instruction>key_instruction_billing_provisioning_tucano_provider_services_service_package_mapping</instruction>
				<left>
					<components>
						<component><id>cmpServicesDrilldown</id></component>
					</components>
				</left>
			</section>
			
			<section>
				<id>secPhysicalGoods</id>
				<name>key_physical_goods</name>
				<disable>false</disable>
				<instruction>key_instruction_billing_provisioning_perception_provider_physical_goods_devices</instruction>
				<left>
					<components>
						<component><id>cmpDevicesDrilldown</id></component>
					</components>
				</left>
			</section>
			
			<section>
				<id>secDistributors</id>
				<name>key_distributors</name>
				<disable>false</disable>
				<instruction>key_instruction_billing_provisioning_tucano_provider_distributors</instruction>
				<left>
				<columns>4</columns>
					<components>
						<component><id>cmpDistributorsDrilldown</id></component>
					</components>
				</left>
			</section>			
			<section>
				<id>secAllowedApplicationServers</id>
				<name>key_allowed_application_servers</name>
				<disable>false</disable>
				<instruction>key_instruction_provisioning_conax_web_services_provider_sec_allowed_application_servers</instruction>
				<left>
					<components>
						<component><id>file:platform/allowedApplicationServers.xml</id></component>
					</components>
				</left>
			</section>
			<section>
				<id>secLogInformation</id>
				<name>key_log_information</name>
				<disable>false</disable>
				<left>
					<components>
						<component><id>file:loginfo/logInfoGroup.xml</id></component>
					</components>
				</left>
			</section>
		</sections>
	</main>
	<details>
		<view>default</view>
		<tabs>
			<tab>
				<id>tabServices</id>
				<disable>true</disable>
				<preload>true</preload>
				<showheader>false</showheader>
				<components>
					<component><id>cmpSelect</id></component>
					<component><id>cmpProduct</id></component>
					<component><id>cmpProductDescription</id></component>
					<component><id>cmpProductIdentifier</id></component>
				</components>
			</tab>
			<tab>
				<id>tabDevices</id>
				<disable>true</disable>
				<preload>true</preload>
				<showheader>false</showheader>
				<components>
					<component><id>cmpSelect</id></component>
					<component><id>cmpProductType</id></component>
					<component><id>cmpProductDescription</id></component>
				</components>
			</tab>
			<tab>
				<id>tabDistributors</id>
				<preload>true</preload>
				<disable>true</disable>
				<showheader>false</showheader>
				<components>
					<component><id>cmpDistributorName</id></component>
					<component><id>cmpDistributorAltCode</id></component>
					<component><id>cmpDistributorDescription</id></component>
				</components>
			</tab>
			
			<tab>
				<id>file:platform/allowedApplicationServers.xml</id>
				<disable>true</disable>
				<preload>true</preload>
				<showheader>false</showheader>
				<components>
					<component><id>cmpSelect</id></component>
					<component><id>cmpApplicationServer</id></component>
					<component><id>cmpAddedBy</id></component>
					<component><id>cmpAddedOn</id></component>
				</components>
			</tab>
		</tabs>
	</details>
</page>

 

Image Removed

8. Menu Options Metadata File

A new custom module should be defined in modules.xml file. For more information on customising modules metadata file, go to Customize Menu Options Metadata.

9. Modules Metadata File

The new menu options should be defined in menuoptions.xml file. For more information on customising menu options metadata file, go to Customize Modules Metadata.The payment gateway definition must consist of the following:

  • the protocol, which is the protocol of the payment gateway
  • the name, which is the name of the payment gateway
  • the processejbname, which is the name of the custom process class of the payment gateway
  • the paymentmethods, which are the supported payment methods of the payment gateway

Also, in this file, you can define the following:

  • useforrecurringpayments, which is a boolean value indicating whether the payment gateway can be used for recurring payments
  • createpayments, which is a boolean value indicating whether payments are allowed to be created through this payment gateway
  • createpaymentcancellations, which is a boolean value indicating whether payment cancellations are allowed to be created through this payment gateway
  • createrefunds, which is a boolean value indicating whether refunds are allowed to be created through this payment gateway
  • generalparameters, which are the payment gateway's parameters

For each generalparameter you can define the following:

  • generalparameterid, which is the id of the generalparameter 
  • generalparametername, which is the name of the generalparameter
  • generalparametertype, which is the type of the generalparameter 
  • generalparameterclassname, which is the classname of the generalparameter, if the generalparameter is a dataobject
  • generalparameterorder, which is the order of appearance of the generalparameter on the screen
  • generalparametervisibilitymode, which is the mode for which the generalparameter will be visible (TEST or LIVE)
  • generalparameterhidden, which is a boolean value indicating whether the generalparameter will appear masked with asterisks
  • generalparametermandatory, which is a boolean value indicating whether the generalparameter is mandatory


Ui expand
titlePayment gateways metadata file


Code Block
languagexml
titlepaymentgateways.xml
collapsetrue
<paymentgatewaysconfig>
	<paymentgateways>
		<paymentgateway>
			<protocol>CUSTOM</protocol>
			<name>Custom Payment Gateway</name>
			<processejbname>ejb/CRMProcessCustomGateway</processejbname>
			<useforrecurringpayments>true</useforrecurringpayments>
			<createpayments>true</createpayments>
			<createpaymentcancellations>true</createpaymentcancellations>
			<createrefunds>true</createrefunds>
			<paymentmethods>
				<paymentmethod>
					<type>CREDIT_CARD</type>
					<name>key_credit_card</name>
					<controlVerification>true</controlVerification>
				</paymentmethod>
				<paymentmethod>
					<type>EMAIL_ADDRESS</type>
					<name>key_paypal_account</name>
					<controlVerification>true</controlVerification>
				</paymentmethod>
				...
			</paymentmethods>
			<generalparameters>
				<generalparameter>
					<generalparameterid>MODE</generalparameterid>
					<generalparametername>key_mode</generalparametername>
					<generalparametertype>STRING</generalparametertype>
					<generalparameterorder>1</generalparameterorder>
					<generalparametermandatory>true</generalparametermandatory>
				</generalparameter>
				<generalparameter>
					<generalparameterid>TEST_SECRET_KEY</generalparameterid>
					<generalparametername>key_secret_key</generalparametername>
					<generalparametertype>STRING</generalparametertype>
					<generalparameterorder>2</generalparameterorder>
					<generalparametervisibilitymode>TEST</generalparametervisibilitymode>
					<generalparameterhidden>true</generalparameterhidden>
				</generalparameter>
				<generalparameter>
					<generalparameterid>LIVE_SECRET_KEY</generalparameterid>
					<generalparametername>key_secret_key</generalparametername>
					<generalparametertype>STRING</generalparametertype>
					<generalparameterorder>3</generalparameterorder>
					<generalparametervisibilitymode>LIVE</generalparametervisibilitymode>
					<generalparameterhidden>true</generalparameterhidden>
				</generalparameter>
				...
			</generalparameters>
		</paymentgateway>
	</paymentgateways>
</paymentgatewaysconfig>


2. Payment Gateway Process Class

The payment gateway process class should extend com.crm.process.paymentgateway.CRMProcessPaymentGatewayBean and implement its abstract methods for creating/updating/deleting a payment gateway account and card, creating a payment and payment cancellation, and checking whether a currency is supported by the payment gateway. Implement only the methods required by your business model.

You must use @Stateless(mappedName = "ejb/CRMProcessCustomGateway") to define the mapped name of the provisioning provider EJB. The mapped name should match the one defined in paymentgateways.xml metadata file.

Code Block
languagejava
titleCRMProcessCustomGatewayBean
linenumberstrue
collapsetrue
...

@Stateless(mappedName = "ejb/CRMProcessCustomGateway")
@LocalBean
public class CRMProcessCustomGatewayBean extends CRMProcessPaymentGatewayBean {

	...

	/**
	 * Default constructor.
	 */
	public CRMProcessCustomGatewayBean() {
		super();
	}

	@Override
	public CreatePaymentGatewayAccountResult processCreateAccount(CreateAccountParameters parameters) throws Exception {
		...
	}
	@Override
	public UpdatePaymentGatewayAccountResult processUpdateAccount(UpdateAccountParameters parameters) throws Exception {
		...
	}
	@Override
	public DeletePaymentGatewayAccountResult processDeleteAccount(DeleteAccountParameters parameters) throws Exception {
		...
	}
	
	@Override
	public CreatePaymentGatewayCardResult processCreateCard(CreateCardParameters parameters) throws PaymentGatewayPayeezyException, Exception{
		...
	}

	@Override
	public UpdatePaymentGatewayCardResult processUpdateCard(UpdateCardParameters parameters) throws Exception {
		...
	}
	@Override
	public DeletePaymentGatewayCardResult processDeleteCard(DeleteCardParameters parameters) throws Exception {
		...
	}
	
	@Override
	public CreatePaymentGatewayPaymentResult processCreatePayment(CreatePaymentParameters parameters) throws Exception {
		...
	}

	@Override
	public CreatePaymentGatewayPaymentCancellationResult processCreatePaymentCancellation(CreatePaymentCancellationParameters parameters) throws Exception {
		...
	}	

	@Override
	public Boolean isCurrencySupported(CRMDOCurrency currency, CRMDOPaymentGatewaySetting paymentGatewaySetting) throws Exception {
		...
	}

...
}


3. Set up the plugin payment gateway through CRM.COM

The plugin payment gateway can be set up through CRM.COM from the Provisioning Providers data entry view page, which can be found under Settings & Admin > Billing Application > Subscription & Billing Settings > Set up Provisioning Providers. 

Once the provider is defined in the provisioning providers metadata file, it can be added as a plugin through the Payment Gateway Providers data entry view page. By selecting "Set Up a Payment Gateway Provider", you can add the plugin payment gateway to the list of payment gateway providers. After adding it, you will be able to set it up, manage its payment gateway requests, import and export gateway requests and execute the processes defined in the related pages of the payment gateway provider's definition (in the paymentgateways.xml file).