我使用TRESTClient
和TRESTRequest
制作了一个小型测试应用程序。在开发机器上(安装了Delphi)一切正常。如果我在另一台机器上移动exe,则在按下按钮后应用程序挂起。我必须使用这个简单的应用程序部署哪些DLL文件?
这是代码:
procedure TForm44.Button1Click(Sender: TObject);
var
LClient: TRESTClient;
LRequest: TRESTRequest;
begin
LClient := TRESTClient.Create('https://secure.authorize.net/');
LClient.FallbackCharsetEncoding := '';
LRequest := TRESTRequest.Create(nil);
try
LRequest.Client := LClient;
LRequest.Method := TRESTRequestMethod.rmPOST;
LRequest.Resource := 'gateway/transact.dll';
// merchant info
LRequest.AddParameter('x_login', 'test', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_tran_key', 'test1', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_version', '3.1', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_test_request', 'TRUE', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_method', 'CC', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_type', 'AUTH_CAPTURE', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_amount', '10', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_delim_data', 'TRUE', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_relay_response', 'FALSE', TRESTRequestParameterKind.pkGETorPOST);
LRequest.AddParameter('x_description', 'Delphi_Transaction', TRESTRequestParameterKind.pkGETorPOST);
LRequest.Execute;
memo1.Lines.Text := LRequest.Response.Content;
finally
LClient.Free;
LRequest.Free;
end;
end;