コード例 #1
0
        public void transfer_schemaValidation()
        {
            APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.transfer request = new APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.transfer();

            request.uniqueRequestNo = FundsTransferByCustomerService2.generateGUID();
            //request.customerID = "505";
            request.appID          = "12345";
            request.debitAccountNo = "000180100000244";
            request.beneficiary    = new APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.beneficiaryType();

            APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.beneficiaryDetailType beneficiaryDetail = new APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.beneficiaryDetailType();
            beneficiaryDetail.beneficiaryName             = new APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.nameType();
            beneficiaryDetail.beneficiaryName.Item        = "RAJIV SHUKLA";
            beneficiaryDetail.beneficiaryAddress          = new APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.AddressType();
            beneficiaryDetail.beneficiaryAddress.address1 = "NEW";
            beneficiaryDetail.beneficiaryContact          = new APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.contactType();
            beneficiaryDetail.beneficiaryAccountNo        = "109876543210";
            beneficiaryDetail.beneficiaryIFSC             = "HDFC0000239";

            request.beneficiary.Item = beneficiaryDetail;

            request.transferType              = APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.transferTypeType.NEFT;
            request.transferCurrencyCode      = APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.currencyCodeType.INR;
            request.transferAmount            = 20;
            request.remitterToBeneficiaryInfo = "FUND TRANSFER";

            String userName           = System.Environment.GetEnvironmentVariable("API_YBL_USER");
            String userPassword       = System.Environment.GetEnvironmentVariable("API_YBL_PASSWORD");
            String clientId           = System.Environment.GetEnvironmentVariable("API_YBL_CLIENT_ID");
            String clientSecret       = System.Environment.GetEnvironmentVariable("API_YBL_CLIENT_SECRET");
            String clientCert         = System.Environment.GetEnvironmentVariable("API_YBL_CLIENT_CERT");
            String clientCertPassword = System.Environment.GetEnvironmentVariable("API_YBL_CLIENT_CERT_PASSWORD");

            APIBanking.Environment env = new APIBanking.Environments.YBL.UAT(userName, userPassword,
                                                                             clientId, clientSecret, clientCert, clientCertPassword);

            try
            {
                APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.transferResponse response = FundsTransferByCustomerService2.transfer(env, request);
                Assert.IsNotNull(response);
            }
            catch (Fault e)
            {
                Assert.AreEqual(FaultCode.EC1, e.SubCode);
                Console.WriteLine(e.ToString());
            }
        }
コード例 #2
0
        public static com.quantiguous.api.FundsTransferByCustomerService2.transferResponse transfer(Environment env, APIBanking.com.quantiguous.api.FundsTransferByCustomerService2.transfer request)
        {
            request.version = VERSION;
            com.quantiguous.api.FundsTransferByCustomerService2.fundsTransferByCustomerService2Client client = createClient(env);

            try
            {
                using (new System.ServiceModel.OperationContextScope((System.ServiceModel.IClientChannel)client.InnerChannel))
                {
                    System.Net.ServicePointManager.SecurityProtocol = env.getSecurityProtocol();

                    System.ServiceModel.Web.WebOperationContext.Current.OutgoingRequest.UserAgent = "APIBanking.NET";


                    IDictionaryEnumerator headers = env.getHeaders().GetEnumerator();
                    while (headers.MoveNext())
                    {
                        System.ServiceModel.Web.WebOperationContext.Current.OutgoingRequest.Headers.Add(headers.Key.ToString(), headers.Value.ToString());
                    }

                    com.quantiguous.api.FundsTransferByCustomerService2.transferResponse response = client.transfer(request);

                    return(response);
                }
            }
            catch (MessageSecurityException e)
            {
                throw new Fault(e);
            }
            catch (FaultException e)
            {
                throw new Fault(e);
            }
            catch (Exception e)
            {
                throw new Fault(e);
            }
        }