Exemple #1
0
        public static void authorizeSample()
        {
            try
            {
                decidir.initAuthorize();

                //SendAuthorizeRequest
                SendAuthorizeRequestData     sar         = initSendAuthorizeRequestData();
                SendAuthorizeRequestResponse sarResponse = decidir.sendAuthorizeRequest(sar);
                printSendAuthorizeRequestResponse(sarResponse);

                //GetAuthorizeAnswer
                GetAuthorizeAnswerData     gaa         = initGetAuthorizeAnswerData();
                GetAuthorizeAnswerResponse gaaResponse = decidir.getAuthorizeAnswer(gaa);
                printGetAuthorizeAnswerResponse(gaaResponse);

                //Execute
                ExecuteResponse exResponse = decidir.execute(initExecuteData());
                printExecuteResponse(exResponse);
            }
            catch (Exception ex)
            {
                // TODO Auto-generated catch block
                Console.WriteLine(ex.Message);
            }
        }
Exemple #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.ToString());
                    return(response);
                }
            }
            catch (Exception ex)
            {
                GetAuthorizeAnswerResponse response = new GetAuthorizeAnswerResponse(0, ex.Message, "", "", "");
                return(response);
            }
        }
Exemple #3
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: " + gaaResponse.getPayload());
 }