Giter Club home page Giter Club logo

chargebee-dotnet's People

Contributors

cb-alish avatar cb-ashik avatar cb-bharathvaj avatar cb-gaurav avatar cb-goutham avatar cb-karthikp avatar cb-khushbubibay avatar cb-navaneedhan avatar cb-nithins avatar cb-prajaktachavan avatar cb-sriramthiagarajan avatar cb-thiyagu avatar cb-thushitamariaselvan avatar cb-yateshmathuria avatar chargebee-qa avatar crelatewwong avatar hellokps avatar rraman avatar sangeethabaskaran avatar saravana-cb avatar vaibhav1510 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chargebee-dotnet's Issues

Nuspec empty

Installing the package into a .Net 4.0 Class Library does not add the required Chargebee reference. In fact, no additional files are downloaded with the package.

PM> install-package chargebee
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.11)'.
Successfully installed 'ChargeBee 1.0.4'.
Successfully added 'ChargeBee 1.0.4' to Fbg.Modules.

I dug into the issue a little more and found that the .Nuget\Packages\ChargeBee.1.0.4\ folder only has the .nuspec and .nupkg files. Using the NuGet Package Explorer tool seems to confirm that there are no contents assigned for the package.

Windows8, Visual Studio 2012, Package Manager Console Host Version 2.2.40116.9051

I'm upgrading to the latest version of NuGet, I'll update my post after I try again.

Edit: Same issue after upgrading to NuGet 2.5.40416.9020

Edit2: The problem appears to be with the Nupkg file generation you're doing before uploading. Just for my own curiosity, I was able to get it to generate the .nupkg correctly on my machine by doing the follow. You'll probably have to do something similar next time around:

Download source, extract, go to command prompt then do:

cd f:\chargebee-dotnet\Chargebee
...nuget\nuget.exe pack -build -verbosity detailed

Results with:
Attempting to build package from 'ChargeBee.csproj'.
Building project for target framework '.NETFramework,Version=v3.0'.
Packing files from 'C:\Dev\jmello\SOS\Main\Chargebee-dotnet\ChargeBee\bin\Debug'
.
Found packages.config. Using packages listed as dependencies
WARNING: Description was not specified. Using 'Description'.

Id: ChargeBee
Version: 1.0.0.1
Authors: Microsoft
Description: Description
Dependencies: Newtonsoft.Json (≥ 4.5.11)

Added file 'lib\net30\ChargeBee.dll'.

Successfully created package 'C:\Dev\jmello\SOS\Main\Chargebee-dotnet\ChargeBee
ChargeBee.1.0.0.1.nupkg'.

HostedPage's Content property is returning a JToken instead of HostedPageContent now

Description of the Bug

Previously, accessing the Content property of the HostedPage object would return HostedPageContent. Now it returns a JToken. Furthermore, the HostedPageContent constructor that accepts a JToken is internal so it is not usable.

Steps to reproduce

  1. Get the Hosted Page with a call like EntityResult result = HostedPage.Acknowledge(hostedPageId).Request();
  2. Access the Content like result.HostedPage.Content

Expected Behavior

We expect Content to be of type HostedPageContent instead of JToken

Code Snippets (if applicable)

EntityResult result = HostedPage.Acknowledge(hostedPageId).Request();
Subscription cbSub = result.HostedPage.Content.Subscription;

Operating System

Windows

Language version

.NET Standard 2.0

Library version

v.3.18.0

Additional context

No response

`Offset(..)` throws exception for subsequently calls

When paging a given resource, it should be allowed to call Offset more than once. When doing it today we get the this exception: System.ArgumentException: An item with the same key has already been added. Key: offset.

To reproduce, use this code and make sure more than 100 events is present (or lower pageSize)

var events = new List<Event>();

const int pageSize = 100;
string offset = null;

do
{
    var result = await Event
        .List()
        .Offset(offset)
        .Limit(pageSize)
        .RequestAsync();

    offset = result.NextOffset;

    events.AddRange(result.List.Select(x => x.Event));
} while (offset != null);

return events;

Subscription instances do not survive a serialize/deserialize cycle (v2.8.0)

Instances of the Subscription class cannot be deserialized. When retrieving the Subscription.CustomerId property after deserialization it fails with a NullReferenceException.

var subsText = Newtonsoft.Json.JsonConvert.SerializeObject(result.Subscription);

// writes out a json as expected, including the Subscription.CustomerId property
Console.WriteLine(subsText); 

var subs = Newtonsoft.Json.JsonConvert.DeserializeObject<Subscription>(subsText);

// Throws a NullReferenceException when trying to access the CustomerId property
Console.WriteLine(subs.CustomerId); 

Upgrade project/package

We are currently looking into using ChargeBee for our subscription business, but the lack of maintenance of this package does not really fill us with confidence. Looking at the commits I can see that changes to the api are taken care off, but the rest of the project lacks proper maintance. Issues get more or less ignored by the team, a 12months old pull request never got any feedback, the whole thing obviously was hacked together 2013 and since then never really got a proper update.

Whats happening? It's 2018, please spend some effort and interact with the community! We are all interested in your product, why are you not helping us out? Have a look at the forks from
dexgrid and christianscheuer for a start and merge does changes.

Please invest just a littlebit of your newly raised capital and update the project to a dotnet core solution which follows the 2018 patterns. Especially when it comes to the following points:

  • DI
  • HttpClient lifecycle with IHttpClientFactory
  • Retry policies with Polly
  • Config
  • Async
  • Json.Net serialization/deserialization

Cheers!

Subscription update request with '#' as part of the id fails

Subscription update requests with '#' as part of the id fail with a seemingly unrelated exception.

The error is part of the Chargebee api. The following request will return an error:

Request:
curl https://*.chargebee.com/api/v2/subscriptions/#test1234 -u *: -d cf_field="value"

Response:
{"message":"plan_id : cannot be blank","type":"invalid_request","api_error_code":"invalid_request","param":"plan_id","error_code":"param_required","error_msg":"cannot be blank","error_param":"plan_id","http_status_code":400}

The id has to be url encoded. The following request works:
curl https://*.chargebee.com/api/v2/subscriptions/%23test1234 -u *: -d cf_field="value"

Since the sdk already uses Uri.EscapeDataString, there is currently no way to make this call work. Most likely Uri.EscapeDataString should be used instead.

This could be an issue with all requests that have the id as path parameter.

Currency Issue

From currency docs, https://apidocs.chargebee.com/docs/api#currencies
It says Chargebee uses the smallest unit in the currency.

#Issue:
Create an order with order total 100 USD.
In the event, the CurrencyCode is USD and Total is 10000 which is absolutely wrong.

Instead of handling the conversion in our app, it should be handled in SDK or chargebee itself

It's impossible to add `.Header()` to certain types of requests

Description

For certain types of requests (e.g. deleting a payment source), when you're trying to add a header via .Header() an exception is thrown.

Affected versions

  • 3.8.0
  • 3.9.0

(Haven't tests earlier version)

Code to reproduce the error

var request = ChargeBee.Models.PaymentSource.Delete("test");
request.Header("test", "test");

Exception

Unhandled exception. System.InvalidCastException: Object must implement IConvertible.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at ChargeBee.Api.EntityRequest`1.Header(String headerName, String headerValue)
   at Program.<Main>$(String[] args) in ......

Notes

It looks like this error occurs in all requests that have type EntityRequest<Type>.
The error is thrown here: (T) Convert.ChangeType((object) this, typeof (T));.
It also means that for such requests it's not possible to set idempotency key or add a parameter to such request.

Find Customer ID

Hi,

Is there a way to retrieve a customer ID using the API?

I'm looking to find a customer by their email address, but your API only supports by ID. Is there any way around this or to retrieve the ID?

Multiple chargebee account from single application

I have 2 chargebee account let say A and B, i want some of my user to subscribe in account A and others in account B.

I am using Hosted pages to redirect user to chargebee subscription page.

I initialize api keys every time before i send request on chargebee.

Now suppose if a user comes and he will be subscribing to account A, i will get the URL of hosted page & i will redirect him on subscription page.

Another user comes (on different system, different place) and subscribe to account B, I m not getting URL of hosted page for the first time, if i send the request again i will get the URL. Now it will work fine until some one goes to subscribe in account A.

And now the user who is paying in account A will face the same problem for the first time.

System.ArgumentException when parsing the test webhook payload

Description of the Bug

I'm getting a System.ArgumentException when I read the Event object after serialization using either of the supported methods provided by the SDK.

var eventDto1 = ApiConfig.DeserializeObject<Event>(jsonString);
var eventDto2 = new Event(jsonString);

This is the error:

Property accessor 'Index' on object 'ChargeBee.Models.Subscription+SubscriptionShippingAddress' threw the following exception:'The property index is not present!'
System.Reflection.TargetInvocationException: Property accessor 'Index' on object 'ChargeBee.Models.Subscription+SubscriptionShippingAddress' threw the following exception:'The property index is not present!'
---> System.ArgumentException: The property index is not present!
at ChargeBee.Internal.Resource.ThrowIfKeyMissed(String key)
at ChargeBee.Internal.Resource.GetValue[T](String key, Boolean required)
at ChargeBee.Models.Subscription.SubscriptionShippingAddress.get_Index()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Steps to reproduce

Described above.

Expected Behavior

A shipping address with no index shouldn't throw an exception. Similarly, the test webhook function should provide a payload that doesn't throw exceptions when hooked up with the provided client.

In our context, we have interceptors that look into the object properties.

Code Snippets (if applicable)

No response

Operating System

Windows

Language version

.NET8

Library version

v3.0.0 and 3.15.0

Additional context

No response

CreditNotes throws NullReferenceException from SubscriptionCreated event

Hi
chargebee-dotnet v2 throws a null reference exception when trying to access CreditNotes. There is no matching "credit_notes" in the json event from ChargeBee.

This is the event sent for SubscriptionCreated

{
    "subscription": {
        "id": "xxx",
        "plan_id": "test",
        "plan_quantity": 1,
        "status": "active",
        "current_term_start": 1460718135,
        "current_term_end": 1463310135,
        "created_at": 1460718135,
        "started_at": 1460718135,
        "activated_at": 1460718135,
        "affiliate_token": "xxx",
        "created_from_ip": "0.0.0.0",
        "has_scheduled_changes": false,
        "object": "subscription",
        "addons": [{
            "id": "0",
            "quantity": 13,
            "object": "addon"
        }],
        "due_invoices_count": 0
    },
    "customer": {
        "id": "0",
        "first_name": "jo",
        "email": "jo",
        "auto_collection": "on",
        "allow_direct_debit": false,
        "created_at": 1460718135,
        "created_from_ip": "0.0.0.0",
        "taxability": "taxable",
        "object": "customer",
        "billing_address": {
            "first_name": "jo",
            "last_name": "jo",
            "line1": "jo",
            "city": "jo",
            "state": "asd",
            "country": "SE",
            "object": "billing_address"
        },
        "card_status": "valid",
        "payment_method": {
            "object": "payment_method",
            "type": "card",
            "reference_id": "xxx",
            "gateway": "stripe",
            "status": "valid"
        },
        "promotional_credits": 0,
        "refundable_credits": 0,
        "excess_payments": 0
    },
    "card": {
        "customer_id": "0",
        "status": "valid",
        "gateway": "stripe",
        "first_name": "asd",
        "last_name": "asd",
        "iin": "424242",
        "last4": "4242",
        "card_type": "visa",
        "expiry_month": 12,
        "expiry_year": 2017,
        "ip_address": "0.0.0.0",
        "object": "card",
        "masked_number": "************4242"
    },
    "invoice": {
        "id": "50308",
        "customer_id": "xxx",
        "subscription_id": "xxx",
        "recurring": true,
        "status": "paid",
        "price_type": "tax_exclusive",
        "date": 1460718135,
        "total": 45750,
        "amount_paid": 45750,
        "amount_adjusted": 0,
        "write_off_amount": 0,
        "credits_applied": 0,
        "amount_due": 0,
        "paid_at": 1460718136,
        "object": "invoice",
        "first_invoice": true,
        "currency_code": "USD",
        "tax": 9150,
        "line_items": [
            {
                "date_from": 1460718135,
                "date_to": 1463310135,
                "unit_amount": 24900,
                "quantity": 1,
                "is_taxed": true,
                "tax_amount": 6225,
                "tax_rate": 25.0,
                "object": "line_item",
                "amount": 24900,
                "description": "test",
                "entity_type": "plan",
                "entity_id": "test",
                "discount_amount": 0,
                "item_level_discount_amount": 0
            },
            {
                "date_from": 1460718135,
                "date_to": 1463310135,
                "unit_amount": 900,
                "quantity": 13,
                "is_taxed": true,
                "tax_amount": 2925,
                "tax_rate": 25.0,
                "object": "line_item",
                "amount": 11700,
                "description": "test",
                "entity_type": "addon",
                "entity_id": "test",
                "discount_amount": 0,
                "item_level_discount_amount": 0
            }
        ],
        "taxes": [{
            "object": "tax",
            "description": "Tax @ 25%",
            "amount": 9150
        }],
        "sub_total": 36600,
        "linked_payments": [{
            "txn_id": "txn_xxx",
            "applied_amount": 45750,
            "applied_at": 1460718136,
            "txn_status": "success",
            "txn_date": 1460718136,
            "txn_amount": 45750
        }],
        "applied_credits": [],
        "adjustment_credit_notes": [],
        "issued_credit_notes": [],
        "linked_orders": [],
        "billing_address": {
            "first_name": "jo",
            "last_name": "jo",
            "line1": "jo",
            "city": "jo",
            "state": "asd",
            "country": "SE",
            "object": "billing_address"
        }
    }
}

So jArr will be null in ResultBase.cs (row 118):

private List<T> GetResourceList<T>(string property, string propertySingularName) where T : Resource, new() 
        {
            List<T> list = new List<T> ();
            JArray jArr = (JArray)m_jobj.SelectToken (property);
            foreach (JToken jObj in jArr.Children()) {
            T t = new T();
                t.JObj = jObj;
                list.Add(t);
            }
            return list;
        }

This means that it it not possible to serialize an incoming event to save it in the database for example.

I would submit a pull request, but I guess that you have a preferred solution for this.

How do I create Usage?

Hi,

I want to send usage data from our app back to Chargebee but I'm missing two things:
What I have now is this:

long UnixNow() { return (long)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds; }
ApiConfig.Configure("mysite-test", "myApiKey");

var u = Usage.Create("usageGuid").UsageDate(UnixNow()).ItemPriceId("Addon-Key").Quantity("5");
u.Request();

How do I set the subscriptionId that I want to post usage for? A fluent function for subscription_id doesn't seem to exist on CreateRequest? https://github.com/chargebee/chargebee-dotnet/blob/master/ChargeBee/Models/Usage.cs

Creating usage requires an ID

Description of the Bug

Affected versions

  • 3.12.0
  • 3.17.0
  • (Probably all version in between, but these are the two that were tested)

When creating a usage instance for a metered addon, it requires a non-null, non-empty string as the ID despite the documentation stating that an ID is optional: https://apidocs.chargebee.com/docs/api/usages?lang=dotnet#create_a_usage

This happens with the ChargeBee.Usage.Create() static helper function.

Steps to reproduce

  1. Call ChargeBee.Usage.Create() to create a Usage.CreateRequest

Expected Behavior

It should create a Usage.CreateRequest without requiring a non-null, non-empty string as the ID.

Code Snippets (if applicable)

EntityResult result = Usage.Create()
	.ItemPriceId("charge_price_id")
	.UsageDate("now")
	.Quantity("2")
	.Request();

Operating System

Windows

Language version

.NET Standard 2.0

Library version

v3.17.0

Additional context

No response

ChargeBee.Models.Subscription.UpdateForItemsRequest in EntityResult throws

Consider this code
ChargeBee.Models.Subscription.UpdateForItemsRequest subReq = ChargeBee.Models.Subscription.UpdateForItems(subscriptionId.ToString())
.SubscriptionItemItemPriceId(0,planId)
.SubscriptionItemQuantity(0, planQuantity);
EntityResult result = subReq.Request();

After the call - any access to result.Subscription thows the exception below.

Error getting value from 'Index' on 'ChargeBee.Models.Subscription+SubscriptionItemTier'. ChargeBee: The property index is not present!.

Subscription API error with tiered pricing

Hi,

We're getting an error when querying for a list of subscriptions by account Id, from the debugger stack trace it looks like Chargebee is not returning the index key for tiered pricing, all our subscriptions are tiered pricing.

SDK: chargebee.net v3.0.0, also tested on v2.22.0

Error Message:

Newtonsoft.Json.JsonSerializationException: Error getting value from 'Index' on 'ChargeBee.Models.Subscription+SubscriptionItemTier'.
       ---> System.ArgumentException: The property index is not present!

Debugger screenshot:
image

Code:

  var subscriptions = await Subscription.List()
                .CustomerId()
                .Is(accountId)
                .RequestAsync();

Upgrade from 2.6.7 to 2.6.9 -> Timestamp errors

Hi,

I've updated from version 2.6.7 -> 2.6.9.

Everything compiled fine and everything seemed fined after a few tests.

Then I received a webhook from ChargeBee and everything went down...

When creating a new webhook event from an IO stream, it works, but when you check the details of the newly created object, you see an error for the property OccuredAt:

OccurredAt = 'WebhookEvent.OccurredAt' threw an exception of type 'System.TypeInitializationException'

This is how I create the webhookEvent object:

Public Sub ProcessRequest(context As HttpContext) Implements IHttpHandler.ProcessRequest

	Dim Response As String = Nothing
	Dim ResponseCode As HttpStatusCode = HttpStatusCode.OK

	Try

		' Input
		Using StreamReader As New IO.StreamReader(context.Request.InputStream)

			InputData = StreamReader.ReadToEnd()

		End Using
		If String.IsNullOrWhiteSpace(InputData) Then Throw New ArgumentNullException("The data cannot be null.")

		' Create the webhook event
		WebhookEvent = New ChargeBee.Models.Event(InputData)

		[...]

	Catch ex as Exception
	End Try

	[...]

End Sub

I checked and the timestamp is fine in the IO stream (1552915864).

All the modules are up to date, everything else is working fine, I just can't make the webhook object creation works.

If I use 2.6.7, this works flawlessly, in fact it's been working flawlessly all the way back with version 1.x.x.

Please fix for the next release

Handle Webhook Payload Parsing

Maybe I missed this, but I don't see any way of parsing and handling webhook body message payloads. It would be great if the SDK had some way of giving it the raw webhook incoming json body and allowing the SDK to validate it and parse it into the common model objects.

2.8.4 is not compatible with net48

Error message, also tested with a new project:

Package chargebee 2.8.4 is not compatible with net48 (.NETFramework,Version=v4.8). Package chargebee 2.8.4 supports: netcoreapp3.0 (.NETCoreApp,Version=v3.0)

Also:

Could not install package 'chargebee 2.8.4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Serialization of Models.Subscriptions fails with Product Catalog 2.0 (The property plan_id is not present!)

Steps to repro ...
Add a JsonConvert.SerializeObject(result); to the demo code on https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=2#create_subscription_for_items

EntityResult result = Subscription.CreateWithItems("__test__8asz8Ru9WhHOJO")
.SubscriptionItemItemPriceId(0,"basic-USD")
.SubscriptionItemBillingCycles(0,2)
.SubscriptionItemQuantity(0,1)
.SubscriptionItemItemPriceId(1,"day-pass-USD")
.SubscriptionItemUnitPrice(1,100)
.Request();

var thisWillFail = JsonConvert.SerializeObject(result);

Data loss serializing Estimate

Hi

I found InvoiceEstimateTax and the other InvoiceEstimate subclass objects don't serialize as one would expect. I think it's due to the objects having methods rather than properties for things like Name, Description and Amount...

I ran into this trying to return an estimate in a webservice response (where serialization to JSON is done automatically) but easier example code to see the issue is:

EntityResult result = Estimate.CreateSubscription()
        .SubscriptionPlanId("<plan-id>")
        .SubscriptionPlanQuantity(1)
        .BillingAddressCountry("<country-code>")
        .Request();

var estimate = result.Estimate;
Console.WriteLine($"Taxes Count (before serialization): {estimate.InvoiceEstimate.Taxes?.Count}");

var json = Newtonsoft.Json.JsonConvert.SerializeObject(estimate);
Console.WriteLine($"JSON: {json}"); // Tax data missing

Unable to cache Subscription instances due to serialization issues

Instances of the Subscription class cannot be deserialized. When retrieving the Subscription.CustomerId property after deserialization it fails with a NullReferenceException.

var subsText = Newtonsoft.Json.JsonConvert.SerializeObject(result.Subscription);

// writes out a json as expected, including the Subscription.CustomerId property
Console.WriteLine(subsText); 

var subs = Newtonsoft.Json.JsonConvert.DeserializeObject<Subscription>(subsText);

// Throws a NullReferenceException when trying to access the CustomerId property
Console.WriteLine(subs.CustomerId); 

MetaData is not available on subscription

There is no way to access the meta data stored on a subscription after you do a

var subscription = ChargeBee.Models.Subscription.Retrieve(subscriptionId).Request();

Could this be added?

Kind regards

PortalSession not accepting ':' character to specify port for redirect parameter

All other redirect parameters for entities such as HostedPages accept ':' character to specify a port.
However the PortalSession entity doesn't support specifying a port using this character.

var portal = ChargeBee.Models.PortalSession.Create() .CustomerId(chargebeeCustomerId) .RedirectUrl("https://localhost:4444/test") .Request();

ArgumentException when trying to set Limit or Offset in list request

Hello guys, We are getting ArgumentException when trying to set Limit or Offset of ListRequestBase.

We are using the same request multiple times to be able to download lists with more than 100 entries. This exception is really annoying, because the ListRequestBase object does not make it clear that we are working with a dictionary, and does not allow us to see or change existing values.

I wonder if this behavior is intended, and if it is, why.

For now we are having to resource to workarounds to recreate requests every time, which is very annoying.

NuGet.exe is not checked in

When you clone the repo and attempt to rebuild for the first time, the NuGet package restore fails because it can't find NuGet.exe. Please check it into the repo to resolve this. I am unsure what version of NuGet.exe you would like to use there, so i didn't create a pull request.

PaymentIntent.CustomerId Required

CustomerId when requesting a PaymentIntent is optional. But the PaymentIntent model has made it required. Doesn't look right. Please fix.

InvalidRequestException - handling specific fields

Hey, I noticed an issue while I was trying to gracefully handle coupon errors. From what I can tell, there is not a good way to programmatically handle errors for specific fields. According to the documentation, I should be able to use the Param field on InvalidRequestException to determine the incorrect parameter, but from my experience, it has always been null. In the meantime, I am using ApiCode, however, it is deprecated.

-		(ApiException) e	{"Coupon INVALID_COUPON_TEST cannot be applied as it is not applicable to any of the items"}	ChargeBee.Api.ApiException {ChargeBee.Exceptions.InvalidRequestException}
		ApiCode	"coupon_not_applicable"	string
		ApiErrorCode	"invalid_request"	string
		ApiMessage	"Coupon INVALID_COUPON_TEST cannot be applied as it is not applicable to any of the items"	string
+		Data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		HResult	-2146233088	int
		HelpLink	null	string
		HttpCode	BadRequest	System.Net.HttpStatusCode
		HttpStatusCode	BadRequest	System.Net.HttpStatusCode
+		InnerException	null	System.Exception
		Message	"Coupon INVALID_COUPON_TEST cannot be applied as it is not applicable to any of the items"	string
		Param	null	string
		Parameter	null	string
		Source	"ChargeBee"	string
+		TargetSite	{Void HandleException(System.Net.Http.HttpResponseMessage)}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
		Type	"invalid_request"	string
+		Static members		
+		Non-Public members		

Setting a single value of the BillingInfo not possible

When trying to update a single property of the BillingInfo object I have to fill the complete object otherwise it will clear all the other properties in the Customer.
A workaround would be to retrieve the customer and prefill the object and then add the changed values, but becuase it is a Dictionary I will get the An item with the same key has already been added. exception. I think it would be nicer if setting a param would just override the currently set value.

Async/Await Support

Are there any plans on the road map for Async/Await support on the http requests?

Change the ApiConfig.ApiBaseUrl for testing

We want to redirect this client library to use our own Stub (that simulates chargebee.com) when we are running locally (ie manual testing), so that we are not hitting chargebee.com.

Most other client libraries (eg Stripe) allow use to re-define the BaseUrl that their client uses, so that we can achieve this.
However, this library does not allow us to do that.

Examining this:

    public string ApiBaseUrl => string.Format("{0}://{1}.{2}/api/{3}", (object) ApiConfig.Proto, (object) this.SiteName, (object) ApiConfig.DomainSuffix, (object) ApiConfig.API_VERSION);

public string ApiBaseUrl

It appears that we can change the ApiConfig.Site and the ApiConfig.DomainSuffix but these are still concatenated together with a '.', and the /api part and version are enforced, but what we really need to do is set the ApiBaseUrl to something like: https://localhost:5656/chargebee (where 5656 is the port of our stubservices).

Is it possible to change ApiConfig in some way to allow us to set:
ApiConfig.ApiBaseUrl = https://localhost:5656/chargebee?

Multi tenant support

At a client we need to connect with multiple ChargeBee entities from one application context. With the current static implementation of ApiConfig it seems quite impossible. But the documentation site says this:
image

There is a way of passing an ApiConfig instance along with the request and that would solve it... But the ApiConfig does not have a public constructor nor can I inherit it because it is sealed.

Is there a recommended way to do this? If not, would you consider changes I would suggest in a PR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.