For processing response from GPWebPay your are need service.response_factory
and service.response_provider
$params = $_GET; // or $_POST depends on how you send request
$response = $responseFactory->create($params);
Now you are have two options.
Processing by your code.
// verify response signatures
if (!$provider->verifyPaymentResponse($response)) {
// invalid verification
}
// success verification
if ($response->hasError()) {
// here is you code for processing response error
}
// here is you code for processing response
Or use ResponseProvider and callbacks
// success callbacks
$provider
->addOnSuccess(
static function (ResponseInterface $response) {
// here is your code for processing response
}
)
->addOnSuccess(
static function (ResponseInterface $response) {
// here is your another code for processing response
}
);
// error callback
$provider->addOnError(
static function (GPWebPayException $exception, ResponseInterface $response) {
// here is you code for processing error
}
);
// and next step is call
$provider->provide($response);
A text description of the error identified by a combination of PRCODE and SRCODE. The contents are coded using the Windows Central European (Code Page 1250).
- return
string
$response->getResultText();
Primary code. For details, see “List of return codes in GPWebPay doc”.
- return
int
$response->getPrcode();
Secondary code. For details, see “List of return codes in GPWebPay doc”.
- return
int
$response->getSrcode();
Contents of the field from the request.
- return
string
$response->getOrderNumber();
Contents of the field from the request, if included.
- return
string
|null
$response->getMerOrderNumber();
Hash numbers of the payment card. Hash is a unique value for each and every card and merchant – that is if the payment is made by the same card at the same merchant, the resulting hash is identical, if the same card is used at another merchant, there is another hash.
- return
string
|null
Note
Only if the merchant has this functionality enabled
$response->getUserParam1();
Hash numbers of the payment card. Hash is a unique value for each and every card and merchant – that is if the payment is made by the same card at the same merchant, the resulting hash is identical, if the same card is used at another merchant, there is another hash.
Note
GPWebPay core use this field to store information about used gateway.
So method $response->getParam(string $paramName)
return value contain gateway info.
- return
string
|null
$response->getMd();
Digest is a check signature of the string generated as a concatenation of all the fields sent in the given order
Digest1 is same as Digest but (without the DIGEST field) and on the top of that also the MERCHANTNUMBER field (the field is not sent, the merchant has to know it, the field is added to the end of the string).
- return
string
$response->getDigest();
$response->getDigest1();