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; }
//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()); }
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; } }