首页 > 解决方案 > HMRC 欺诈预防标头 - Delphi

问题描述

我正在使用 Delphi (REST) 在 MTD 增值税沙箱中提交 HMRC 欺诈预防标头。

这些正在工作: -

RESTRequest1.Params.AddHeader('Gov-Client-Connection-Method', UriEncode('DESKTOP_APP_DIRECT'));
RESTRequest1.Params.AddHeader('Gov-Client-Device-ID', UriEncode('beec798b-b366-47fa-b1f8-92cede14a1ce'));
RESTRequest1.Params.AddHeader('Gov-Client-Local-IPs', UriEncode('10.1.2.3'));
RESTRequest1.Params.AddHeader('gov-client-mac-addresses', UriEncode('30-65-EC-6F-C4-58'));

这些不起作用(使用 HMRC 数据示例):-

RESTRequest1.Params.AddHeader('Gov-Client-Timezone', UriEncode('UTC+00:00'));
RESTRequest1.Params.AddHeader('Gov-Client-Screens', UriEncode('width=1920&height=1080&scaling-factor=1&colour-depth=16'));
RESTRequest1.Params.AddHeader('Gov-Client-Window-Size', UriEncode('width=1256&height=803'));
RESTRequest1.Params.AddHeader('Gov-Client-User-Agent', UriEncode('Windows/10 (Dell/XPS15)'));
RESTRequest1.Params.AddHeader('Gov-Client-Multi-Factor', UriEncode('type=AUTH_CODE&timestamp=2017-04-21T13%3A23%3A42Z&unique-reference=c672b8d1ef56ed28,type=TOTP&timestamp=2017-05-19T13%3A10%3A00Z&unique-reference=ac73430ffdfd9'));
RESTRequest1.Params.AddHeader('Gov-Vendor-Version', UriEncode('My%20Desktop%20Software=1.2.3.build4286'));
RESTRequest1.Params.AddHeader('gov-vendor-license-ids', UriEncode('my%20licensed%20software=8D7963490527D33716835EE7C195516D5E562E03B224E9B359836466EE40CDE1'));

我在 Postman ( https://www.postman.com/ ) 中使用了上述所有 HMRC 数据示例,并且都被接受。

专注于1个不起作用的例子:-

RESTRequest1.Params.AddHeader('Gov-Client-Timezone', UriEncode('UTC+00:00'));

我得到这个回应: -

"INVALID_HEADER","message":"The header value is not in the format: 'UTC±<hh>:<mm>'.","headers":["gov-client-timezone"]},{"code":"INVALID_HEADER","message":"The offset value (hh:mm) provided is not correct. The header value should be in the format: 'UTC±<hh>:<mm>'.","headers":["gov-client-timezone"]},

关于我做错了什么的任何想法?

标签: delphi

解决方案


推荐阅读