예제 #1
0
파일: Program.cs 프로젝트: decidir/sdk-net
 public static GetAuthorizeAnswerData initGetAuthorizeAnswerData(SendAuthorizeRequestResponse sar)
 {
     string answerKey = "77215fe6-f9d5-f1c2-372b-c0065e0c4429";
     GetAuthorizeAnswerData gaa = new GetAuthorizeAnswerData();
     gaa.setMerchant(MERCHANT);
     gaa.setSecurity(SECURITY);
     gaa.setRequestKey(sar.getRequestKey());
     gaa.setAnswerKey(answerKey);
     return gaa;
 }
예제 #2
0
파일: Program.cs 프로젝트: decidir/sdk-net
 //Sample Print Methods
 public static void printSendAuthorizeRequestResponse(SendAuthorizeRequestResponse sarResponse)
 {
     Console.WriteLine("Status Code: " + sarResponse.getStatusCode());
     Console.WriteLine("StatusMessage: " + sarResponse.getStatusMessage());
     Console.WriteLine("PublicRequestKey: " + sarResponse.getPublicRequestKey());
     Console.WriteLine("RequestKey: " + sarResponse.getRequestKey());
     Console.WriteLine("URLRequest: " + sarResponse.getURLRequest());
 }
예제 #3
0
        public SendAuthorizeRequestResponse sendAuthorizeRequest(SendAuthorizeRequestData sar)
        {
            try
            {
                using (client = new AuthorizeService.AuthorizePortTypeClient(this.AuthorizeBinding, this.AuthorizeEndpoint))
                {
                    HeaderHttpExtension.AddCustomHeaderUserInformation(new OperationContextScope(client.InnerChannel), this.Headers);

                    string statusMessage, URL_Request, RequestKey, PublicRequestKey;

                    var statusCode = client.SendAuthorizeRequest(sar.getSecurity(),
                                                                 sar.getSession(),
                                                                 sar.getMerchant(),
                                                                 sar.getUrl_ok(),
                                                                 sar.getUrl_error(),
                                                                 sar.getEncodingMethod(),
                                                                 sar.getPayload(),
                                                                 out statusMessage,
                                                                 out URL_Request,
                                                                 out RequestKey,
                                                                 out PublicRequestKey);

                    SendAuthorizeRequestResponse response = new SendAuthorizeRequestResponse(statusCode, statusMessage, URL_Request, RequestKey, PublicRequestKey);
                    return response;
                }
            }
            catch (Exception ex)
            {
                SendAuthorizeRequestResponse response = new SendAuthorizeRequestResponse(0, ex.Message, "", "", "");
                return response;
            }
        }