wallee-payment / php-sdk

Wallee PHP SDK
https://wallee.com
Apache License 2.0
11 stars 7 forks source link

can't get response code #7

Closed ahmedmahgoup94 closed 4 years ago

ahmedmahgoup94 commented 4 years ago

while integrate to laravel app i got to redirect to payment page and simulate success and fail but can't get response code for what happens with payment system

thomashunziker commented 4 years ago

With the transaction ID you can fetch the state over the API. So you basically read the transaction and there you find the state property that indicates if the transaction was failed or authorized resp. completed or fulfill.

I would recommend to register as well a webhook so you can process the result as well when the user is closing the window before returning your site.

ahmedmahgoup94 commented 4 years ago

thank you that was great help but i still can't find which function i can use to read the state of the entity and further details using stateId

thomashunziker commented 4 years ago

You can use the TransactionService to read the transaction object (use the read operation). This object contains the state property. See: https://github.com/wallee-payment/php-sdk/blob/master/lib/Service/TransactionService.php#L1653

Regarding the different states I would recommend to check the description of the states: https://app-wallee.com/en-us/doc/payment/transaction-process