0

I'm trying to integrate my code with 2checkout payment SDK available here: https://github.com/2Checkout/2checkout-dotnet

This below code throws the following error:

System.ArgumentNullException : Value cannot be null. Parameter name: s

[Test]
public void _004_TestSaleStop()
{

    TwoCheckoutConfig.ApiUsername = "username";
    TwoCheckoutConfig.ApiPassword = "password";
    TwoCheckoutConfig.Sandbox = true;


    try
    {

        var ServiceObject = new SaleService();
        var ArgsObject = new SaleStopServiceOptions();
        ArgsObject.sale_id = 9093729066354;
        var result = ServiceObject.Stop(ArgsObject);
        Assert.IsInstanceOf<TwoCheckoutResponse>(result);
    }
    catch (TwoCheckoutException e)
    {
        Assert.IsInstanceOf<TwoCheckoutException>(e);
    }
}

The error is internal to their code, so it's hard to know why this is thrown.

I've seen some articles suggest that the ASP.NET process does not have write permission. So I right-clicked the solution and added "IIS_IUSRS" with all perms. This doesn't help either.

Any help would be greatly appreciated.

hendryanw
  • 1,819
  • 5
  • 24
  • 39
Josh
  • 189
  • 1
  • 12
  • where is the exception thrown exactly? I guess at the var result = line... Maybe you missing to set a/all neccesary Properties of ArgsObject ? or it's simply out of range? – Mat Apr 15 '16 at 07:07
  • 1
    Please show the full stack trace. – Jon Skeet Apr 15 '16 at 07:08
  • Probably missing something, but their support team will just not provide the information. The exception occurs on this line: var result = ServiceObject.Stop(ArgsObject); trace: at System.IO.StringReader..ctor(String s) at Newtonsoft.Json.Linq.JObject.Parse(String json) at TwoCheckout.TwoCheckoutUtil.Active(String response) at TwoCheckout.SaleService.Stop(SaleStopServiceOptions options) at Twocheckout.Tests.TestSale._004_TestSaleStop() in TestSale.cs: line 80 – Josh Apr 16 '16 at 15:53
  • Hey Jon/Mat any ideas how to go about this? – Josh Apr 25 '16 at 15:13

1 Answers1

0

i also got the same error.

then i created new project and everything working fine now.

Ramesh
  • 11
  • 2