Third Party Payment and Shipment Configuration - OFBiz Project Open Wiki (2024)

This document covers the way to setup third party payment processor and shipment configuration and managing patches where required for Testing and Production system.

Payment Processor Configuration

OFBiz OOTB implementation supports multiple payment gateways like: Chase Paymentech Orbital, CyberSource / Authorize.net, and PayPal PayflowPro.
These all can be configured through entities(PaymentGatewayConfigType, PaymentGatewayConfig, PaymentGatewaySagePay, PaymentGatewayAuthorizeNet, PaymentGatewayCyberSource, PaymentGatewayPayflowPro, PaymentGatewayPayPal, PaymentGatewayClearCommerce, PaymentGatewayWorldPay, PaymentGatewayOrbital) and hookup with the product store to have them in effect. Earlier this was achieved with payment.properties file, this method is now deprecated.
Here I am taking PayFlow pro as an example. Following steps need to be performed in order to integrate PayFlow pro payment gateway:

  1. Add payflow.jar in hot-deploy/customcomponent/lib directory.
  2. Make following entry in accounting build.xml file

    <fileset dir="../../hot-deploy/customcomponent/lib" includes="*.jar"/>
  3. Comment following entry in accounting build.xml file

  4. For above two changes in accounting build.xml file, you should maintain a patch in custom component at hot-deploy/customcomponent/patches which is going to be common for staging and production system.
  5. Prepare configuration data as following with valid details for vendor, userId, pwd and partner. Other settings can also be changed as per requirement:

    <PaymentGatewayPayflowPro paymentGatewayConfigId="PAYFLOWPRO_CONFIG" certsPath=" " hostAddress="pilot-payflowpro.paypal.com" hostPort="443" timeout="80" proxyAddress="" proxyPort="80" proxyLogon="" proxyPassword="" vendor="" userId="" pwd="" partner="" checkAvs="N" checkCvv2="N" preAuth="Y" enableTransmit="true" logFileName="${sys:getProperty('ofbiz.home')}/runtime/logs/payflow_java.log" loggingLevel="1" maxLogFileSize="100000000" stackTraceOn="Y"/>

    hostAddress for staging and production are different so to handle this case better two separate data file should be created and two entries should be made in ofbiz-component.xml file with different custom readers like "ext-stag" and "ext-prod" to avoid any confusion while taking system from staging(testing) to production as shown bellow:

    <entity-resource type="data" reader-name="ext-stag" loader="main" location="data/CustomComponentConfigurationStagingData.xml"/><entity-resource type="data" reader-name="ext-prod" loader="main" location="data/CustomComponentConfigurationProductionData.xml"/>
  6. Prepare product store payment configuration data with valid productStoreId and paymentGatewayConfigId created in last step as follows:

    <ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_AUTH" paymentService="" paymentCustomMethodId="CC_AUTH_PAYFLOW" paymentGatewayConfigId="PAYFLOWPRO_CONFIG"/><ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_RELEASE" paymentService="" paymentCustomMethodId="CC_RELEASE_PAYFLOW" paymentGatewayConfigId="PAYFLOWPRO_CONFIG"/><ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_CAPTURE" paymentService="" paymentCustomMethodId="CC_CAPTURE_PAYFLOW" paymentGatewayConfigId="PAYFLOWPRO_CONFIG"/><ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_REAUTH" paymentService="" paymentCustomMethodId="CC_AUTH_PAYFLOW" paymentGatewayConfigId="PAYFLOWPRO_CONFIG"/><ProductStorePaymentSetting productStoreId="9000" paymentMethodTypeId="CREDIT_CARD" paymentServiceTypeEnumId="PRDS_PAY_REFUND" paymentService="" paymentCustomMethodId="CC_REFUND_PAYFLOW" paymentGatewayConfigId="PAYFLOWPRO_CONFIG"/>
  7. Now load data command with following command if you are loading data first time:

    ant run-install-readers -Ddata-readers=seed,seed-initial,ext,ext-stag or ant run-install-readers -Ddata-readers=seed,seed-initial,ext,ext-prod depending on the data need based on system.

    If you are not loading data on a fresh db then just remove reader seed-initial.

  8. Now do class path entry for lib as follows in ofbiz-compoent.xml file of your custom component

    <classpath type="jar" location="lib/*"/>
  9. A clean build should be done before starting testing.

Shipment Configuration

OFBiz OOTB implementation supports multiple third party shipping integrations like: UPS, USPS, FedEx. These all can be achieved by doing configuration in shipment.properties file as of now, though for supporting this configuration entities are in system but code in services has not been updated to take these in consideration. These entities are: ShipmentGatewayConfigType, ShipmentGatewayConfig, ShipmentGatewayDhl, ShipmentGatewayFedex, ShipmentGatewayUps, ShipmentGatewayUsps. So once this is done this will also be achievable through configuration in entities (a first effort has been done at https://issues.apache.org/jira/browse/OFBIZ-2589).
e.g. for setting up UPS configuration need to do following:

  1. Add a patch for shipment.properties file to hot-deploy/customcomponent/patches/staging for testing and a patch to hot-deploy/customcomponent/patches/production for production system as follows with valid account number, license number, userId and pwd and with other settings as per requirement:

    Index: applications/product/config/shipment.properties===================================================================--- applications/product/config/shipment.properties(revision 897169)+++ applications/product/config/shipment.properties(working copy)@@ -54,16 +54,16 @@ shipment.ups.bill.shipper.account.number=12345E # UPS XPCI Access License Number-shipment.ups.access.license.number=TEST262223144CAT+shipment.ups.access.license.number=ValidLicenseNumber # UPS XPCI Access User ID-shipment.ups.access.user.id=REG111111+shipment.ups.access.user.id=validUserId # UPS XPCI Access Password-shipment.ups.access.password=REG111111+shipment.ups.access.password=password # Setting to save files needed for UPS certification-shipment.ups.save.certification.info=true+shipment.ups.save.certification.info=false shipment.ups.save.certification.path=/ofbiz/work/ofbiz/upscert # Shipper Default Pickup Type@@ -74,7 +74,7 @@ # 11 - Suggested Retail Rates (UPS Store) # 19 - Letter Center # 20 - Air Service Center-shipment.ups.shipper.pickup.type=06+shipment.ups.shipper.pickup.type=01 # Customer Classification # Valid Values are@@ -91,7 +91,7 @@ # This number is used as the max weight per package # when the total weight is > than this weight the # weights are split into packages not exceeding max.-shipment.ups.max.estimate.weight=90+shipment.ups.max.estimate.weight=145 # Minimum weight for a package (per UPS specs) # Please make an weight > 0, but less than the
  2. Prepare Shipping data as follows with valid CarrierShipmentMethod.carrierServiceCode and ProductStoreShipmentMeth.serviceName="upsRateEstimate" for methods you are setting up:(Reference can be taken from OOTB DemoShippnig.xml file)

     <Party partyId="UPS" partyTypeId="PARTY_GROUP"/> <PartyGroup partyId="UPS" groupName="UPS"/> <PartyRole partyId="UPS" roleTypeId="CARRIER"/> <ShipmentMethodType shipmentMethodTypeId="GROUND" description="Ground"/> <ShipmentMethodType shipmentMethodTypeId="STANDARD" description="Standard"/> <ShipmentMethodType shipmentMethodTypeId="EXPRESS" description="Express Saver"/> <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" sequenceNumber="1" carrierServiceCode="03"/> <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="STANDARD" sequenceNumber="2" carrierServiceCode="11"/> <CarrierShipmentMethod partyId="UPS" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" sequenceNumber="3" carrierServiceCode="65"/> <ProductStoreShipmentMeth productStoreShipMethId="8000" productStoreId="9000" partyId="UPS" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="GROUND" serviceName="upsRateEstimate" sequenceNumber="1"/> <ProductStoreShipmentMeth productStoreShipMethId="8001" productStoreId="9000" partyId="UPS" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="STANDARD" serviceName="upsRateEstimate" sequenceNumber="2"/> <ProductStoreShipmentMeth productStoreShipMethId="8002" productStoreId="9000" partyId="UPS" includeNoChargeItems="N" allowUspsAddr="N" requireUspsAddr="N" roleTypeId="CARRIER" shipmentMethodTypeId="EXPRESS" serviceName="upsRateEstimate" sequenceNumber="3"/>
  3. Load the data, restart the server and verify it by placing an order from order manager and observe from console and options available on select shipping method section, online estimates should be coming.
Third Party Payment and Shipment Configuration - OFBiz Project Open Wiki (2024)
Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6081

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.