This has been discussed a few times and I think is on a few of the lists around were people have brainstormed on things they'd like to add/change/etc. I'm personally very in favor of it and I do believe it has been needed for a long time.

As for the design, I'm very against the concept of super-generic entities like this. They cause all sorts of problems, and I wish now that I had never even introduced the extensibility stuff (attribute tables and such) as they tend to make things messy and difficult to follow and maintain... if/when they are used.

It won't be too difficult to add fields and entities for each property in the files. With actual entities and fields generic maintenance can be done through the Entity Data Maintenance pages, and for more user friendly stuff we'd want a less generic UI anyway, and it's a lot easier to implement that specific entities instead of generic ones.

For example, we would create a PaymentGatewayConfig entity and entities that extend it where needed for Cybersource, PayflowPro, PayPal, etc, etc. The main change is that on the ProductStorePaymentSetting entity instead of using the "paymentPropertiesPath" field we would add a paymentGatewayConfigId that points to the corresponding PaymentGatewayConfig entity. That entity would have a type field, with different values for different payment gateways (ie CyberSource, PayflowPro, etc).

Each property in the payment.properties file would be mapped to a field on one of these entities.

Does that make sense?

-David



On Mar 30, 2009, at 4:14 AM, [email protected] wrote:

Hi to all,

what did you think if we move the payment.properties to an entity ?
I tried to having a more general entity but I have seen that every single payment gateway having different parameters and so I tried with the following example:

<EnumerationType description="Payment Gateway Code" enumTypeId="PGW_CODE" hasTable="N" parentTypeId=""/> <Enumeration description="Gift Certificate" enumCode="GIFTCERTIFICATE" enumId="PGW_GIFTCERTIFICATE" sequenceId="01" enumTypeId="PGW_CODE"/> <Enumeration description="CyberSource" enumCode="CYBERSOURCE" enumId="PGW_CYBERSOURCE" sequenceId="02" enumTypeId="PGW_CODE"/> <Enumeration description="ClearCommerce" enumCode="CLEARCOMMERCE" enumId="PGW_CLEARCOMMERCE" sequenceId="03" enumTypeId="PGW_CODE"/> <Enumeration description="ValueLink" enumCode="VALUELINK" enumId="PGW_VALUELINK" sequenceId="04" enumTypeId="PGW_CODE"/> <Enumeration description="PayFlow Pro" enumCode="PAYFLOW" enumId="PGW_PAYFLOW" sequenceId="05" enumTypeId="PGW_CODE"/> <Enumeration description="WorldPay" enumCode="WORLDPAY" enumId="PGW_WORLDPAY" sequenceId="06" enumTypeId="PGW_CODE"/> <Enumeration description="PayPal" enumCode="PAYPAL" enumId="PGW_PAYPAL" sequenceId="07" enumTypeId="PGW_CODE"/> <Enumeration description="PCCharge" enumCode="PCCHARGE" enumId="PGW_PCCHARGE" sequenceId="08" enumTypeId="PGW_CODE"/> <Enumeration description="RiTA" enumCode="RITA" enumId="PGW_RITA" sequenceId="09" enumTypeId="PGW_CODE"/> <Enumeration description="Authorize.Net" enumCode="AUTHORIZEDOTNET" enumId="PGW_AUTHORIZEDOTNET" sequenceId="10" enumTypeId="PGW_CODE"/>

<!-- Product store gateway setting -->
<ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="certsPath" attributeValue="${sys:getProperty('ofbiz.home')}/applications/ accounting/pfcerts" activeAttribute="Y" comment="Path the the VeriSign Certificate"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="hostAddress" attributeValue="test-payflow.verisign.com" activeAttribute="Y" comment="Address of the payment processor"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="hostPort" attributeValue="443" activeAttribute="Y" comment="Port of the payment processor"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="vendor" attributeValue="[Vendor]" activeAttribute="Y" comment="Payflow account information (Vendor)"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="user" attributeValue="[PayFlow UserID]" activeAttribute="Y" comment="Payflow account information (PayFlow UserID)"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="pwd" attributeValue="[PayFlow Password]" activeAttribute="Y" comment="Payflow account information (PayFlow Password)"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="partner" attributeValue="[PayFlow Partner]" activeAttribute="Y" comment="Payflow account information (PayFlow Partner)"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="checkAvs" attributeValue="Y" activeAttribute="Y" comment="Use Address Verification"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="checkCvv2" attributeValue="Y" activeAttribute="Y" comment="Require CVV2 Verification"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="preAuth" attributeValue="Y" activeAttribute="Y" comment="Pre-Authorize Payments (if set to N will auto-capture)"/> <ProductStoreGatewaySetting productStoreId="9000" gatewayEnumId="PGW_PAYFLOW" attributeKey="enableTransmit" attributeValue="true" activeAttribute="Y" comment="Set to false to not transmit anything "/>


Once we have it into the DB it could be extended in a custom components (hot-deploy) and it could be cashed and it could be no more necessary to restart OFBiz once you have to change a value into this property file. I have also moved those parameters at product store level so you could have different configuration by product store.

It's only an idea and it could be introduced also after that new OFBiz release has been created.

Any ideas and suggestions are welcomed because if it's working correctly for everyone it could be extended also to others property files (shipment.properties, catalog.properties, ...).

Thanks in advance
Marco


Reply via email to