PaymentUtil class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

PaymentUtil class

Abdullah Shaikh-3
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.
Reply | Threaded
Open this post in threaded view
|

Re: PaymentUtil class

Abdullah Shaikh-3
Anyone... ? I think the util class should be named PaymentGatewayUtil
instead of PaymentUtil

On Sun, Nov 8, 2009 at 10:34 PM, Abdullah Shaikh <
[hidden email]> 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.
>
Reply | Threaded
Open this post in threaded view
|

Re: PaymentUtil class

Jacques Le Roux
Administrator
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" <[hidden email]>

> Anyone... ? I think the util class should be named PaymentGatewayUtil
> instead of PaymentUtil
>
> On Sun, Nov 8, 2009 at 10:34 PM, Abdullah Shaikh <
> [hidden email]> 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.
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: PaymentUtil class

Jacques Le Roux
Administrator
In reply to this post by Abdullah Shaikh-3
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" <[hidden email]>

> 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.
>

Reply | Threaded
Open this post in threaded view
|

Re: PaymentUtil class

Abdullah Shaikh-3
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 <
[hidden email]> 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" <[hidden email]>
>
>> 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.
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: PaymentUtil class

Jacques Le Roux
Administrator
Abdullah,

From: "Abdullah Shaikh" <[hidden email]>
> 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 <
> [hidden email]> 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" <[hidden email]>
>>
>>> 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.
>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: PaymentUtil class

Abdullah Shaikh
Thanks Jacques for taking this up :)

On Wed, Nov 18, 2009 at 12:34 PM, Jacques Le Roux <
[hidden email]> wrote:

> Abdullah,
>
>
> From: "Abdullah Shaikh" <[hidden email]>
>
>> 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 <
>> [hidden email]> 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" <[hidden email]>
>>>
>>>  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.
>>>>
>>>>
>>>>
>>>
>>
>