Make your own free website on Tripod.com

Simple Method Example

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

<simple-method method-name="createCreditCard" 
    short-description="Create Credit Card">
    <call-map-processor 
      xml-resource="org/ofbiz/commonapp/accounting/payment/PaymentMapProcs.xml"
      processor-name="createCreditCard" 
      in-map-name="parameters" out-map-name="context"/>
    <check-errors/>
    <call-service service-name="createCreditCard" 
      in-map-name="context">
      <default-message>Credit Card successfully created.</default-message>
      <result-to-request result-name="paymentMethodId"/>
    </call-service>
    <if-compare map-name="parameters" field-name="contactMechId" 
      operator="equals" value="_NEW_">
      <string-to-field string="address" 
        field-name="_response_code_"/>
      <string-to-field string="POSTAL_ADDRESS" 
        field-name="preContactMechTypeId"/>
      <string-to-field string="BILLING_LOCATION" 
        field-name="contactMechPurposeTypeId"/>
      <field-to-request field-name="DONE_PAGE"/>
      <field-to-request field-name="preContactMechTypeId"/>
      <field-to-request field-name="contactMechPurposeTypeId"/>
    </if-compare>
</simple-method>