public async Task <dynamic> AddNewPaymentDetails(string id, PaymentMethodProfile payMethod) { Response response = new Response(); SecurityToken token = await GetSecurityToken(); var client = new PaymentGateway.IeBizServiceClient(); response.PaymentMethodProfileResponse = await client.AddCustomerPaymentMethodProfileAsync(token, id, payMethod); return(response.PaymentMethodProfileResponse); }
public async Task <IActionResult> Index() { //Live var client = new PaymentGateway.IeBizServiceClient(); SecurityToken securityToken = new SecurityToken(); //CreditCardData customer = new CreditCardData(); //securityToken.UserId = "virtualterm"; //securityToken.SecurityId = "8U5NF2nZQAm3G3Gw57oB8g7BObK7bzKP"; //securityToken.Password = "******"; securityToken.SecurityId = "99359f03-b254-4adf-b446-24957fcb46cb"; securityToken.UserId = "qbouser"; securityToken.Password = "******"; SearchFilter[] searchFilters = new SearchFilter[0]; dynamic dsd = await client.SearchInvoicesAsync(securityToken, "", "", "", "", searchFilters, 0, 200, "", false); PaymentMethodProfile payMethod = new PaymentMethodProfile(); payMethod.CardExpiration = "0922"; payMethod.CardNumber = "4000100011112224"; payMethod.AvsStreet = "123 Main st."; payMethod.AvsZip = "90046"; payMethod.MethodName = "My Visa"; TransactionRequestObject transaction = new TransactionRequestObject(); transaction.CreditCardData.CardNumber = "4000100011112224"; transaction.CreditCardData.CardExpiration = "0922"; transaction.CreditCardData.AvsStreet = "123 Main st."; transaction.CreditCardData.AvsZip = "90046"; transaction.CustomerID = ""; transaction.BillingAddress = new GwAddress { FirstName = "naqi", LastName = "ali" }; transaction.Command = "AuthOnly"; transaction.CustReceipt = true; transaction.CustReceiptName = ""; transaction.AuthCode = ""; var dd = await client.runTransactionAsync(securityToken, transaction); CustomerTransactionRequest customerTransaction = new CustomerTransactionRequest(); var ss = await client.runCustomerTransactionAsync(securityToken, "C-ABC530", "1186", customerTransaction); //PaymentMethodProfile payMethod = new PaymentMethodProfile(); //payMethod.CardExpiration = "1212"; //payMethod.CardNumber = "4000100011112224"; //payMethod.AvsStreet = "123 Main st."; //payMethod.AvsZip = "90046"; //payMethod.MethodName = "My Visa"; // dynamic data = await client.GetCustomerAsync(securityToken, "C-ABC527", "7c944faf-a409-460d-a55d-1a2220c455cd"); //if (data!=null) //{ //} //else //{ //Customer customer = new Customer(); // customer.CompanyName = "Naqi101"; // customer.FirstName = "Naqi"; // customer.LastName = "Ali"; // customer.Email = "*****@*****.**"; // customer.SoftwareId = ".Net API"; // customer.CustomerId = "C-ABC530"; // Address address = new Address(); // address.FirstName = "Naqi"; // address.LastName = "Testing"; // address.CompanyName = "Naqi101"; // address.Address1 = "123 main st."; // address.City = "Hollywood"; // address.State = "ca"; // address.ZipCode = "91607"; // address.Country = "USA"; // customer.BillingAddress = address; // PaymentMethodProfile[] payMethod = new PaymentMethodProfile[1]; // payMethod[0] = new PaymentMethodProfile(); // //payMethod[0].MethodType = "1212"; // payMethod[0].CardNumber = "4000100011112224"; // payMethod[0].CardExpiration = "0922"; // payMethod[0].AccountHolderName = "Ali"; // payMethod[0].AvsStreet = "abc"; // payMethod[0].CardCode = "123"; // payMethod[0].AvsZip = "54000"; // payMethod[0].MethodName = "My Visa"; // customer.PaymentMethodProfiles = payMethod; //} try { var sdt = await client.AddCustomerPaymentMethodProfileAsync(securityToken, "4b9fab71-9b3c-4d77-bff3-fc6c4cf54ec0", payMethod); //dynamic response = await client.AddCustomerAsync(securityToken, customer); //dynamic response = await client.UpdateCustomerAsync(securityToken, customer, "C-ABC527", "7c944faf-a409-460d-a55d-1a2220c455cd"); //MessageBox.Show(string.Concat(response)); } catch (Exception err) { //MessageBox.Show(err.Message); } return(View()); }