Search Engine: Elastic

Article ID: 130886, created on May 29, 2017, last review on May 29, 2017

  • Applies to:
  • Business Automation 7.0

Question

As described in the documentation system parameters are used in payment plugin:

return_url_ok
return_url_failed

How and where these environment parameters can be configured in BA Payment PHP plugin?

Resolution

These parameters are internal and cannot be configured manually. In the control panel (e.g. placing a payment from PCP) they are automatically generated like this:

"return_url_ok":"https://<ba_hostname>/bss-www/nologin/srv/BM/JsonRedirectPaymentOk/swep/action/return/EActivityID/<ID>/"
"notify_url":"https://<ba_hostname>/bss-www/nologin/srv/BM/ProcessNotificationJsonPlugin/swep/action/notify/EActivityID/<ID>/"

If you are using API or custom on-line store, then the parameters are to be passed additionally in PlaceOrderAndAuthorize_API call. That information is currently absent in the docs, there is a bug #PBA-78814 ("PlaceOrderAndAuthorize_API method has non-documented but obligatory parameters callbackUrlOk and callbackUrlFail"), below is information that will be added to Pay Tool Data section of the PlaceOrderAndAuthorize_API method, both for "modal form" and "external redirect" paytools:

originUrl – mandatory parameter; URL of the payment originator;

callbackUrl – mandatory parameter; URL to return to with any status (some payment systems do not respond statuses on return, just transaction identifiers). To process the response, the JsonRedirectPayment_API method must be called next to process the data received in HTTP response;

callbackUrl3D – mandatory parameter; URL to handle responses from 3D-Secure gateway. To process the response, the JsonCallback3D_API method must be called next;

callbackUrlOk – mandatory parameter; URL to return with success status. To process the response, the JsonRedirectPayment_API method must be called next with returnResult='ok' and HTTP data;

callbackUrlFail – mandatory parameter; URL to return with fail status. To process the response, the JsonRedirectPayment_API method must be called next with returnResult='fail' and HTTP data;

notifyUrl – mandatory parameter; URL to handle server-to-server notifications. To process the response, the JsonRedirectNotify_API method must be called next.

See the example of how these URLs are generated in the Custom Online Store:

// Callback URLs are based on the “Referer” header to resolve network path.

$refererParts = explode( '?', $_SERVER['HTTP_REFERER']);
$baseUrl = "https://my-custom-store/callback.php";;
$PayToolData['originUrl']       =  $baseUrl;
$PayToolData['callbackUrl']     = "$baseUrl/{docId}/callback";
$PayToolData['callbackUrl3D']   = "$baseUrl/{docId}/3dsecure";
$PayToolData['callbackUrlOk']   = "$baseUrl/{docId}/ok/callback";
$PayToolData['callbackUrlFail'] = "$baseUrl/{docId}/fail/callback";
$PayToolData['notifyUrl']       = "$baseUrl/{docId}/notify";

where {docId} is a placeholder for transaction ID.

198398b282069eaf2d94a6af87dcb3ff caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 c0f836394088a28cc30dd0e5fe8b600e b2c3b33425dfc50c7d41a2efaa7f84f3

Email subscription for changes to this article
Save as PDF