You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Abdullah Shaikh <ab...@viithiisys.com> on 2009/11/08 18:04:37 UTC

PaymentUtil class

Can we have a class which will provide utility methods which can be used
when implementing a payment gateway, I guess this will help in code
redundancy, to make code more readable and maybe more.

Currently the thing that we can put in PaymentUtil, can be methods to create
payment gateway responses, as below,

toAuthorisationMap((Boolean authResult, String authCode, String authFlag,
BigDecimal processAmount, String authRefNum, String authAltRefNum, String
authMessage)

toCaptureMap(Boolean captureResult, String captureCode, String captureFlag,
BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
String captureMessage)

..... same for other responses

This method will create the map from parameters and return the map back,
this will help in reducing the code (map creation code)  as we will be
implementing more & more payment gateways, right now we have 9 implemented,
so instead of creating the map manually we can have this utility method.

And as the payment gateway response fields are not dynamic, I mean they are
restricted to only the fields defined in processAuthResult service, I guess
this will help.

I have already implemented this class for use in implementing payment
gateway that I am using.

Please let me know your thoughts.

Re: PaymentUtil class

Posted by Abdullah Shaikh <ab...@gmail.com>.
Thanks Jacques for taking this up :)

On Wed, Nov 18, 2009 at 12:34 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> Abdullah,
>
>
> From: "Abdullah Shaikh" <ab...@viithiisys.com>
>
>> Yes Jacques, I would create a jira(improvement) & submit patch shortly,
>> bit
>>
>> busy with some other issues.
>>
>> Also if possible can you look into
>> https://issues.apache.org/jira/browse/OFBIZ-3180, if any issues, let me
>> know, I can update the patch.
>>
>
> OK I will...
>
> Thanks
>
> Jacques
>
>
>  I am planning to contribute more & more improvements on the payment
>> gateway
>> side, not sure maybe I will be contributing one more payment gateway.
>>
>> Abdullah
>>
>> On Wed, Nov 18, 2009 at 11:18 AM, Jacques Le Roux <
>> jacques.le.roux@les7arts.com> wrote:
>>
>>  Hi Abdullah,
>>>
>>> I had no chances to look into details but could you please open a Jira
>>> and
>>> submit a patch ?
>>>
>>>
>>> Thanks
>>>
>>> Jacques
>>>
>>> From: "Abdullah Shaikh" <ab...@viithiisys.com>
>>>
>>>  Can we have a class which will provide utility methods which can be used
>>>>
>>>> when implementing a payment gateway, I guess this will help in code
>>>> redundancy, to make code more readable and maybe more.
>>>>
>>>> Currently the thing that we can put in PaymentUtil, can be methods to
>>>> create
>>>> payment gateway responses, as below,
>>>>
>>>> toAuthorisationMap((Boolean authResult, String authCode, String
>>>> authFlag,
>>>> BigDecimal processAmount, String authRefNum, String authAltRefNum,
>>>> String
>>>> authMessage)
>>>>
>>>> toCaptureMap(Boolean captureResult, String captureCode, String
>>>> captureFlag,
>>>> BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
>>>> String captureMessage)
>>>>
>>>> ..... same for other responses
>>>>
>>>> This method will create the map from parameters and return the map back,
>>>> this will help in reducing the code (map creation code)  as we will be
>>>> implementing more & more payment gateways, right now we have 9
>>>> implemented,
>>>> so instead of creating the map manually we can have this utility method.
>>>>
>>>> And as the payment gateway response fields are not dynamic, I mean they
>>>> are
>>>> restricted to only the fields defined in processAuthResult service, I
>>>> guess
>>>> this will help.
>>>>
>>>> I have already implemented this class for use in implementing payment
>>>> gateway that I am using.
>>>>
>>>> Please let me know your thoughts.
>>>>
>>>>
>>>>
>>>
>>
>

Re: PaymentUtil class

Posted by Jacques Le Roux <ja...@les7arts.com>.
Abdullah,

From: "Abdullah Shaikh" <ab...@viithiisys.com>
> Yes Jacques, I would create a jira(improvement) & submit patch shortly, bit
> busy with some other issues.
> 
> Also if possible can you look into
> https://issues.apache.org/jira/browse/OFBIZ-3180, if any issues, let me
> know, I can update the patch.

OK I will...

Thanks

Jacques

> I am planning to contribute more & more improvements on the payment gateway
> side, not sure maybe I will be contributing one more payment gateway.
> 
> Abdullah
> 
> On Wed, Nov 18, 2009 at 11:18 AM, Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
> 
>> Hi Abdullah,
>>
>> I had no chances to look into details but could you please open a Jira and
>> submit a patch ?
>>
>>
>> Thanks
>>
>> Jacques
>>
>> From: "Abdullah Shaikh" <ab...@viithiisys.com>
>>
>>> Can we have a class which will provide utility methods which can be used
>>>
>>> when implementing a payment gateway, I guess this will help in code
>>> redundancy, to make code more readable and maybe more.
>>>
>>> Currently the thing that we can put in PaymentUtil, can be methods to
>>> create
>>> payment gateway responses, as below,
>>>
>>> toAuthorisationMap((Boolean authResult, String authCode, String authFlag,
>>> BigDecimal processAmount, String authRefNum, String authAltRefNum, String
>>> authMessage)
>>>
>>> toCaptureMap(Boolean captureResult, String captureCode, String
>>> captureFlag,
>>> BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
>>> String captureMessage)
>>>
>>> ..... same for other responses
>>>
>>> This method will create the map from parameters and return the map back,
>>> this will help in reducing the code (map creation code)  as we will be
>>> implementing more & more payment gateways, right now we have 9
>>> implemented,
>>> so instead of creating the map manually we can have this utility method.
>>>
>>> And as the payment gateway response fields are not dynamic, I mean they
>>> are
>>> restricted to only the fields defined in processAuthResult service, I
>>> guess
>>> this will help.
>>>
>>> I have already implemented this class for use in implementing payment
>>> gateway that I am using.
>>>
>>> Please let me know your thoughts.
>>>
>>>
>>
>


Re: PaymentUtil class

Posted by Abdullah Shaikh <ab...@viithiisys.com>.
Yes Jacques, I would create a jira(improvement) & submit patch shortly, bit
busy with some other issues.

Also if possible can you look into
https://issues.apache.org/jira/browse/OFBIZ-3180, if any issues, let me
know, I can update the patch.

I am planning to contribute more & more improvements on the payment gateway
side, not sure maybe I will be contributing one more payment gateway.

Abdullah

On Wed, Nov 18, 2009 at 11:18 AM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> Hi Abdullah,
>
> I had no chances to look into details but could you please open a Jira and
> submit a patch ?
>
>
> Thanks
>
> Jacques
>
> From: "Abdullah Shaikh" <ab...@viithiisys.com>
>
>> Can we have a class which will provide utility methods which can be used
>>
>> when implementing a payment gateway, I guess this will help in code
>> redundancy, to make code more readable and maybe more.
>>
>> Currently the thing that we can put in PaymentUtil, can be methods to
>> create
>> payment gateway responses, as below,
>>
>> toAuthorisationMap((Boolean authResult, String authCode, String authFlag,
>> BigDecimal processAmount, String authRefNum, String authAltRefNum, String
>> authMessage)
>>
>> toCaptureMap(Boolean captureResult, String captureCode, String
>> captureFlag,
>> BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
>> String captureMessage)
>>
>> ..... same for other responses
>>
>> This method will create the map from parameters and return the map back,
>> this will help in reducing the code (map creation code)  as we will be
>> implementing more & more payment gateways, right now we have 9
>> implemented,
>> so instead of creating the map manually we can have this utility method.
>>
>> And as the payment gateway response fields are not dynamic, I mean they
>> are
>> restricted to only the fields defined in processAuthResult service, I
>> guess
>> this will help.
>>
>> I have already implemented this class for use in implementing payment
>> gateway that I am using.
>>
>> Please let me know your thoughts.
>>
>>
>

Re: PaymentUtil class

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Abdullah,

I had no chances to look into details but could you please open a Jira and submit a patch ?

Thanks

Jacques

From: "Abdullah Shaikh" <ab...@viithiisys.com>
> Can we have a class which will provide utility methods which can be used
> when implementing a payment gateway, I guess this will help in code
> redundancy, to make code more readable and maybe more.
> 
> Currently the thing that we can put in PaymentUtil, can be methods to create
> payment gateway responses, as below,
> 
> toAuthorisationMap((Boolean authResult, String authCode, String authFlag,
> BigDecimal processAmount, String authRefNum, String authAltRefNum, String
> authMessage)
> 
> toCaptureMap(Boolean captureResult, String captureCode, String captureFlag,
> BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
> String captureMessage)
> 
> ..... same for other responses
> 
> This method will create the map from parameters and return the map back,
> this will help in reducing the code (map creation code)  as we will be
> implementing more & more payment gateways, right now we have 9 implemented,
> so instead of creating the map manually we can have this utility method.
> 
> And as the payment gateway response fields are not dynamic, I mean they are
> restricted to only the fields defined in processAuthResult service, I guess
> this will help.
> 
> I have already implemented this class for use in implementing payment
> gateway that I am using.
> 
> Please let me know your thoughts.
>


Re: PaymentUtil class

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Abdullah,

I suggest you create a Jira and upload a patch for review
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

Thanks

Jacques

From: "Abdullah Shaikh" <ab...@viithiisys.com>
> Anyone... ? I think the util class should be named PaymentGatewayUtil
> instead of PaymentUtil
> 
> On Sun, Nov 8, 2009 at 10:34 PM, Abdullah Shaikh <
> abdullah.shaikh@viithiisys.com> wrote:
> 
>> Can we have a class which will provide utility methods which can be used
>> when implementing a payment gateway, I guess this will help in code
>> redundancy, to make code more readable and maybe more.
>>
>> Currently the thing that we can put in PaymentUtil, can be methods to
>> create payment gateway responses, as below,
>>
>> toAuthorisationMap((Boolean authResult, String authCode, String authFlag,
>> BigDecimal processAmount, String authRefNum, String authAltRefNum, String
>> authMessage)
>>
>> toCaptureMap(Boolean captureResult, String captureCode, String captureFlag,
>> BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
>> String captureMessage)
>>
>> ..... same for other responses
>>
>> This method will create the map from parameters and return the map back,
>> this will help in reducing the code (map creation code)  as we will be
>> implementing more & more payment gateways, right now we have 9 implemented,
>> so instead of creating the map manually we can have this utility method.
>>
>> And as the payment gateway response fields are not dynamic, I mean they are
>> restricted to only the fields defined in processAuthResult service, I guess
>> this will help.
>>
>> I have already implemented this class for use in implementing payment
>> gateway that I am using.
>>
>> Please let me know your thoughts.
>>
>


Re: PaymentUtil class

Posted by Abdullah Shaikh <ab...@viithiisys.com>.
Anyone... ? I think the util class should be named PaymentGatewayUtil
instead of PaymentUtil

On Sun, Nov 8, 2009 at 10:34 PM, Abdullah Shaikh <
abdullah.shaikh@viithiisys.com> wrote:

> Can we have a class which will provide utility methods which can be used
> when implementing a payment gateway, I guess this will help in code
> redundancy, to make code more readable and maybe more.
>
> Currently the thing that we can put in PaymentUtil, can be methods to
> create payment gateway responses, as below,
>
> toAuthorisationMap((Boolean authResult, String authCode, String authFlag,
> BigDecimal processAmount, String authRefNum, String authAltRefNum, String
> authMessage)
>
> toCaptureMap(Boolean captureResult, String captureCode, String captureFlag,
> BigDecimal captureAmount, String captureRefNum, String captureAltRefNum,
> String captureMessage)
>
> ..... same for other responses
>
> This method will create the map from parameters and return the map back,
> this will help in reducing the code (map creation code)  as we will be
> implementing more & more payment gateways, right now we have 9 implemented,
> so instead of creating the map manually we can have this utility method.
>
> And as the payment gateway response fields are not dynamic, I mean they are
> restricted to only the fields defined in processAuthResult service, I guess
> this will help.
>
> I have already implemented this class for use in implementing payment
> gateway that I am using.
>
> Please let me know your thoughts.
>