简体   繁体   中英

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 ).

I am able to perform CRUD operation on customer account data. How can I perform credit card transactions using 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM