Esempio n. 1
0
        public ExecuteResponse execute(ExecuteData exe)
        {
            try
            {
                using (client = new AuthorizeService.AuthorizePortTypeClient(this.AuthorizeBinding, this.AuthorizeEndpoint))
                {
                    HeaderHttpExtension.AddCustomHeaderUserInformation(new OperationContextScope(client.InnerChannel), this.Headers);

                    string statusMessage, authorizationKey;
                    string enc = exe.getEncodingMethod();
                    Object pay = exe.getPayload();

                    var statusCode = client.Execute(
                        exe.getSecurity(),
                        exe.getSession(),
                        exe.getMerchant(),
                        exe.getOperation(),
                        ref enc,
                        ref pay,
                        out statusMessage,
                        out authorizationKey);

                    ExecuteResponse response = new ExecuteResponse(statusCode, statusMessage, authorizationKey, enc, pay);
                    return response;
                }
            }
            catch (Exception ex)
            {
                ExecuteResponse response = new ExecuteResponse(0, ex.Message, "", "", null);
                return response;
            }
        }
Esempio n. 2
0
 public static void printExecuteResponse(ExecuteResponse exResponse)
 {
     Console.WriteLine("Status Code: " + exResponse.getStatusCode());
     Console.WriteLine("StatusMessage: " + exResponse.getStatusMessage());
     Console.WriteLine("AuthorizationKey: " + exResponse.getAuthorizationKey());
     Console.WriteLine("EncodingMethod: " + exResponse.getEncoding());
     Console.WriteLine("Payload: " + exResponse.getPayload());
 }