public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); byte status; status = clientMessage.GetByte(); parameters.status = status; Address address = null; bool address_isNull = clientMessage.GetBoolean(); if (!address_isNull) { address = AddressCodec.Decode(clientMessage); parameters.address = address; } string uuid = null; bool uuid_isNull = clientMessage.GetBoolean(); if (!uuid_isNull) { uuid = clientMessage.GetStringUtf8(); parameters.uuid = uuid; } string ownerUuid = null; bool ownerUuid_isNull = clientMessage.GetBoolean(); if (!ownerUuid_isNull) { ownerUuid = clientMessage.GetStringUtf8(); parameters.ownerUuid = ownerUuid; } byte serializationVersion; serializationVersion = clientMessage.GetByte(); parameters.serializationVersion = serializationVersion; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); string response = null; response = clientMessage.GetStringUtf8(); parameters.response = response; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); long response; response = clientMessage.GetLong(); parameters.response = response; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); bool response ; response = clientMessage.GetBoolean(); parameters.response = response; return parameters; }
public void Process(string fullPath, SegmentOp operation, ODataModel model, string contentType = "application/atom+xml", string accept = "application/atom+xml", Stream inputStream = null) { _body = new StringBuilder(); var segments = SegmentParser.parse(fullPath, String.Empty, model); _response = new ResponseParameters(null, Encoding.UTF8, new StringWriter(_body), 200); var callbacks = new ProcessorCallbacks( (rt, item) => { _accessSingle.Add(new Tuple<ResourceType, object>(rt, item)); return true; }, (rt, items) => { _accessMany.Add(new Tuple<ResourceType, IEnumerable>(rt, items)); return true; }, (rt, item) => { _created.Add(new Tuple<ResourceType, object>(rt, item)); return true; }, (rt, item) => { _updated.Add(new Tuple<ResourceType, object>(rt, item)); return true; }, (rt, item) => { _removed.Add(new Tuple<ResourceType, object>(rt, item)); return true; } ); SegmentProcessor.Process(operation, segments, callbacks, new RequestParameters( model, model as IDataServiceMetadataProvider, new DataServiceMetadataProviderWrapper(model), contentType, Encoding.UTF8, inputStream, new Uri("http://localhost/base/"), new [] { accept } ), _response ); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); SimpleEntryView<IData, IData> dataEntryView = null; var dataEntryView_isNull = clientMessage.GetBoolean(); if (!dataEntryView_isNull) { dataEntryView = EntryViewCodec.Decode(clientMessage); parameters.dataEntryView = dataEntryView; } return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); IData response = null; var response_isNull = clientMessage.GetBoolean(); if (!response_isNull) { response = clientMessage.GetData(); parameters.response = response; } return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); ISet<IData> set = null; int set_size = clientMessage.GetInt(); set = new HashSet<IData>(); for (int set_index = 0; set_index<set_size; set_index++) { IData set_item; set_item = clientMessage.GetData(); set.Add(set_item); } parameters.set = set; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); Hazelcast.Map.SimpleEntryView <IData, IData> dataEntryView = null; bool dataEntryView_isNull = clientMessage.GetBoolean(); if (!dataEntryView_isNull) { dataEntryView = EntryViewCodec.Decode(clientMessage); parameters.dataEntryView = dataEntryView; } return(parameters); }
internal static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var responseSize = clientMessage.GetInt(); var response = new List <IData>(responseSize); for (var responseIndex = 0; responseIndex < responseSize; responseIndex++) { var responseItem = clientMessage.GetData(); response.Add(responseItem); } parameters.response = response; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); ISet<KeyValuePair<IData,IData>> entrySet = null; int entrySet_size = clientMessage.GetInt(); entrySet = new HashSet<KeyValuePair<IData,IData>>(); for (int entrySet_index = 0; entrySet_index<entrySet_size; entrySet_index++) { KeyValuePair<IData,IData> entrySet_item; entrySet_item = clientMessage.GetMapEntry(); entrySet.Add(entrySet_item); } parameters.entrySet = entrySet; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); IList<IData> list = null; int list_size = clientMessage.GetInt(); list = new List<IData>(); for (int list_index = 0; list_index<list_size; list_index++) { IData list_item; list_item = clientMessage.GetData(); list.Add(list_item); } parameters.list = list; return parameters; }
internal static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var responseSize = clientMessage.GetInt(); var response = new List <DistributedObjectInfo>(responseSize); for (var responseIndex = 0; responseIndex < responseSize; responseIndex++) { var responseItem = DistributedObjectInfoCodec.Decode(clientMessage); response.Add(responseItem); } parameters.response = response; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); IList<IData> list = null; int list_size = clientMessage.GetInt(); list = new List<IData>(); for (int list_index = 0; list_index<list_size; list_index++) { IData list_item; list_item = clientMessage.GetData(); list.Add(list_item); } parameters.list = list; return parameters; }
internal static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var status = clientMessage.GetByte(); parameters.status = (AuthenticationStatus)status; var addressIsNull = clientMessage.GetBoolean(); if (!addressIsNull) { var address = AddressCodec.Decode(clientMessage); parameters.address = address; } var uuidIsNull = clientMessage.GetBoolean(); if (!uuidIsNull) { var uuid = clientMessage.GetStringUtf8(); parameters.uuid = uuid; } var ownerUuidIsNull = clientMessage.GetBoolean(); if (!ownerUuidIsNull) { var ownerUuid = clientMessage.GetStringUtf8(); parameters.ownerUuid = ownerUuid; } var serializationVersion = clientMessage.GetByte(); parameters.serializationVersion = serializationVersion; if (clientMessage.IsComplete()) { return parameters; } var serverHazelcastVersion = clientMessage.GetStringUtf8(); parameters.serverHazelcastVersion = serverHazelcastVersion; parameters.serverHazelcastVersionExist = true; var clientUnregisteredMembersIsNull = clientMessage.GetBoolean(); if (!clientUnregisteredMembersIsNull) { var clientUnregisteredMembersSize = clientMessage.GetInt(); var clientUnregisteredMembers = new List<IMember>(clientUnregisteredMembersSize); for (var clientUnregisteredMembersIndex = 0; clientUnregisteredMembersIndex < clientUnregisteredMembersSize; clientUnregisteredMembersIndex++) { var clientUnregisteredMembersItem = MemberCodec.Decode(clientMessage); clientUnregisteredMembers.Add(clientUnregisteredMembersItem); } parameters.clientUnregisteredMembers = clientUnregisteredMembers; } parameters.clientUnregisteredMembersExist = true; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); IList<DistributedObjectInfo> infoCollection = null; var infoCollection_size = clientMessage.GetInt(); infoCollection = new List<DistributedObjectInfo>(); for (var infoCollection_index = 0; infoCollection_index < infoCollection_size; infoCollection_index++) { DistributedObjectInfo infoCollection_item; infoCollection_item = DistributedObjectInfoCodec.Decode(clientMessage); infoCollection.Add(infoCollection_item); } parameters.infoCollection = infoCollection; return parameters; }
public static async Task RunPingPongAsync(TestService.ITestServiceClient client) { Console.WriteLine("running ping_pong"); using (var call = client.FullDuplexCall()) { await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() .SetResponseType(PayloadType.COMPRESSABLE) .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(31415)) .SetPayload(CreateZerosPayload(27182)).Build()); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(31415, call.ResponseStream.Current.Payload.Body.Length); await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() .SetResponseType(PayloadType.COMPRESSABLE) .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(9)) .SetPayload(CreateZerosPayload(8)).Build()); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(9, call.ResponseStream.Current.Payload.Body.Length); await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() .SetResponseType(PayloadType.COMPRESSABLE) .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(2653)) .SetPayload(CreateZerosPayload(1828)).Build()); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(2653, call.ResponseStream.Current.Payload.Body.Length); await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() .SetResponseType(PayloadType.COMPRESSABLE) .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(58979)) .SetPayload(CreateZerosPayload(45904)).Build()); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(58979, call.ResponseStream.Current.Payload.Body.Length); await call.RequestStream.CompleteAsync(); Assert.IsFalse(await call.ResponseStream.MoveNext()); } Console.WriteLine("Passed!"); }
public static ResponseParameters DecodeResponse(ClientMessage clientMessage) { using var iterator = clientMessage.GetEnumerator(); var response = new ResponseParameters(); var initialFrame = iterator.Take(); response.Status = initialFrame.Bytes.ReadByteL(ResponseStatusFieldOffset); response.MemberUuid = initialFrame.Bytes.ReadGuidL(ResponseMemberUuidFieldOffset); response.SerializationVersion = initialFrame.Bytes.ReadByteL(ResponseSerializationVersionFieldOffset); response.PartitionCount = initialFrame.Bytes.ReadIntL(ResponsePartitionCountFieldOffset); response.ClusterId = initialFrame.Bytes.ReadGuidL(ResponseClusterIdFieldOffset); response.FailoverSupported = initialFrame.Bytes.ReadBoolL(ResponseFailoverSupportedFieldOffset); response.Address = CodecUtil.DecodeNullable(iterator, AddressCodec.Decode); response.ServerHazelcastVersion = StringCodec.Decode(iterator); return(response); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); IList <DistributedObjectInfo> infoCollection = null; var infoCollection_size = clientMessage.GetInt(); infoCollection = new List <DistributedObjectInfo>(); for (var infoCollection_index = 0; infoCollection_index < infoCollection_size; infoCollection_index++) { DistributedObjectInfo infoCollection_item; infoCollection_item = DistributedObjectInfoCodec.Decode(clientMessage); infoCollection.Add(infoCollection_item); } parameters.infoCollection = infoCollection; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); ISet <IData> set = null; int set_size = clientMessage.GetInt(); set = new HashSet <IData>(); for (int set_index = 0; set_index < set_size; set_index++) { IData set_item; set_item = clientMessage.GetData(); set.Add(set_item); } parameters.set = set; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); IList <KeyValuePair <IData, IData> > entrySet = null; int entrySet_size = clientMessage.GetInt(); entrySet = new List <KeyValuePair <IData, IData> >(); for (int entrySet_index = 0; entrySet_index < entrySet_size; entrySet_index++) { KeyValuePair <IData, IData> entrySet_item; entrySet_item = clientMessage.GetMapEntry(); entrySet.Add(entrySet_item); } parameters.entrySet = entrySet; return(parameters); }
public static ResponseParameters DecodeResponse(ClientMessage clientMessage) { var iterator = clientMessage.GetIterator(); var response = new ResponseParameters(); var initialFrame = iterator.Next(); response.Status = DecodeByte(initialFrame.Content, ResponseStatusFieldOffset); response.MemberUuid = DecodeGuid(initialFrame.Content, ResponseMemberUuidFieldOffset); response.SerializationVersion = DecodeByte(initialFrame.Content, ResponseSerializationVersionFieldOffset); response.PartitionCount = DecodeInt(initialFrame.Content, ResponsePartitionCountFieldOffset); response.ClusterId = DecodeGuid(initialFrame.Content, ResponseClusterIdFieldOffset); response.FailoverSupported = DecodeBool(initialFrame.Content, ResponseFailoverSupportedFieldOffset); response.Address = CodecUtil.DecodeNullable(iterator, AddressCodec.Decode); response.ServerHazelcastVersion = StringCodec.Decode(iterator); return(response); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var response = new List <KeyValuePair <IData, IData> >(); var responseSize = clientMessage.GetInt(); for (var responseIndex = 0; responseIndex < responseSize; responseIndex++) { var responseItemKey = clientMessage.GetData(); var responseItemVal = clientMessage.GetData(); var responseItem = new KeyValuePair <IData, IData>(responseItemKey, responseItemVal); response.Add(responseItem); } parameters.response = response; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); int readCount ; readCount = clientMessage.GetInt(); parameters.readCount = readCount; IList<IData> items = null; int items_size = clientMessage.GetInt(); items = new List<IData>(); for (int items_index = 0; items_index<items_size; items_index++) { IData items_item; items_item = clientMessage.GetData(); items.Add(items_item); } parameters.items = items; return parameters; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var readCount = clientMessage.GetInt(); parameters.readCount = readCount; var items = new List <IData>(); var itemsSize = clientMessage.GetInt(); for (var itemsIndex = 0; itemsIndex < itemsSize; itemsIndex++) { var itemsItem = clientMessage.GetData(); items.Add(itemsItem); } parameters.items = items; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); if (clientMessage.IsComplete()) { return(parameters); } var responseIsNull = clientMessage.GetBoolean(); if (!responseIsNull) { var response = clientMessage.GetData(); parameters.response = response; } return(parameters); }
public async Task <ActionResult> ProviderCallback(FormCollection form) { PaymentProviderConfiguration providerConfig = new PaymentProviderConfiguration() { AccountIdentifer = this._capitaMerchantid, SharedSecret = this._capitaSecretKey, SubAccountNumber = this._capitaScpid }; string scpReference = string.Empty; if (this.Session["ProviderReference"] != null) { scpReference = (string)this.Session["ProviderReference"]; } if (form != null && form[this._paymentProvider.RoundTripTokenKey] == null && this.Request.QueryString["RequestId"] != null) { form[this._paymentProvider.RoundTripTokenKey] = this.Request.QueryString["RequestId"]; } var responseParameters = new ResponseParameters() { NextUrl = "", SuccessImageUrl = "http://www.myplayservice.co.uk/App_Themes/images/Allow.gif", FailureImageUrl = "http://www.myplayservice.co.uk/App_Themes/images/deny.png", ProviderReference = scpReference }; var response = await _paymentProvider.ProcessResponse(providerConfig, form, responseParameters); if (response.ServerReply != null) { return(response.ServerReply); } if (response.AuthorizationResult == PaymentAuthorizationResult.Authorized) { return(Content("Booking confirmed. A confirmation email will be sent shortly")); } else { return(Content("Unsuccessful Payment." + response.Description)); } }
public async Task <PaymentAuthorizationGuiResponse> ProcessResponse( PaymentProviderConfiguration configuration, NameValueCollection paramsCollection, ResponseParameters additionalParameters) { string paramsDesc = PaymentFrameworkUtility.DescribeNameValueCollection(paramsCollection); Logger.CreateEntry(typeof(CivicaPaymentProvider), LogLevel.Debug, $"ProcessResponse({paramsDesc})"); string responseCode = paramsCollection["ResponseCode"] ?? "-1"; int responseCodeParsed = -1; bool didParse = Int32.TryParse(responseCode, out responseCodeParsed); if (didParse && (0 == responseCodeParsed)) { string roundTripTransactionReference = paramsCollection["CallingApplicationTransactionReference"]; if (String.IsNullOrEmpty(roundTripTransactionReference)) { throw new InvalidOperationException(String.Format("response did not include required field '{0}'", "CallingApplicationTransactionReference")); } Guid pendingPaymentRef = new Guid(roundTripTransactionReference); var backendResponse = await CheckAuthorizationInternal(configuration, pendingPaymentRef.ToString()); backendResponse.ResponseCode = responseCode; backendResponse.TransactionId = roundTripTransactionReference; return(new PaymentAuthorizationGuiResponse(backendResponse, null)); } else { var backendResponse = new PaymentAuthorizationResponse(false, PaymentAuthorizationResult.Declined, !string.IsNullOrEmpty(paramsCollection["PaymentAmount"]) ? decimal.Parse(paramsCollection["PaymentAmount"]) : 0.00m, paramsCollection["ResponseDescription"], paramsCollection["IncomeManagementReceiptNumber"]) { ResponseCode = responseCode, TransactionId = paramsCollection["CallingApplicationTransactionReference"] }; return(new PaymentAuthorizationGuiResponse(backendResponse, null)); } }
internal static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var namePartitionSequenceListSize = clientMessage.GetInt(); var namePartitionSequenceList = new List <KeyValuePair <string, IList <KeyValuePair <int, long> > > >(namePartitionSequenceListSize); for (var namePartitionSequenceListIndex = 0; namePartitionSequenceListIndex < namePartitionSequenceListSize; namePartitionSequenceListIndex++) { var namePartitionSequenceListItemKey = clientMessage.GetStringUtf8(); var namePartitionSequenceListItemValSize = clientMessage.GetInt(); var namePartitionSequenceListItemVal = new List <KeyValuePair <int, long> >(namePartitionSequenceListItemValSize); for (var namePartitionSequenceListItemValIndex = 0; namePartitionSequenceListItemValIndex < namePartitionSequenceListItemValSize; namePartitionSequenceListItemValIndex++) { var namePartitionSequenceListItemValItemKey = clientMessage.GetInt(); var namePartitionSequenceListItemValItemVal = clientMessage.GetLong(); var namePartitionSequenceListItemValItem = new KeyValuePair <int, long>(namePartitionSequenceListItemValItemKey, namePartitionSequenceListItemValItemVal); namePartitionSequenceListItemVal.Add(namePartitionSequenceListItemValItem); } var namePartitionSequenceListItem = new KeyValuePair <string, IList <KeyValuePair <int, long> > >(namePartitionSequenceListItemKey, namePartitionSequenceListItemVal); namePartitionSequenceList.Add(namePartitionSequenceListItem); } parameters.namePartitionSequenceList = namePartitionSequenceList; var partitionUuidListSize = clientMessage.GetInt(); var partitionUuidList = new List <KeyValuePair <int, Guid> >(partitionUuidListSize); for (var partitionUuidListIndex = 0; partitionUuidListIndex < partitionUuidListSize; partitionUuidListIndex++) { var partitionUuidListItemKey = clientMessage.GetInt(); var partitionUuidListItemVal = GuidCodec.Decode(clientMessage); var partitionUuidListItem = new KeyValuePair <int, Guid>(partitionUuidListItemKey, partitionUuidListItemVal); partitionUuidList.Add(partitionUuidListItem); } parameters.partitionUuidList = partitionUuidList; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); IList<KeyValuePair<IData, IData>> response = null; int response_size = clientMessage.GetInt(); response = new List<KeyValuePair<IData, IData>>(); for (int response_index = 0; response_index < response_size; response_index++) { KeyValuePair<IData, IData> response_item; IData response_item_key; IData response_item_val; response_item_key = clientMessage.GetData(); response_item_val = clientMessage.GetData(); response_item = new KeyValuePair<IData, IData>(response_item_key, response_item_val); response.Add(response_item); } parameters.response = response; return parameters; }
internal static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var readCount = clientMessage.GetInt(); parameters.readCount = readCount; var itemsSize = clientMessage.GetInt(); var items = new List <IData>(itemsSize); for (var itemsIndex = 0; itemsIndex < itemsSize; itemsIndex++) { var itemsItem = clientMessage.GetData(); items.Add(itemsItem); } parameters.items = items; if (clientMessage.IsComplete()) { return(parameters); } var itemSeqsIsNull = clientMessage.GetBoolean(); if (!itemSeqsIsNull) { var itemSeqsSize = clientMessage.GetInt(); var itemSeqs = new long[itemSeqsSize]; for (var itemSeqsIndex = 0; itemSeqsIndex < itemSeqsSize; itemSeqsIndex++) { var itemSeqsItem = clientMessage.GetLong(); itemSeqs[itemSeqsIndex] = itemSeqsItem; } parameters.itemSeqs = itemSeqs; } parameters.itemSeqsExist = true; if (clientMessage.IsComplete()) { return(parameters); } var nextSeq = clientMessage.GetLong(); parameters.nextSeq = nextSeq; parameters.nextSeqExist = true; return(parameters); }
/// <summary> /// Method that is triggered when money are been inserted in the CashMachine (a AmountUpdateResponse is received from the Cash Machine via pipes). /// </summary> public void ProgressMessageResponse(object parameters) { try { ResponseParameters responseParameters = JsonConvert.DeserializeObject <ResponseParameters>(parameters.ToString()); logger.Info(PAYMENT_LOG, $" Progress message: {responseParameters.PayProgress.Message}"); PayProgress payProgress = responseParameters.PayProgress; if (PaymentCallbacks != null) { PaymentCallbacks.PayProgressChangedCallback(payProgress); } } catch (Exception ex) { logger.Error(PAYMENT_LOG, string.Format("Failed to send Progress Message Response. \r\n{0}", ex.ToString())); } }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); int readCount; readCount = clientMessage.GetInt(); parameters.readCount = readCount; IList <IData> items = null; int items_size = clientMessage.GetInt(); items = new List <IData>(); for (int items_index = 0; items_index < items_size; items_index++) { IData items_item; items_item = clientMessage.GetData(); items.Add(items_item); } parameters.items = items; return(parameters); }
public async Task <ActionResult> ProviderCallback(FormCollection form) { PaymentProviderConfiguration providerConfig = new PaymentProviderConfiguration() { AccountIdentifer = _realExMerchantid, SharedSecret = _realExSecretKey }; var responseParameters = new ResponseParameters() { NextUrl = "", SuccessImageUrl = "http://www.myplayservice.co.uk/App_Themes/images/Allow.gif", FailureImageUrl = "http://www.myplayservice.co.uk/App_Themes/images/deny.png", Reference = "REFXXXX" }; var response = await _paymentProvider.ProcessResponse(providerConfig, form, responseParameters); return(response.ServerReply); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); IList <KeyValuePair <IData, IData> > response = null; int response_size = clientMessage.GetInt(); response = new List <KeyValuePair <IData, IData> >(); for (int response_index = 0; response_index < response_size; response_index++) { KeyValuePair <IData, IData> response_item; IData response_item_key; IData response_item_val; response_item_key = clientMessage.GetData(); response_item_val = clientMessage.GetData(); response_item = new KeyValuePair <IData, IData>(response_item_key, response_item_val); response.Add(response_item); } parameters.response = response; return(parameters); }
internal static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var value = clientMessage.GetLong(); parameters.value = value; var replicaTimestampsSize = clientMessage.GetInt(); var replicaTimestamps = new List <KeyValuePair <string, long> >(replicaTimestampsSize); for (var replicaTimestampsIndex = 0; replicaTimestampsIndex < replicaTimestampsSize; replicaTimestampsIndex++) { var replicaTimestampsItemKey = clientMessage.GetStringUtf8(); var replicaTimestampsItemVal = clientMessage.GetLong(); var replicaTimestampsItem = new KeyValuePair <string, long>(replicaTimestampsItemKey, replicaTimestampsItemVal); replicaTimestamps.Add(replicaTimestampsItem); } parameters.replicaTimestamps = replicaTimestamps; var replicaCount = clientMessage.GetInt(); parameters.replicaCount = replicaCount; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); byte status; status = clientMessage.GetByte(); parameters.status = status; Address address = null; var address_isNull = clientMessage.GetBoolean(); if (!address_isNull) { address = AddressCodec.Decode(clientMessage); parameters.address = address; } string uuid = null; var uuid_isNull = clientMessage.GetBoolean(); if (!uuid_isNull) { uuid = clientMessage.GetStringUtf8(); parameters.uuid = uuid; } string ownerUuid = null; var ownerUuid_isNull = clientMessage.GetBoolean(); if (!ownerUuid_isNull) { ownerUuid = clientMessage.GetStringUtf8(); parameters.ownerUuid = ownerUuid; } byte serializationVersion; serializationVersion = clientMessage.GetByte(); parameters.serializationVersion = serializationVersion; return(parameters); }
public void TestResponse(object parameters) { try { ResponseParameters responseParameters = JsonConvert.DeserializeObject <ResponseParameters>(parameters.ToString()); //Check the status property of the parameters object to see if the Test was successful if (responseParameters.Status == 0) { WasTestSuccessful = true; } else { WasTestSuccessful = false; } //Notify the Init method that the message has stopped IsTestFinished = true; } catch (Exception ex) { logger.Error(PAYMENT_LOG, string.Format("Failed to validate the TestResponse. \r\n{0}", ex.ToString())); } }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); IDictionary<Address, IList<int>> partitions = null; var partitions_size = clientMessage.GetInt(); partitions = new Dictionary<Address, IList<int>>(partitions_size); for (var partitions_index = 0; partitions_index < partitions_size; partitions_index++) { Address partitions_key; IList<int> partitions_val; partitions_key = AddressCodec.Decode(clientMessage); var partitions_val_size = clientMessage.GetInt(); partitions_val = new List<int>(); for (var partitions_val_index = 0; partitions_val_index < partitions_val_size; partitions_val_index++) { int partitions_val_item; partitions_val_item = clientMessage.GetInt(); partitions_val.Add(partitions_val_item); } partitions.Add(partitions_key, partitions_val); } parameters.partitions = partitions; return parameters; }
public static async Task RunCancelAfterFirstResponseAsync(TestService.ITestServiceClient client) { Console.WriteLine("running cancel_after_first_response"); var cts = new CancellationTokenSource(); using (var call = client.FullDuplexCall(cancellationToken: cts.Token)) { await call.RequestStream.WriteAsync(StreamingOutputCallRequest.CreateBuilder() .SetResponseType(PayloadType.COMPRESSABLE) .AddResponseParameters(ResponseParameters.CreateBuilder().SetSize(31415)) .SetPayload(CreateZerosPayload(27182)).Build()); Assert.IsTrue(await call.ResponseStream.MoveNext()); Assert.AreEqual(PayloadType.COMPRESSABLE, call.ResponseStream.Current.Payload.Type); Assert.AreEqual(31415, call.ResponseStream.Current.Payload.Body.Length); cts.Cancel(); var ex = Assert.Throws <RpcException>(async() => await call.ResponseStream.MoveNext()); Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode); } Console.WriteLine("Passed!"); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); var partitions = new List <KeyValuePair <Address, IList <int> > >(); var partitionsSize = clientMessage.GetInt(); for (var partitionsIndex = 0; partitionsIndex < partitionsSize; partitionsIndex++) { var partitionsItemKey = AddressCodec.Decode(clientMessage); var partitionsItemVal = new List <int>(); var partitionsItemValSize = clientMessage.GetInt(); for (var partitionsItemValIndex = 0; partitionsItemValIndex < partitionsItemValSize; partitionsItemValIndex++) { var partitionsItemValItem = clientMessage.GetInt(); partitionsItemVal.Add(partitionsItemValItem); } var partitionsItem = new KeyValuePair <Address, IList <int> >(partitionsItemKey, partitionsItemVal); partitions.Add(partitionsItem); } parameters.partitions = partitions; return(parameters); }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { ResponseParameters parameters = new ResponseParameters(); return parameters; }
/// <summary> /// Initializes a new instance of the <see cref="ApiRequestException"/> class /// </summary> /// <param name="message">The message</param> /// <param name="errorCode">The error code</param> /// <param name="parameters">Response parameters</param> /// <param name="innerException">The inner exception</param> public ApiRequestException(string message, int errorCode, ResponseParameters parameters, Exception innerException) : base(message, innerException) { ErrorCode = errorCode; Parameters = parameters; }
public ApiException(HttpStatusCode statusCode, string description, ResponseParameters apiResponseParameters, ErrorCode?errorCode) : base(statusCode) { Description = description; ApiResponseParameters = apiResponseParameters; ErrorCode = errorCode; }
public static ResponseParameters DecodeResponse(IClientMessage clientMessage) { var parameters = new ResponseParameters(); return(parameters); }