Developer forum

Forum » Ecommerce - Standard features » PayCek integration

PayCek integration

Tomislav Bušić
Reply

Hello people,

does anyone know how to change the ID sent for communication in the settings?

PayCek creates the same ID, and I'm experiencing conflicts.

I've changed it in this file in the picture, but I still get a 404 error.

Where else do I need to change that Default.aspx?IDs...?

Thanks in advance.

BR

Tomislav

statusid.png statusids.png statusids2.png statusids3.png

Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Default.aspx?ID=123 is DynamicWeb's way of referring to a page with an ID of 123 in the backend. You can't / shouldn'ty change this parameter.

Normally, payment providers want order IDs to be unique, not call back page IDs, so maybe you're trying to change the wrong things? If you provide more info, such as what "PayCek creates the same ID, and I'm experiencing conflicts. " means, we might be able to offer more help.

Imar

Votes for this answer: 1
 
Tomislav Bušić
Reply

Hi Imar,

I apologize if I didn't express myself well.

As you can see in the first picture when I removed the id created by paycek I have the response as it should be.

When I tested with Postman, when I remove one of the ID from Dynamicweb or PayCek,

I get a status, otherwise I have no response.

So I thought that the only solution would be to change on the Dynamicweb side if it is not ID but, for example, IDS..

Thanks in advance.

BR

Tomislav

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I still don't get it. I think there are possibly two URLs:

1. When you post to your payment provider. In that URL, there should not be a page from DynamicWeb, only info that PayCek needs. It will look something like this: https://paycek.com/something/?OrderID=Order456

2. When PayCek redirects back to DW. That should include an ID (like default.aspx?ID=123) or a custom URL backed by an ID internally (like /cart/thankyou which internally is handled by Default.aspx?Id-=123) It looks like this: https://yourdwsite.com/Default.aspx?ID=123

So when / how / where / why do your ID parameters collide?

Imar

 
Tomislav Bušić
Reply
 
Tomislav Bušić
Reply

Hi Imar,

I will try to clarify this from beginning with the help of my colleague since I'm not sure if I described the problem properly the first time (sorry for any confusion). Basically, we are working on the integration with the external service for crypto payments called "PayCek". In order to do this, we created new assembly file (.dll) in C# with class which inherits Dynamics Web "CheckoutHandler" base class.

We managed to call the external service without issues. Once the client choses the "PayCek" payment method, he is redirected to the PayCek page to finish the payment. 

Now, "PayCek" service allows the callbacks back to the caller (in this case, Dynamic Web) since paymet processing can take some time. Only thing we need to do is to provide the "Callback" URL to the "PayCek" service. Process for generating the callback URL which Dynamic Web can handle is described in detail in DW documentation:


Here is the example of the URL which we generated with this method, which we forward to the "Paycek" service on the initial call:
"HTTP://192.168.5.29/Default.aspx?ID=1844&CheckoutHandlerOrderID=ORDER1471"

If we call this method manually on server trough Postman, it works without issues.

Issue here is that "Paycek" service adds its additional parameters to the callback URL which is generated by Dynamic Web. Here is the example of that URL:
"HTTP://192.168.5.29/Default.aspx?ID=1844&CheckoutHandlerOrderID=ORDER1471&id=ORDER1471&status=successful&dst_amount=21.55&src_amount=0.0008831&dst_currency=EUR&payment_code=HGI5Qvrphkis6-xURqWy1VbuQ49MrSPnEbXTKiuZptFq&profile_code=bitjVPzgjx7FKHzn_MwXggOLFx_C-zuddE162DpDeE0k&src_currency=BTC&tx_fee_amount=0.00032&receive_coin_tag=&receive_coin_address=bc1q87se3taewvm94a3k9txcegnxdmg98qw3mez0re&exchange_rate_dst_src=38270.187523&exchange_rate_src_dst=0.0000261300"
Basically, DW does NOT catch this URL. What we found out is that "Paycek" service adds its own "id" parameter for which we guess causes issues and DW does not recognize the URL

We tried to call this URL manually directly from the server where DW is hosted, and DWs "Redirect" method was not triggered. But if we remove the additional "id" parameter (added by Paycek) from the URL and then to the GET call from Postman, Dynamic web normally catches the method (code in the "Redirect" method is triggered)

Now, issue here is that we don't know how to proceed with this... we can't rename the "ID" parameter which is generated by Dynamic Web. But of course, we also can't ask the team behind "Paycek" service to rename / remove "id" from their side. Our guess is that this parameter duplicated causes the issue of DW not catching the GET request (callback). Please, correct us if we missed anything here.

Do you have any proposals on how to proceed on this issue?
Thank you very much for the provided assistance so far.

Tomislav B.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

That explains it much better, thanks.

Interesting issue, for which I can think of a few solutions:

1. See if there's a way in the provider to change their parameters, so you can change ID to OrderID or so

2. Use a friendly URL. So instead of Default.aspx?ID=123, use something like /cart/payment. 

3. Use a subscriber that runs early on in the pipeline, such as Dynamicweb.Notifications.Standard.Application.AuthenticateRequest. Then in that subscriber, analyze the URL to see if you have two ID parameters.  If you do, strip of the one from PayCek (it's the one that doesn't convert to a number, and put it back on with a different name. I.e. you'd be redirecting from:

Default.aspx?ID=123&id=Order456 

to

Default.aspx?ID=123&OrderId=Order456 

Because of the rename, you end up with a single ID param that DW can handle.

Imar

Votes for this answer: 1

 

You must be logged in to post in the forum