10000 Added dynamic callbacks mode functionality by Alex-Sh · Pull Request #1 · dercoder/omnipay-ecopayz · GitHub
[go: up one dir, main page]

Skip to content

Added dynamic callbacks mode functionality #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

Alex-Sh
Copy link
Contributor
@Alex-Sh Alex-Sh commented Jul 8, 2016

No description provided.

8000 @dercoder
Copy link
Owner
dercoder commented Jul 8, 2016

Hi, please use omnipay functions for this: returnUrl, cancelUrl, notifyUrl
https://github.com/thephpleague/omnipay-common/blob/master/src/Omnipay/Common/Message/AbstractRequest.php#L554

@dercoder
Copy link
Owner
dercoder commented Jul 8, 2016

And please show me the docs. i could not found anything in ecoPayz_MIG_2.0.3.pdf. Maybe my one is deprecated

@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 9, 2016

@dercoder
Copy link
Owner
dercoder commented Jul 9, 2016

OnSuccessUrl = returnUrl
OnFailureUrl = cancelUrl
TransferUrl = notifyUrl
If you want to add CancellationUrl and CallbackUrl please also add request handlers

@dercoder
Copy link
Owner

Please check my latest commit

@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 11, 2016

Thanks. What do you mean on adding request handlers for Cancel and Callback URL? Like CompletePurchaseRequest.php? I think CallbackUrl shares the same request/response, not sure about CancellationUrl.

@dercoder
Copy link
Owner

Yes, like CompletePurchaseRequest.php. Please find out how CallbackUrl and CancellationUrl work and please test current master branch with "returnUrl", "cancelUrl" and "notifyUrl"

returnUrl, cancelUrl and notifyUrl added for API 2.0.6
@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 16, 2016

Current master works well.

This is EcoPayz response about Callback and Cancellation functionality:

Crediting account after getting callback message is more secure because we finalise transaction on our end only after receiving your SVSPurchaseStatusNotificationResponse. If your confirmation response does not reach us, then we mark transaction as failed. However, your system will consider transaction to be successful as a result you might be crediting client with money that were not transferred to you.

Here is the sample of the successful callback:

 <?xml version="1.0" encoding="utf-8"?><TransactionResult xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ErrorCode>0</ErrorCode><Message>OK</Message><SvsTxID>1573010000033532608</SvsTxID><TransactionType>Purchase</TransactionType><ProcessingTime>20150406 11:06:56</ProcessingTime><Amount>100</Amount><Currency>EUR</Currency><MerchantAccountNumber>100000</MerchantAccountNumber><ClientAccountNumber>1112345975</ClientAccountNumber><TransactionDescription /><ClientTransactionID>1428318397A3E932B549</ClientTransactionID></TransactionResult>

The only positive callback is 0. If you get any other code or dont get a callback at all, you must decline transaction on your end.

CancellationUrl. This is optional url and therefore optional function. Our system can reverse successful customer deposits with merchants. The reversal can be initiated only by us by sending SVSPurchaseStatusNotificationRequest with status 5 to the CancellationURL.
This is optional feature because we can reverse deposits without sending a notification (but only after investigating each such case with the merchant and getting approval)

So we can receive CallbackUrl data just using $gateway->completePurchase(); and there is no need to make a response. This is working fine. And CancellationURL is same as TransferUrl, so no need to create new handlers.

Can you please add an option to define Callback and Cancellation URLs?

@dercoder
Copy link
Owner

So CallbackUrl = TransferUrl = notifyUrl?
Is this correct?

@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 16, 2016

Not really
TransferUrl - We will receive SVSPurchaseStatusNotificationRequest and we should send SVSPurchaseStatusNotificationResponse
NotifyUrl = TransferUrl in terms of Omnipay
CallbackUrl - We will receive TransactionResult and no need to response, and it still can be processed with completePurchase(), like TransferUrl
CancellationUrl = TransferUrl (according to EcoPayz answer, I can't test it)

@dercoder
Copy link
Owner

so CallbackUrl is like TransferUrl but dont need any response? so why we cant use Omnipay NotifyUrl for Callback and Transfer?

@dercoder
Copy link
Owner

CompletePurchaseRequest will only return a response on the second request for confirmation. The data is the same. My conclusion TransferUrl = CallbackUrl.

TransferUrl:
Merchant’s Listener URL (used for server to server calls between the Merchant and ecoPayz)

CallbackUrl:
It can be the same URL as your Listener or a different URL

@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 16, 2016

I think we need to keep them different, because there can be different processing logic - logging, applying transaction (only on Callback), etc.
For example I will make Merchant side processing only on CallbackUrl, like it should be, and TransferUrl will be only used to accept/decline transactions according to EcoPayz request.

@dercoder
Copy link
Owner

Please ask the omnipay community how we should handle this: https://github.com/thephpleague/omnipay

@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 16, 2016

Quick example, just to clarify what I want to achieve

Callbacks: http://prntscr.com/btp6iz
PurchaseRequest class: http://prntscr.com/btp7jj

All I need is these two options. And because it's EcoPayz only functionality and not implemented in Omnipay core, it can be sorted on your repository level.

@dercoder
Copy link
Owner

I need only TransferUrl for transaction processing. Your example does not makes sense to me. It would be ok when we use omnipay notifyUrl for Transfer and Callback. This would make sense to me.

If you insist, please ask omnipay community or the omnipay leader: https://github.com/greydnls

@Alex-Sh
Copy link
Contributor Author
Alex-Sh commented Jul 16, 2016

I need only TransferUrl for transaction processing.

According to EcoPayz support response the only safe way to process transactions is CallbackUrl. But ok, I'll ask Omnipay

@dercoder
Copy link
Owner

Thx, Please keep me up 2 date. Ecopayz is paradox. Callback is only the safe way but its not enabled by default.

@Alex-Sh Alex-Sh closed this Jul 17, 2016
jcfrane pushed a commit to koalaphils/omnipay-ecopayz that referenced this pull request Jun 16, 2022
[PIWI-7] Add Pinnacle Bundle

Approved-by: Jayfer Balecha <jayfer.balecha@zmtsys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0