/** * AUTO_GENERATED */ public GetAdvancedPersonalDataResponse GetAdvancedPersonalData(GetAdvancedPersonalDataRequest getAdvancedPersonalDataRequest, string apiUserName) { string response = Call("GetAdvancedPersonalData", getAdvancedPersonalDataRequest.ToNVPString(""), apiUserName); NVPUtil util = new NVPUtil(); return(GetAdvancedPersonalDataResponse.CreateInstance(util.ParseNVPString(response), "", -1)); }
/// <summary> /// Handles the specified command. /// </summary> /// <param name="command">The command.</param> public async void Handle(PayPalGetCustomerPersonalData3dPartyCommand command) { GetAdvancedPersonalDataResponse personalData = await PayPalService.GetPersonalData(command.Token, command.TokenSecret); var personalInfo = GetUserPersonalInfo(personalData.response); InfoAccumulator info = new InfoAccumulator(); SendReply(info, command, resp => resp.UserPersonalInfo = personalInfo); }
/// <summary> /// /// </summary> ///<param name="getAdvancedPersonalDataRequest"></param> ///<param name="credential">An explicit ICredential object that you want to authenticate this call against</param> public GetAdvancedPersonalDataResponse GetAdvancedPersonalData(GetAdvancedPersonalDataRequest getAdvancedPersonalDataRequest, ICredential credential) { IAPICallPreHandler apiCallPreHandler = new PlatformAPICallPreHandler(this.config, getAdvancedPersonalDataRequest.ToNVPString(string.Empty), ServiceName, "GetAdvancedPersonalData", credential); ((PlatformAPICallPreHandler)apiCallPreHandler).SDKName = SDKName; ((PlatformAPICallPreHandler)apiCallPreHandler).SDKVersion = SDKVersion; ((PlatformAPICallPreHandler)apiCallPreHandler).PortName = "Permissions"; NVPUtil util = new NVPUtil(); return(GetAdvancedPersonalDataResponse.CreateInstance(util.ParseNVPString(Call(apiCallPreHandler)), string.Empty, -1)); }
public GetAdvancedPersonalDataResponse getAdvancedPersonalData(GetAdvancedPersonalDataRequest request) { GetAdvancedPersonalDataResponse PResponse = null; PayLoad = null; try { APIProfile.EndPointAppend = Endpoint + "GetAdvancedPersonalData"; if (APIProfile.RequestDataformat == "SOAP11") { PayLoad = SoapEncoder.Encode(request); } else if (APIProfile.RequestDataformat == "XML") { PayLoad = PayPal.Platform.SDK.XMLEncoder.Encode(request); } else { PayLoad = PayPal.Platform.SDK.JSONSerializer.ToJavaScriptObjectNotation(request); } res = CallAPI(); if (APIProfile.RequestDataformat == "JSON") { object obj = JSONSerializer.JsonDecode(res.ToString(), typeof(PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)); if (obj.GetType() == typeof(PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)) { PResponse = (PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)obj; } string name = Enum.GetName(PResponse.responseEnvelope.ack.GetType(), PResponse.responseEnvelope.ack); if (name == "Failure") { this.result = "FAILURE"; TransactionException tranactionEx = new TransactionException(PayLoadFromat.JSON, res.ToString()); this.lastError = tranactionEx; } } else if (res.ToString().ToUpper().Replace("<ACK>FAILURE</ACK>", "").Length != res.ToString().Length) { this.result = "FAILURE"; if (APIProfile.RequestDataformat == "SOAP11") { TransactionException tranactionEx = new TransactionException(PayLoadFromat.SOAP11, res.ToString()); this.lastError = tranactionEx; } else if (APIProfile.RequestDataformat == "XML") { TransactionException tranactionEx = new TransactionException(PayLoadFromat.XML, res.ToString()); this.lastError = tranactionEx; } else { TransactionException tranactionEx = new TransactionException(PayLoadFromat.JSON, res.ToString()); this.lastError = tranactionEx; } } else { if (APIProfile.RequestDataformat == "SOAP11") { PResponse = (PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)SoapEncoder.Decode(res.ToString(), typeof(PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)); } else if (APIProfile.RequestDataformat == "XML") { PResponse = (PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)XMLEncoder.Decode(res.ToString(), typeof(PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)); } else { object obj = JSONSerializer.JsonDecode(res.ToString(), typeof(PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)); if (obj.GetType() == typeof(PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)) { PResponse = (PayPal.Services.Private.Permissions.GetAdvancedPersonalDataResponse)obj; } } this.result = "SUCCESS"; } } catch (FATALException) { throw; } catch (Exception ex) { throw new FATALException("Error occurred in Permissions -> GetAdvancedPersonalData method.", ex); } return(PResponse); }