Beispiel #1
0
 public static void printGetAuthorizeAnswerResponse(GetAuthorizeAnswerResponse gaaResponse)
 {
     Console.WriteLine("Status Code: " + gaaResponse.getStatusCode());
     Console.WriteLine("AuthorizationKey: " + gaaResponse.getAuthorizationKey());
     Console.WriteLine("EncodingMethod: " + gaaResponse.getEncodingMethod());
     Console.WriteLine("StatusMessage: " + gaaResponse.getStatusMessage());
     Console.WriteLine("Payload: ");
     printDictionary(gaaResponse.getDictionaryPayload(), "");
 }
Beispiel #2
0
        public GetAuthorizeAnswerResponse getAuthorizeAnswer(GetAuthorizeAnswerData gaa)
        {
            try
            {
                using (client = new AuthorizeService.AuthorizePortTypeClient(this.AuthorizeBinding, this.AuthorizeEndpoint))
                {
                    Console.WriteLine(client.Endpoint.Address);
                    HeaderHttpExtension.AddCustomHeaderUserInformation(new OperationContextScope(client.InnerChannel), this.Headers);

                    string statusMessage, authorizationKey, encodingMethod;
                    object payload;

                    var statusCode = client.GetAuthorizeAnswer(
                        gaa.getSecurity(),
                        gaa.getSession(),
                        gaa.getMerchant(),
                        gaa.getRequestKey(),
                        gaa.getAnswerKey(),
                        out statusMessage,
                        out authorizationKey,
                        out encodingMethod,
                        out payload);

                    GetAuthorizeAnswerResponse response = new GetAuthorizeAnswerResponse(statusCode, statusMessage, authorizationKey, encodingMethod, payload);
                    return response;
                }
            }
            catch (Exception ex)
            {
                GetAuthorizeAnswerResponse response = new GetAuthorizeAnswerResponse(0, ex.Message, "", "", "");
                return response;
            }
        }