I'm currently writing a custom payment provider for Google Checkout;
Google allows you to set an API callback URL that can do one of three things. Two of these (XML api & name value pair api) are pretty useless for my needs as it requires you have a working SSL setup,
The one that I'm using is the 'Serial Number Notification'. This 'sends a serial number notification for every order notification. This notification is not in XML format and contains the serial number as a name value pair in the POST message body. e.g. serial-number=134827144342486-00001-7'. [You can then do some handshaking with the server to get full order XML]
Given that, I imagine the API callback URL (stored at the google end) needs to be something like;
However if I hit this in my browser, I get a blank XML document. Attaching to the process in visual studio gives me no activity in my public override CallbackInfo ProcessCallback(TeaCommerce.Data.Order order, HttpRequest request, Dictionary<string, string> settings) method.
I'm getting the feeling that I've got the wrong end of the stick somewhere?
What is the id of your payment provider? And what is the alias? Could you get me a screenshot of the text you have in the payment providers text area in the Tea Commerce general settings?
Yep - I was using a variant of that post that I found somewhere on Our,
I'm running the project locally, and debugging by attaching visual studio to the IIS process that that the project is running under,
Should that web service method cause the ProcessCallback method to be hit? So if you hit the URL (domain.whatever/tcbase/teacommerce/PaymentCallbackWithoutOrderId/GoogleCheckout/1) in your browser, visual studio should pick up your breakpoints on the ProcessCallback method?
This is the code for the PaymentCallbackWithoutOrderId - if you run locally like domain.local/ it should attach - if not - be sure to have build as Debug and you have copied the newest bin and pdb files to your bin directory for the local website.
You would of course need to have the orderId as a post or get variable. And you would also have to have some security info so you can validate it and be sure the info is valid and secure.
OK in that case, I will need to write my own version of the PaymentCallbackWithoutOrderId method as I need to do some handshaking with the google server before I can get the orderId that the callback request relates to,
Initial issues with this seem to be that the GetPaymentProviderInstance method doesn't appear to exist within TeaCommerce.Base? And Base.PaymentCallback is looking for two string parameters rather than an IPaymentProvider and a long,
Could this be due to the tea commerce version that I'm running?
That's proabalby only an accademic question as my new method will only work with / be called by google so I can just code as google needs :)
Custom payment provider Callback URL
Hi All,
I'm currently writing a custom payment provider for Google Checkout;
Google allows you to set an API callback URL that can do one of three things. Two of these (XML api & name value pair api) are pretty useless for my needs as it requires you have a working SSL setup,
The one that I'm using is the 'Serial Number Notification'. This 'sends a serial number notification for every order notification. This notification is not in XML format and contains the serial number as a name value pair in the POST message body. e.g. serial-number=134827144342486-00001-7'. [You can then do some handshaking with the server to get full order XML]
Given that, I imagine the API callback URL (stored at the google end) needs to be something like;
http://domain.whatever/tcbase/teacommerce/PaymentCallbackWithoutOrderId/GoogleCheckout/1
However if I hit this in my browser, I get a blank XML document. Attaching to the process in visual studio gives me no activity in my public override CallbackInfo ProcessCallback(TeaCommerce.Data.Order order, HttpRequest request, Dictionary<string, string> settings) method.
I'm getting the feeling that I've got the wrong end of the stick somewhere?
Many Thanks,
Tom
Ah can't seem to edit my post for some reason, and it's formatted the URL
here it is again; domain.whatever/tcbase/teacommerce/PaymentCallbackWithoutOrderId/GoogleCheckout/1
Hi Tom
Have your remembered to override the AllowCallbackWithoutOrderId and return true? Else it wont allow the server code to call this method
Kind regards
Anders
Hi Anders,
Yep - I have overridden that bool,
Here's the source of my payment provider thus far,
What is the id of your payment provider? And what is the alias? Could you get me a screenshot of the text you have in the payment providers text area in the Tea Commerce general settings?
Kind regards
Anders
Hi Anders,
<Provider alias="GoogleCheckout" assembly="umbraco-extensions" type="umbraco_extensions.teaCommerceExtensions.GoogleCheckoutPaymentProvider" />
Yes the id is 1 and the alias also looks right.
Have you read this post, maybe that can help you. - look for the "silent post url" - http://anders.burla.dk/umbraco/tea-commerce/using-authorize-net-with-tea-commerce/
Are you running your project locally to debug it?
Hi Anders,
Yep - I was using a variant of that post that I found somewhere on Our,
I'm running the project locally, and debugging by attaching visual studio to the IIS process that that the project is running under,
Should that web service method cause the ProcessCallback method to be hit? So if you hit the URL (domain.whatever/tcbase/teacommerce/PaymentCallbackWithoutOrderId/GoogleCheckout/1) in your browser, visual studio should pick up your breakpoints on the ProcessCallback method?
Thanks,
T
This is the code for the PaymentCallbackWithoutOrderId - if you run locally like domain.local/ it should attach - if not - be sure to have build as Debug and you have copied the newest bin and pdb files to your bin directory for the local website.
Kind regards
Anders
Hi Anders,
That's really helpful thanks.
I imagine the orderId lookup is failing in that case which is why my PaymentCallback method isn't being hit.
Does anything special need to be in the Reqeust in order for it to succeed?
Many Thanks,
Tom
You would of course need to have the orderId as a post or get variable. And you would also have to have some security info so you can validate it and be sure the info is valid and secure.
Kind regards
Anders
Hi Anders,
OK in that case, I will need to write my own version of the PaymentCallbackWithoutOrderId method as I need to do some handshaking with the google server before I can get the orderId that the callback request relates to,
Initial issues with this seem to be that the GetPaymentProviderInstance method doesn't appear to exist within TeaCommerce.Base? And Base.PaymentCallback is looking for two string parameters rather than an IPaymentProvider and a long,
Could this be due to the tea commerce version that I'm running?
That's proabalby only an accademic question as my new method will only work with / be called by google so I can just code as google needs :)
Thanks,
Tom
Hi Anders,
I'm being a massive spanner,
I had forgotten to public override long? GetOrderId(HttpRequest request, Dictionary<string, string> settings)
is working on a reply...