feat: add fiscalization settings, POST callbacks and fix callback issues
This commit is contained in:
@@ -719,34 +719,6 @@ class Callback extends \Opencart\System\Engine\Controller
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<non-empty-string, mixed> $data
|
||||
* @return array
|
||||
*/
|
||||
public function buildJsonResponse(array $data): array
|
||||
{
|
||||
$jsonData = [
|
||||
'id' => $data['MNT_ID'],
|
||||
'transactionId' => $data['MNT_TRANSACTION_ID'],
|
||||
'amount' => $data['MNT_AMOUNT'],
|
||||
'signature' => $data['MNT_SIGNATURE'],
|
||||
'resultCode' => $data['MNT_RESULT_CODE'],
|
||||
'description' => $data['MNT_DESCRIPTION'],
|
||||
'externalId' => $data['MNT_TRANSACTION_ID'],
|
||||
'receipt' => [
|
||||
'client' => $data['client'],
|
||||
'items' => $data['items'],
|
||||
],
|
||||
];
|
||||
|
||||
$json = json_encode($jsonData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
|
||||
return [
|
||||
'data' => $json ?: '',
|
||||
'contentType' => self::JSON_CONTENT_TYPE,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array{data: string, contentType: string}
|
||||
|
||||
@@ -17,7 +17,7 @@ trait PayAnyWay
|
||||
private static int $orderLockTimeoutSeconds = 10;
|
||||
|
||||
private static string $moduleCode = 'payanyway';
|
||||
private static string $moduleVersion = '1.0.3';
|
||||
private static string $moduleVersion = '1.0.4';
|
||||
private static string $defaultCmsName = 'OpenCart';
|
||||
|
||||
private static int $clientEmailMaxLength = 64;
|
||||
@@ -301,25 +301,4 @@ trait PayAnyWay
|
||||
|
||||
return $email;
|
||||
}
|
||||
|
||||
/** @return non-empty-string|null */
|
||||
private function getClientName(): ?string
|
||||
{
|
||||
$name = trim(($this->orderInfo['firstname'] ?? '') . ' ' . ($this->orderInfo['lastname'] ?? ''));
|
||||
return ('' !== $name) ? $name : null;
|
||||
}
|
||||
|
||||
/** @return non-empty-string|null */
|
||||
private function getClientEmail(): ?string
|
||||
{
|
||||
$email = trim((string)($this->orderInfo['email'] ?? ''));
|
||||
return ('' !== $email) ? filter_var($email, FILTER_SANITIZE_EMAIL) : null;
|
||||
}
|
||||
|
||||
/** @return non-empty-string|null */
|
||||
private function getClientPhone(): ?string
|
||||
{
|
||||
$digits = preg_replace('/\D/', '', trim((string)($this->orderInfo['telephone'] ?? '')));
|
||||
return ('' !== $digits) ? '+' . $digits : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user