Users - DataCash - Andrew Sykes

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

Users - DataCash - Andrew Sykes

Charles Johnson-2
Andrew,

I'm back from my break and have got the DataCash end of things working
and am now looking at what i have to do to integrate it.

I thought it could be an idea to get myself a CyberSource test account
and see that in action first. Only problem is i can't get my keys
generated yet as i can't log in to their site's keygen page ;-)

I'm not sure how the (apparently) generic PaymentGatewayServices works
in conjunction with particular services, such as IcsPaymentServices. I
would imagine that the former hands off to the latter, but i'm not sure
where and how.

Also, i wonder if you have any experience of processing with CyberSource?

CJ

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - DataCash - Andrew Sykes

Andrew Sykes
Charles,

No, I haven't used CyberSource before unfortunately.

As for setting up a test account, perhaps it would be easier to set one
up with Paypal, that might get the ball rolling at least...

As a little indication of how the payment stuff hangs together, let's
take a quick look at a refund...

To refund a payment, OFBiz calls the refundPayment service of
PaymentGatewayServices.java like so...

Map serviceResult = dispatcher.runSync("refundPayment", UtilMisc.toMap
("orderPaymentPreference", orderPayPref, "refundAmount",
thisRefundAmount, "userLogin", userLogin));

I guess this service is analogous to a factory object in that it works
out the specific implementation to use, although I doubt that analogy
could get you too far!

In PaymentGatewayServices.refundPayment() you'll see lines like this...
...
...
GenericValue paymentSettings = null;
if (orderHeader != null) {
paymentSettings = getPaymentSettings(orderHeader, paymentPref,
REFUND_SERVICE_TYPE, false);
}
...
...
String serviceName = paymentSettings.getString("paymentService");
...
...

Here, you are getting the implementation specific service name for
refunding.

Once PaymentGatewayServices has that, it does the refund like so...
...
refundResponse = dispatcher.runSync(serviceName, serviceContext,
TX_TIME, true);
...

In the case of CyberSource, serviceName would contain the name of the
CyberSource refund service "cyberSourceCCRefund".

Just for clarity, you won't find a method in IcsPaymentServices called
"cyberSourceCCRefund". This is because the service name is mapped to
IcsPaymentServices.ccRefund() in the xml file "services_cybersource.xml"
like so...

<service name="cyberSourceCCRefund" engine="java"
location="org.ofbiz.accounting.thirdparty.cybersource.IcsPaymentServices" invoke="ccRefund">
        <description>Credit Card Processing</description>
        <implements service="paymentRefundInterface"/>
</service>

Obviously, there's a lot going on in there, but hopefully that gives you
some indication of how it's hanging together.

Kind Regards
--
Andrew Sykes <[hidden email]>
Sykes Development Ltd

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - DataCash - Andrew Sykes

Charles Johnson-2
>>perhaps it would be easier to set one up with Paypal

I've got an acount with PayPal but the problem there is two-fold:

a. i don't know of a way of sending test data
and more importantly,
b. PayPal doesn't (AFAICR) notify synchronously and therefore would be a
bad analog for DataCash

In fact, this second reason, since the asynchronous notifications are
probably not durable, makes it a bad candidate for solid processing IMO

Still inspecting your info regarding flow. Thanks for that

CJ

Andrew Sykes wrote:

>Charles,
>
>No, I haven't used CyberSource before unfortunately.
>
>As for setting up a test account, perhaps it would be easier to set one
>up with Paypal, that might get the ball rolling at least...
>
>As a little indication of how the payment stuff hangs together, let's
>take a quick look at a refund...
>
>To refund a payment, OFBiz calls the refundPayment service of
>PaymentGatewayServices.java like so...
>
>Map serviceResult = dispatcher.runSync("refundPayment", UtilMisc.toMap
>("orderPaymentPreference", orderPayPref, "refundAmount",
>thisRefundAmount, "userLogin", userLogin));
>
>I guess this service is analogous to a factory object in that it works
>out the specific implementation to use, although I doubt that analogy
>could get you too far!
>
>In PaymentGatewayServices.refundPayment() you'll see lines like this...
>...
>...
>GenericValue paymentSettings = null;
>if (orderHeader != null) {
>paymentSettings = getPaymentSettings(orderHeader, paymentPref,
>REFUND_SERVICE_TYPE, false);
>}
>...
>...
>String serviceName = paymentSettings.getString("paymentService");
>...
>...
>
>Here, you are getting the implementation specific service name for
>refunding.
>
>Once PaymentGatewayServices has that, it does the refund like so...
>...
>refundResponse = dispatcher.runSync(serviceName, serviceContext,
>TX_TIME, true);
>...
>
>In the case of CyberSource, serviceName would contain the name of the
>CyberSource refund service "cyberSourceCCRefund".
>
>Just for clarity, you won't find a method in IcsPaymentServices called
>"cyberSourceCCRefund". This is because the service name is mapped to
>IcsPaymentServices.ccRefund() in the xml file "services_cybersource.xml"
>like so...
>
><service name="cyberSourceCCRefund" engine="java"
>location="org.ofbiz.accounting.thirdparty.cybersource.IcsPaymentServices" invoke="ccRefund">
> <description>Credit Card Processing</description>
> <implements service="paymentRefundInterface"/>
></service>
>
>Obviously, there's a lot going on in there, but hopefully that gives you
>some indication of how it's hanging together.
>
>Kind Regards
>  
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - DataCash - Andrew Sykes

Andrew Sykes
Charles,

You're probably right about Paypal, I was having my doubts even as I
typed it...

Let me know how you get on...

Kind Regards
--
Andrew Sykes <[hidden email]>
Sykes Development Ltd

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - DataCash - Andrew Sykes

Charles Johnson-2
OK thanks. It would be useful to go into some sort of trace debug mode
so i can follow the application flow. Is that possible?

CJ

Andrew Sykes wrote:

>Charles,
>
>You're probably right about Paypal, I was having my doubts even as I
>typed it...
>
>Let me know how you get on...
>
>Kind Regards
>  
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - DataCash - Andrew Sykes

Andrew Sykes
Charles,

In base/config/debug.properties

You will see a line like this...
print.verbose=ftrue

Changing this to true will dramatically increase the amount of trace you
see.

Kind Regards
--
Andrew Sykes <[hidden email]>
Sykes Development Ltd

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - DataCash - Andrew Sykes

Charles Johnson-2
Hmm yes, but i really meant an IDE debug, such as Eclipse. I may be able
to do without it though. It's probably slight frustration at big
picture/small picture stuff as i normally studiously avoid debuggers ;-)

CJ

Andrew Sykes wrote:

>Charles,
>
>In base/config/debug.properties
>
>You will see a line like this...
>print.verbose=ftrue
>
>Changing this to true will dramatically increase the amount of trace you
>see.
>
>Kind Regards
>  
>

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users