Developer forum

Forum » Development » GateProvider - how do i handle return data

GateProvider - how do i handle return data


Reply

Hey guys,

 

I'm in the process of making a Custom gateway provider, and i've gotten so far that i now get som response back from the payment system, wee!!.

 

When i submit my order data to the payment provider i send a Callback url and a Cancel url.

 

I use the DynamicWeb tags <--@Ecom:Order.Gateway.Page.CallBack--> and <--@Ecom:Order.Gateway.Page.Cancel--> for these to arguments.

 

When i complete a payment i'm redirected to the callback url with a lot of parameters in the URL, and i'd like to make som code to handle this, since DW doesn't know what to do with my parameters by defaullt.

 

My response could look like this 

/Default.aspx?ID=27&_OID_=ORDER49&step=6&Status_code=0&AuthCode=999999&Transaction_id=9999999&Customer_refno=ORDERXX&Version=2&Batch_id=&MAC=xxxxxx&Risk_score=&Payment_method=KORTINDK&Status=A&Card_type=VISA&Merchant_id=XXXX&3DSec=NA

 

Where in my GatewayProvider should i put the code to handle this? is it in the Render method aswell?

 

 

Regards

  Martin


Replies

 
Reply
mn@co3.dk wrote:

Hey guys,

 

I'm in the process of making a Custom gateway provider, and i've gotten so far that i now get som response back from the payment system, wee!!.

 

When i submit my order data to the payment provider i send a Callback url and a Cancel url.

 

I use the DynamicWeb tags <--@Ecom:Order.Gateway.Page.CallBack--> and <--@Ecom:Order.Gateway.Page.Cancel--> for these to arguments.

 

When i complete a payment i'm redirected to the callback url with a lot of parameters in the URL, and i'd like to make som code to handle this, since DW doesn't know what to do with my parameters by defaullt.

 

My response could look like this 

/Default.aspx?ID=27&_OID_=ORDER49&step=6&Status_code=0&AuthCode=999999&Transaction_id=9999999&Customer_refno=ORDERXX&Version=2&Batch_id=&MAC=xxxxxx&Risk_score=&Payment_method=KORTINDK&Status=A&Card_type=VISA&Merchant_id=XXXX&3DSec=NA

 

Where in my GatewayProvider should i put the code to handle this? is it in the Render method aswell?

 

 

Regards

  Martin

You should do this in the overridable method GetReturnValuesFromUrl(Order) on the Gateway class. The order sent to this method is the order with id _OID_.
   
 In this method you can request the values you need and update the order or do other things.
 This is the right place to update Order.GatewayResult and Order.TransactionNumber.
 You can also call Order.UpdateGatewayResult(bool success) to update the order and set it to complete if the transaction was successfull.
 

 
Reply
ldedw wrote:
mn@co3.dk wrote:

Hey guys,

 

I'm in the process of making a Custom gateway provider, and i've gotten so far that i now get som response back from the payment system, wee!!.

 

When i submit my order data to the payment provider i send a Callback url and a Cancel url.

 

I use the DynamicWeb tags <--@Ecom:Order.Gateway.Page.CallBack--> and <--@Ecom:Order.Gateway.Page.Cancel--> for these to arguments.

 

When i complete a payment i'm redirected to the callback url with a lot of parameters in the URL, and i'd like to make som code to handle this, since DW doesn't know what to do with my parameters by defaullt.

 

My response could look like this 

/Default.aspx?ID=27&_OID_=ORDER49&step=6&Status_code=0&AuthCode=999999&Transaction_id=9999999&Customer_refno=ORDERXX&Version=2&Batch_id=&MAC=xxxxxx&Risk_score=&Payment_method=KORTINDK&Status=A&Card_type=VISA&Merchant_id=XXXX&3DSec=NA

 

Where in my GatewayProvider should i put the code to handle this? is it in the Render method aswell?

 

 

Regards

  Martin

You should do this in the overridable method GetReturnValuesFromUrl(Order) on the Gateway class. The order sent to this method is the order with id _OID_.
   
 In this method you can request the values you need and update the order or do other things.
 This is the right place to update Order.GatewayResult and Order.TransactionNumber.
 You can also call Order.UpdateGatewayResult(bool success) to update the order and set it to complete if the transaction was successfull.
 

Hi Lasse,

 

Thanks, that works i got my order updated and saved.

 

But i'm a litle unsure about how i should handle the Succes and failure.

 

When i get my response from the payment provider it hits my callback page, with a lot of queystring parameters.

 

And i'd like to redirect the user to a page only with their order info, and no bloated qyerystring.

but which one? if i go to ID=xx&Step=6 my cart is gone.


 

 

 
Reply
mn@co3.dk wrote:
ldedw wrote:
mn@co3.dk wrote:

Hey guys,

 

I'm in the process of making a Custom gateway provider, and i've gotten so far that i now get som response back from the payment system, wee!!.

 

When i submit my order data to the payment provider i send a Callback url and a Cancel url.

 

I use the DynamicWeb tags <--@Ecom:Order.Gateway.Page.CallBack--> and <--@Ecom:Order.Gateway.Page.Cancel--> for these to arguments.

 

When i complete a payment i'm redirected to the callback url with a lot of parameters in the URL, and i'd like to make som code to handle this, since DW doesn't know what to do with my parameters by defaullt.

 

My response could look like this 

/Default.aspx?ID=27&_OID_=ORDER49&step=6&Status_code=0&AuthCode=999999&Transaction_id=9999999&Customer_refno=ORDERXX&Version=2&Batch_id=&MAC=xxxxxx&Risk_score=&Payment_method=KORTINDK&Status=A&Card_type=VISA&Merchant_id=XXXX&3DSec=NA

 

Where in my GatewayProvider should i put the code to handle this? is it in the Render method aswell?

 

 

Regards

  Martin

You should do this in the overridable method GetReturnValuesFromUrl(Order) on the Gateway class. The order sent to this method is the order with id _OID_.
   
 In this method you can request the values you need and update the order or do other things.
 This is the right place to update Order.GatewayResult and Order.TransactionNumber.
 You can also call Order.UpdateGatewayResult(bool success) to update the order and set it to complete if the transaction was successfull.
 

Hi Lasse,

 

Thanks, that works i got my order updated and saved.

 

But i'm a litle unsure about how i should handle the Succes and failure.

 

When i get my response from the payment provider it hits my callback page, with a lot of queystring parameters.

 

And i'd like to redirect the user to a page only with their order info, and no bloated qyerystring.

but which one? if i go to ID=xx&Step=6 my cart is gone.


 

 

Hi

A Callback-url is intended to be the url for a server-to-server call made by the gateway server to your webserver. This is only to provide information about the transaction and is not meant to display anything to the user.
The tag Ecom:Order.Gateway.Page.OK, however, is the one you're looking for. This url sends the user to step 5, which reads all the parameters (through a call to your GatewayProvider) and then redirects the user to step 6, which will display the order details.
The callback url does the same thing as the Page.OK about saving the information on the order, and is meant to be a backup if something fails clientside on the user.

 

 

You must be logged in to post in the forum