When you register callbacks in the plugin they will also show up in the administration interface like this:
First of all, it is always important that the callbacks url are up to date. When you change credentials for example, they have to re-register so that salt keys and other data is really matching the data on Resurs Bank. This is however not a page about how that is made, but an explanation of the URLs. You may wonder why they look like this.
The callback urls are always using the format that WooCommerce and WordPress are using. From the method getWcApiUrl() in WooCommerce.php we will always get the proper API-call format from WooCommerce itself.
public static function getWcApiUrl() { return sprintf('%s', WC()->api_request_url('ResursDefault')); }
By doing this, we never have to worry about if WooCommerce will be able to handle the inbound requests from a callback handler. The above image is very much based on "pretty urls". That said, in our case we are using apache and mod_rewrite. The URLs could therefore look differently on your site. The parameters are described below.
AUTOMATIC_FRAUD_CONTROL
Since we no longer use AUTOMATIC_FRAUD_CONTROL, there's more variables that is no longer in effect and not mentioned in the table.
Parameter | Description |
---|---|
c | Abbreviation for callback type. When Resurs Bank is sending a callback the specific callback type is mostly hard coded like this and can not be set with for example {CALLBACK}, because they do not support that variable dynamically. |
t | An internal timestamp, based on time(). This is the plugin's own variable and wo'nt affect anything, but the time (your) when the registration was made. Be aware of this, since it much uses server time, so if you run a server in Los Angeles that is not properly configured the timestamp will probably be UTC+9. |
p | Even if the payment id is most likely known to us during the payment, this variable is set by Resurs Bank, so it is dynamically set. Therefore, we use {paymentId}. |
d | The same thing goes for d, as inĀ digest. The digest is set by the salt key set when the callbacks was registered. The digest is rendered like something like this: sha1/md5($callbackPaymentId . ($callbackResult !== null ? $callbackResult : null) . $saltKey) |