[英]IntuIt QuickBooks payments API, How can I perform credit card transactions using servicecontext of IppDotNetSdkForQuickBooksApiV3 package?
I have added IPP .Net SDK for QuickBooks V3.0 reference to my project using NuGet package (IppDotNetSdkForQuickBooksApiV3 ). 我已经使用NuGet软件包(IppDotNetSdkForQuickBooksApiV3)在项目中添加了针对QuickBooks V3.0的IPP .Net SDK。
I am able to perform CRUD operation on customer account data. 我可以对客户帐户数据执行CRUD操作。 How can I perform credit card transactions using servicecontext?
如何使用servicecontext执行信用卡交易?
Here is my sample code, 这是我的示例代码,
string consumerKey = "qyprd4rAYMSe4EhBLcGvKrZ8Xb8M3i";
string consumerKeySecret = "xdYvcPHkjICQ2uJ3yNzFJpI8elHJsnQa127EKrMf";
string accessToken = "lvprdyTiT1kxH8VhFhzEv3BpiC4cV5fYC3tPKtijE9hdqWk9";
string accessTokenSecret = "HTkdQ4WYtItio3NXo569py1SqPZ4jDnxfE1FUPZA";
string Realm = "1440846810";
OAuthRequestValidator oauthValidator = new OAuthRequestValidator(
accessToken, accessTokenSecret, consumerKey, consumerKeySecret);
string appToken = "9f4179e9ba7d4b4343b8986b9935526c724a";
string companyID = "1440846810";
ServiceContext context = new ServiceContext(appToken, companyID, IntuitServicesType.QBO, oauthValidator);
context.IppConfiguration.BaseUrl.Qbo = "https://sandbox-quickbooks.api.intuit.com/";
DataService service = new DataService(context);
ChargeCredit charge = new ChargeCredit() { };
Customer customer = new Customer();
//Mandatory Fields
customer.GivenName = "Sridhar";
customer.Title = "Mr.";
customer.MiddleName = "Sri";
customer.FamilyName = "Goshika";
// Optional Fields
customer.PrimaryEmailAddr = new EmailAddress() { Address = "sridharnetha@gmail.com" };
Customer resultCustomer = service.Add(customer) as Customer;
return service;
Can u send me sample code for add Customer credit details to quickbooks 您可否寄给我样本代码,以将客户信用详细信息添加到速记本中
public static void test()
{
string accessToken = "12432543252345";
string accessTokenSecret = "5b1cb122b340db43d4bae6bb880c8a284499";
string consumerKey = "qyprdWTsI8u6Qq3fwiIUvkweM2mabZ";
string consumerSecret = "9KH9mFlGy5CPSUQCOV2lM3lHGs05AK5TtdS0QLWv";
OAuthRequestValidator oauthValidator = new OAuthRequestValidator(
accessToken, accessTokenSecret, consumerKey, consumerSecret);
string appToken = "5b1cb122b340db43d4bae6bb880c8a28449";
string companyID = "32534654";
ServiceContext context = new ServiceContext(appToken, companyID, IntuitServicesType.QBO, oauthValidator);
DataService service = new DataService(context);
Customer customer = new Customer
{
GivenName = "Mary",
Title = "Ms.",
MiddleName = "Jayne",
FamilyName = "Cooper",
Id = "1234214"
};
//Mandatory Fields
customer.CCDetail.Number = "444747447474474";
customer.CCDetail.CcExpiryMonth = 12;
customer.CCDetail.CcExpiryYear = 2018;
Customer resultCustomer = service.Add(customer) as Customer;
}
Can you verify this above code. 您可以验证以上代码吗? mail id adarsh.p@nxtlive.com
邮件ID adarsh.p@nxtlive.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.