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. You can get them from the plugin, if required, e.g. $params['environment']['notify_url']

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 must be passed additionally in PlaceOrderAndAuthorize_API call - refer to description in the documentation.

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:

$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.

baseUrl is store url, depending on the parameter sent, the method is to be called, e.g. if that is notifyUrl then there must be something that triggers JsonRedirectNotify_API, etc.

Internal content