Migrated from Redmine #1230 | Author: Tudor Cotop Status: Feedback | Priority: High, I’m very impatient | Created: 2024-05-07
I have been trying to build a custom payment processor, following the steps described here: sbpay-sdk/example/custom_payment_processor/config.php at main · dimkasb/sbpay-sdk · GitHub. I’ve done what I think should be done, but when calling this line here: $client->payments()->validateCustomPaymentProcessorRequest($_POST);, I get the error “Signaturs is not set”.
That makes me believe that maybe the way I’ve configured the client is not correct. According to the documentation, I need these four values:
For the TOKEN, I’ve used the API key, and for the secret I’ve used the API secret. I’ve left the HOST the same as in the demo, and for merchant, I’ve used londontest (my URL is: https://londontest.simplybook.it/).
Hi, could you please clarify if you use simplybook keys or sbpay?
You should get it from sbpay, please make admin user in sbpay and you will be able to obtain a pay keys.
Hi, could you please clarify if you use simplybook keys or sbpay?
You should get it from sbpay, please make admin user in sbpay and you will be able to obtain a pay keys.
Hi Dmytro,
Thanks for getting back to me on this one. Could you help me figure out how I can create an admin user in sbpay?
I’ve created an SBPay account, and I’ve changed the values for SBPAY_TOKEN and SBPAY_SECRET to match the ones I have in SBPay (authentication token and secret key). I’ve used “londontest” as the merchant id, and ‘https://londontest.sbpay.me/’ as the SBAY_HOST, and I still get a signature error
$client = new \SBPay\SBPayClient(
$data->sbpay_token, $data->sbpay_secret,
$data->sbpay_merchant, ‘https://app.sbpay.me/’
);
try {
// Validate request that comes from SBPay
$client->payments()->validateCustomPaymentProcessorRequest($_POST);
} catch (\SBPay\Exceptions\Exception $e) {
// handle exception. Just show error message for demo purposes
die($e->getMessage());
}
It should be the same as the example provided on GitHub. The $data is something I read from the DB, and it’s populated correctly.
For whatever reason the POST that is being sent is redirected to a GET on my end. That’s definitely an issue so I’ll need to look into it.
But if I just run the example on your Github, it doesn’t work, because of this error. Is that the intended behaviour? To get the Signature not set error, when there’s no POST data?