Implementation Guide for Oracle Billing Insight > Customizing Payment >

Implementing Custom Payment Cassette Cartridges


Follow these steps to implement a custom payment cassette cartridge using the Command Center for Oracle Billing Insight.

To implement a custom payment cassette

  1. Extend your cassette configuration class to add customized gateway attributes:
    • Checks. Use the BankCassetteConfig class.
    • Credit cards and debit cards. Use the CreditCardCassetteConfig class.

      If the common configuration parameters defined in the CreditCardCassetteConfig or BankCassetteConfig classes cannot meet your requirements, then implement CassetteConfig.setDefaultAttributeList() to define a list of parameters of type com.edocs.common.payment.cassette.config.Attribute to configure the cassette. These parameters display on the Payment Settings page in the Command Center. The following example shows an extended CreditCardCassetteConfig class:

    public class customCassetteConfig extends CreditCardCassetteConfig

    {public void setDefaultAttributeList()
    {Attribute at = new Attribute
    "Custom files 1", //the display name shown in Payment Settings
    "Custom key1", //the key value of attribute
    Attribute.Text); //the type of attribute
    at.setRequire(true); //flag indicate that whether the attribute is required, default is false
    at.addDefaultValue("default value"); //set default value
    at.setNeedEncrypt(true); //decide whether the value need to be encrypted when stored in db, default is false.
    defaultAttributeList.add(at); // Add Attribute to default attribute list
    at = new Attribute("Custom files2", //the display name shown in Payment Settings
    "Custom key2", //the key value of attribute
    Attribute.Text); //the type of attribute
    at.addDefaultValue("default value2");

    defaultAttributeList.add(at); // Add Attribute to default attribute list
    }}

    For more information about updating payment settings in the Command Center, see Administration Guide for Oracle Billing Insight.

  2. Extend your payment cassette class to write a customized process flow:
    • Checks. Use the BankCassette class.
    • Credit cards and debit cards. Use the CreditCardCassette class.
  3. Set the custom config class in the constructor method of the custom payment cassette class so that the custom config class can be recognized when the payment cassette is created. For example:

    public class CustomPaymentCassette extends CreditCardCassette
    {Public CustomPaymentCassette()
    { this.setCassetteConfig(new CustomCassetteConfig()); //set cassette config
    }public ICreditCardTransaction submit(CreditCardCassetteParams ccardCassetteParams) throws CassetteException;
    { //TODO implemented by customer }
    public List<ICreditCardTransaction> batchSubmit(CreditCardCassetteParams ccardCassetteParams) throws CassetteException;
    { //TODO implemented by customer}}

  4. If you want to initialize the payment cassette, and you want to get gateway configuration parameters in the Oracle Billing Insight database, you can use the following method in IPaymentConfigManager:

    public CassetteConfig getCassetteConfig(String payeeId, PaymentType paymentType);

  5. Implement the methods defined in CreditCardCassette or BankCassette. The parameter classes, such as CreditCardCassetteParams and BankCassetteParams, provide methods to get check transactions or credit card transactions for processing. The parameter classes also provide Getter and Setter methods to get additional parameters from Command Center jobs or an external system.
  6. The payment gateway returns a response, which you use to update the status of the ICheckTransaction or ICreditCardTransaction object as follows:
    • If a payment transaction processes successfully, then set the status to Settled-Paid by calling one of the following objects:
      • ICreditCardTransaction.setStatus(PaymentStatus.settled)
      • ICheckTransaction.setStatus(PaymentStatus.paid)
    • If a system or network error occurs, then set the status to Failed by calling one of the following objects:
      • ICreditCardTransaction.setStaus(PaymentStatus.failed)
      • ICheckTransaction.setStatus(PaymentStatus.failed)
    • If the credit or debit card transaction fails authorization, then set the status to Failed-Authorize by calling the ICreditCardTransaction.setStatus(PaymentStatus.failed_authorize) object.

      For the status types supported by Oracle Billing Insight, refer to the code in the com.edocs.common.api.payment.PaymentStatus object.

      Refer to the code in the ICreditCardtransaction or ICheckTransaction objects for setting status and transaction information. You can set the status or other transaction information from the response to the ICreditCardTransaction and ICheckTransaction objects for your gateway specifications.

      The CheckSubmit and CreditCardSubmit jobs update the Oracle Billing Insight database to reflect the result of processing by the payment cassette.

  7. You must process the list of ICreditCardtransaction or ICheckTransaction objects from the CheckSubmit or CreditCardSubmit job:
    1. Set the payment status with the gateway response.
    2. Return the processed transaction list back to the CheckSubmit or CreditCardSubmit job for the Oracle Billing Insight database update.
  8. If your payment cassette supports the payment account enrollment process, then implement the IEnrollmentCassette interface to enable the enrollment feature.
  9. Populate the payment_gateway_configure table to inform Oracle Billing Insight about your payment cassette implementation class. For example, if your cartridge class name is com.edocs.common.payment.cassette.creditcard.MyCreditCardCassette, and you want to name it customCCardCassette, then use the following command:

    Insert into payment_gateway_configure(GATEWAY, PAYMENT_TYPE, CARTRIDGE_CLASS) values ('customCCardCassette', 'ccard', 'com.edocs.common.payment.cassette.creditcard.MyCreditCardCassette')

Implementation Guide for Oracle Billing Insight Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.