wallee-payment / magento-2

Wallee integration for Magento 2.3 and later
https://wallee.com
Apache License 2.0
3 stars 3 forks source link

How webhook can be executed on system without the internet #22

Open waleedbasit opened 1 year ago

waleedbasit commented 1 year ago

How webhook can be executed on a system not accessible from the internet, as they are typically used to trigger events in response to certain actions. Is there a way to maybe configure a proxy for this, which would forward incoming webhook requests to a local system?

sprankhub commented 1 year ago

It would be possible to use something like ngrok or Expose to make the local system accessible from the outside. However, this is quite some configuration work. Hence, we are especially interested in a way to trigger the webhooks without exposing the local system to the outside. I can think of two ways:

  1. A "Fetch Payment Update" button in the order view of Magento, which gets the latest updates from Wallee.
  2. A possibility to copy a webhook as a curl request in the Wallee backend, which can then be executed locally.
theodorspringwallee commented 1 year ago

Dear waleedbasit, sprankhub

We also would recommend you NGROK for local systems.

Else as recommended from @sprankhub you can update the concerned wallee objects (transactions, payment methods, etc.) over our SDK's.

You can extend our plugin for your local system purposes by yourself with our PHP SDK: https://github.com/wallee-payment/php-sdk/ (this SDK is already used within our wallee plugin)

For example, if you want to get the newest transaction status, you can do it like this with our SDK:

$apiClient = new ApiClient("your application user id as int", "your application user token as string");
$spaceId = "your space id as int";
$transaction = $apiClient->getTransactionService()->read($spaceId, "concerned transaction id as int");
echo $transaction->getState();

Please let me know, when you have further questions.

Best regards