Make your own free website on Tripod.com

Map Processor

The primary tasks for a Map Processor is:

  • validation

  • conversion

org/ofbiz/commonapp/accounting/payment/PaymentMapProcs.xml

<simple-map-processor name="createCreditCard">
  <make-in-string field="expireDate">
    <in-field field="expMonth"/>
    <constant>/</constant>
    <in-field field="expYear"/>
  </make-in-string>
  <process field="partyId"><copy/></process>
  <process field="nameOnCard"><copy/>
    <not-empty><fail-message 
      message="Name on Card is missing"/>
    </not-empty>
  </process>
  <process field="companyNameOnCard"><copy/></process>
  <process field="cardType"><copy/>
    <not-empty><fail-message 
      message="Card Type is missing"/>
    </not-empty>
  </process>
  <process field="cardNumber">
    <copy/>
    <not-empty>
      <fail-message message="Card Number is missing"/>
    </not-empty>
    <validate-method method="isAnyCard">
      <fail-message 
        message="Card Number is not a valid credit card number for any type of card known"/>
    </validate-method>
  </process>
  <process field="cardSecurityCode"><copy/></process>
  <process field="contactMechId"><copy/></process>
  <process field="expMonth">
    <not-empty><fail-message 
      message="Expiration Month is missing"/>
    </not-empty>
  </process>
  <process field="expYear">
    <not-empty>
      <fail-message message="Expiration Year is missing"/>
    </not-empty>
  </process>
  <process field="expireDate"><copy/>
    <validate-method method="isDateAfterToday">
      <fail-message message="The expiration date is before today"/>
    </validate-method>
  </process>
  </simple-map-processor>