Litle.Sdk.batchRequest.addAccountUpdate C# (CSharp) Method

addAccountUpdate() public method

public addAccountUpdate ( accountUpdate accountUpdate ) : void
accountUpdate accountUpdate
return void
        public void addAccountUpdate(accountUpdate accountUpdate)
        {
            if (isOnlyAccountUpdates())
            {
                numAccountUpdates++;
                fillInReportGroup(accountUpdate);
                tempBatchFilePath = saveElement(litleFile, litleTime, tempBatchFilePath, accountUpdate);
            }
            else
            {
                throw new LitleOnlineException(accountUpdateErrorMessage);
            }
        }

Usage Example

コード例 #1
0
        public void accountUpdateBatch()
        {
            batchRequest litleBatchRequest = new batchRequest();

            accountUpdate accountUpdate1 = new accountUpdate();
            accountUpdate1.orderId = "1111";
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "414100000000000000";
            card.expDate = "1210";
            accountUpdate1.card = card;

            litleBatchRequest.addAccountUpdate(accountUpdate1);

            accountUpdate accountUpdate2 = new accountUpdate();
            accountUpdate2.orderId = "1112";
            accountUpdate2.card = card;

            litleBatchRequest.addAccountUpdate(accountUpdate2);

            litle.addBatch(litleBatchRequest);
            string batchName = litle.sendToLitle();

            litle.blockAndWaitForResponse(batchName, estimatedResponseTime(0, 1 * 2));

            litleResponse litleResponse = litle.receiveFromLitle(batchName);

            Assert.NotNull(litleResponse);
            Assert.AreEqual("0", litleResponse.response);
            Assert.AreEqual("Valid Format", litleResponse.message);

            batchResponse litleBatchResponse = litleResponse.nextBatchResponse();
            while (litleBatchResponse != null)
            {
                accountUpdateResponse accountUpdateResponse = litleBatchResponse.nextAccountUpdateResponse();
                while (accountUpdateResponse != null)
                {
                    Assert.AreEqual("301", accountUpdateResponse.response);

                    accountUpdateResponse = litleBatchResponse.nextAccountUpdateResponse();
                }
                litleBatchResponse = litleResponse.nextBatchResponse();
            }
        }
All Usage Examples Of Litle.Sdk.batchRequest::addAccountUpdate
batchRequest