EBS支付网关:编码响应 [英] EBS payment gateway: encoded response
问题描述
当返回网址指定为 http时,EBS可以将响应参数作为单个GET参数返回://www.yourdomainname.com/response.extension?DR = {DR}'如知识渊博所描述的那样。
EBS can return the response parameters as single GET parameter when the return url is specified as 'http://www.yourdomainname.com/response.extension?DR={DR}' as described in knowledgeable.
然而,我找不到规范如何解密和验证响应。另外,集成指南(v.3)不包含有关该主题的任何信息。
However I can not find the specification how to decrypt and validate the response. Also the Integration guide (v.3) does not contain any information on the subject.
我发现很少使用此选项的示例,并通过自定义RC43解码器解密他们的响应。
I have found few examples which uses this options and decrypts their response via custom RC43 decoder.
指定了DR变量,响应包含单个编码/加密字符串。
然而,我无法识别实际使用什么类型的算法(我怀疑RC4流密码),大多数示例以解密结束(没有实际验证)。
With the DR variable specified the response contains single encoded/encrypted string. However the I am unable to recognise what sort of algorithm is actually used (I suspect RC4 stream cyphers) and most examples ends with the decryption (without actual validation).
我正在寻找有关该主题的任何信息。
I am looking for any information on the subject.
推荐答案
集成工具包实际提供了一种方法如何使用和解码响应。但是并非所有套件都使用此功能或者完全验证响应。
The integration kits actually provide a way How to use and decode the response. However not all kits use this or verify the response at all.
要使用加密的响应,返回URL必须投诉以下格式,如知识库:' http://www.yourdomainname.com/response.extension?DR = {DR}'
To use the encrypted response the return url must complain the following format as specified in knowledgebase: 'http://www.yourdomainname.com/response.extension?DR={DR}'
$DR = preg_replace("/\s/","+",$_GET['DR']);
$rc4 = new Crypt_RC4($secret_key);
$QueryString = base64_decode($DR);
$rc4->decrypt($QueryString);
$QueryString = explode('&',$QueryString);
$response = array();
foreach($QueryString as $param){
$param = explode('=',$param);
$response[$param[0]] = urldecode($param[1]);
}
return $response
Crypt_RC43 然后由EBS在集成工具包的一部分的 Rc43 文件中提供实际处理解密的类。
The Crypt_RC43 class which actually takes care of the decryption is then provided by EBS inside of Rc43 file which is part of the integration kits.
注意:我已经说明了 Rc43文件不是每个集成工具包的一部分。一些套件甚至包括Crypt_RC43类作为控制器的私有内部类。对于我的实现,我使用了包含在 Wordpress-3.7.x捐赠集成套件。
Note: As I have stated the Rc43 file is not part of every integration kit. Some kits even includes the Crypt_RC43 class as a private inner class of the controller. For mine implementation I have used the Rc43 file contained in Wordpress-3.7.x Donate integration kit.
这篇关于EBS支付网关:编码响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!