gopay-inline
gopay-inline copied to clipboard
How to create signature?
Hi, according to the gopay documentation, it goes this way.
$encryptedSignature = GopayHelper::encrypt(
GopayHelper::hash(
GopayHelper::concatPaymentCommand($targetGoId,
$paymentSessionId,
$secureKey)
), $secureKey);
But the data that my response returns is
'id' => 3156614799
'order_number' => 'INF252'
'state' => 'CREATED'
'amount' => 605
'currency' => 'CZK'
'payer' => stdClass
'target' => stdClass
'recurrence' => stdClass
'additional_params' => array
'lang' => 'cs'
'gw_url' => 'https://gw.sandbox.gopay.com/gw/v3/4e26c514484f8c7fd08f45177aa503c4'
So what is the procedure for creating a signature? Because I didn't find any solution anywhere.
Thx
Well, I don't know. I need more info. Do you know @PavelJurasek?
According to the information, something like this works.
$paymentSessionId = trim($response->data['gw_url'], 'https://gw.sandbox.gopay.com/gw/v3');
$encryptedSignature = GopayHelper::encrypt(
GopayHelper::hash(
$response->data['id'] . '|' . $paymentSessionId . '|' . GoPayService::settings()['secretKey']
), GoPayService::settings()['secretKey']);
But I don't know if it's a good solution but it works.