Creating an Amazon Flexible Payments Signature

亡梦爱人 提交于 2019-12-13 08:29:44

问题


I am working from this tutorial in Amazon for creating signatures: http://docs.amazonwebservices.com/AmazonFPS/latest/FPSBasicGuide/APPNDX_GeneratingaSignature.html

and I don't understand step a: "Sort the UTF-8 query string components by parameter name with natural byte ordering."

What UTF-8 string are they talking about? Is there maybe a PHP example of doing what they are talking about?

Thanks!!


回答1:


The query string, in this case, is the part of the URL after the "?". What the instructions are telling you is to sort the components of the query string, i.e. the parameters. For example, these parameters:

$param = array();
$param['transactionAmount'] = 1.00;
$param['returnURL'] = 'https://mydomain.com/receipt';
$param['currencyCode'] = 'USD';

Would be sorted into a URL with a query part that looks something like:

http://...?currencyCode=USD&returnURL=httpshttp%3A%2F%2Fmydomain.com%2Freceipt&transactionAmount=1.00

There is a PHP library for making calls to FPS located here. Inside that library is code that signs all of the requests (located in the Amazon_FPS_CBUIPipeline class). I would recommend that you use the library to generate all of your requests.



来源:https://stackoverflow.com/questions/8808385/creating-an-amazon-flexible-payments-signature

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!