Giter Site home page Giter Site logo

killbill-client-java's Introduction

killbill-client-java

Maven Central

Java client library for Kill Bill.

Kill Bill compatibility

Client version Kill Bill version
0.23.y 0.16.z
0.40.y 0.18.z
0.41.y 0.19.z
1.0.y 0.20.z
1.1.y 0.22.z
1.2.y 0.22.z
1.3.y 0.24.z

We've upgraded numerous dependencies in 1.2.x (required for Java 11 support).

Usage

Add the library to your application:

<dependency>
    <groupId>org.kill-bill.billing</groupId>
    <artifactId>killbill-client-java</artifactId>
    <version>... release version ...</version>
</dependency>

The easiest way to get started is to look at our Java client tutorial. We also provide a sample Java client application. You can clone this project in order to get started.

When sending a body, if you are unsure which parameters to pass, take a look at the Java api documentation.

Build

To build the library:

mvn clean install -DskipTests=true

This will produce several jars, including:

  • killbill-client-java-x.y.z-SNAPSHOT.jar which contains the library only
  • killbill-client-java-x.y.z-SNAPSHOT-jar-with-dependencies.jar which is a self-contained jar (library and dependencies)

About

Kill Bill is the leading Open-Source Subscription Billing & Payments Platform. For more information about the project, go to https://killbill.io/.

killbill-client-java's People

Contributors

akley avatar andrenpaes avatar beccagaspard avatar benweidig avatar brunner avatar consulthys avatar gpreston-womply avatar holkra avatar jperalmethodmaker avatar kbbitsp avatar killbillio avatar learnjavawithreshma avatar matias-aguero-hs avatar pierre avatar reshmabidikar avatar sbrossie avatar sruthipendyala avatar vijay-rsystems avatar wwjbatista avatar xsalefter avatar

Stargazers

 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

Watchers

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

killbill-client-java's Issues

Misleading error message in createPayment

Preconditions.checkNotNull(paymentTransaction.getTransactionType(), "PaymentTransaction#transactionId cannot be null");

should be

Preconditions.checkNotNull(paymentTransaction.getTransactionType(), "PaymentTransaction#transactionType cannot be null");

$03 Forbidden error.

Hi team,
I am calling these method and also i am passing requested data to the particular method but getting null value as a response. Is there any thing required to configure in the source code. Please give me guild lines.

Upload catalog translation causes an error

The upload catalog translation and upload invoice translation code causes the following error:

org.killbill.billing.client.KillBillClientException: Invalid locale format: fr_FR/

The following stack trace is seen in the Kill Bill logs:

Caused by: java.lang.IllegalArgumentException: Invalid locale format: fr_FR/
	at org.killbill.billing.util.LocaleUtils.toLocale(LocaleUtils.java:50)
	at org.killbill.billing.jaxrs.resources.InvoiceResource.getTemplateResource(InvoiceResource.java:925)
	at org.killbill.billing.jaxrs.resources.InvoiceResource.getCatalogTranslation(InvoiceResource.java:782)
	at org.killbill.billing.jaxrs.resources.InvoiceResource_$$_jvstc52_0._d36getCatalogTranslation(InvoiceResource_$$_jvstc52_0.java)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1268)
	at org.jvnet.hk2.internal.MethodInterceptorHandler$MethodInvocationImpl.proceed(MethodInterceptorHandler.java:164)
	at org.killbill.commons.skeleton.metrics.TimedResourceInterceptor.invoke(TimedResourceInterceptor.java:70)
	at org.jvnet.hk2.internal.MethodInterceptorHandler.invoke(MethodInterceptorHandler.java:97)
	at org.killbill.billing.jaxrs.resources.InvoiceResource_$$_jvstc52_0.getCatalogTranslation(InvoiceResource_$$_jvstc52_0.java)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134)
	... 73 common frames omitted

Improve response for create calls

Create calls in Kill Bill typically return 201 with a Location header. When followLocation is specified, there is Get to automatically fetch the resource; however, when followLocation is not specified, there no response returned and no easy way to even get the ID of the resource.

We would like to at least return an empty resource with the ID to make it easy for the caller.

No provided dependencies for version 1.3.0 and 1.3.1 builds

Hi!
I build app with gradle and killbill client. When we has client version 1.2.6, all transitive dependecies were downloaded successfully.

After upgrade to 1.3.0 something brokes and gradle can't see transitive dependencies.
Also on maven central pages i can see compile dependencies for 1.2.6, but this list is empty for 1.3.0 and 1.3.1
https://mvnrepository.com/artifact/org.kill-bill.billing/killbill-client-java/1.2.6
https://mvnrepository.com/artifact/org.kill-bill.billing/killbill-client-java/1.3.0
https://mvnrepository.com/artifact/org.kill-bill.billing/killbill-client-java/1.3.1

My current solution - just copy needed dependencies in project root dependencies.

In pom within jar all looks good, but i saw that maven shade plugin installed.
If else, then may be wrong jar publicated? (without included dependencies)

KillBillHttpClient failing to deserialize some errors

There seems to be a problem handling some errors, specifically unpacking the returned error. This is the stack track I'm seeing:

org.killbill.billing.client.KillBillClientException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "stacktrace" (class org.killbill.billing.client.BillingException), not marked as ignorable (6 known properties: "className", "message", "causeClassName", "code", "causeMessage", "stackTrace"]) at [Source: (ByteArrayInputStream); line: 1, column: 11023] (through reference chain: org.killbill.billing.client.BillingException["stacktrace"]) at 
org.killbill.billing.client.KillBillHttpClient.unmarshalResponse(KillBillHttpClient.java:492) at 
org.killbill.billing.client.KillBillHttpClient.deserializeResponse(KillBillHttpClient.java:420) at 
org.killbill.billing.client.KillBillHttpClient.throwExceptionOnResponseError(KillBillHttpClient.java:397) at 
org.killbill.billing.client.KillBillHttpClient.doPrepareRequestInternal(KillBillHttpClient.java:351) at 
org.killbill.billing.client.KillBillHttpClient.doPrepareRequest(KillBillHttpClient.java:298) at 
org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:220) at 
org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:215) at 
org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:211) at

It looks like the response that came back doesn't deserialize into the BillingException class, and jackson is failing. The actual error is something to do with the Stripe plugin, my call was to /plugins/killbill-stripe/checkout and I probably haven't configured Stripe properly. I can go fix that but KillBillHttpClient should unpack the error anyway, and there are possibly other cases where the returned error doesn't fit.

This is on killbill-client-java-1.2.1

Questions

At first glance I'm finding the client doesn't have the transactional semantics that I was expecting.
A few questions;
Is Ning using this api?
How does an operator create an external charge?
How do you add taxes and or other charges into an invoice?
Can Kill-Bill handle non-subscription (eg. one off) billing or is that not recommended? If so, can you provide a little bit of code on how to invoice for something and then pay it?

unmarshalResponse masks errors that aren't in JSON format

Particularly this error.

I am getting an error when using pluginPOST:

org.killbill.billing.client.KillBillClientException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Invalid': was expecting 'null', 'true', 'false' or NaN
at [Source: org.jboss.netty.buffer.ChannelBufferInputStream@15590dd4; line: 1, column: 9]
at org.killbill.billing.client.KillBillHttpClient.unmarshalResponse(KillBillHttpClient.java:718)
at org.killbill.billing.client.KillBillHttpClient.deserializeResponse(KillBillHttpClient.java:648)
at org.killbill.billing.client.KillBillHttpClient.throwExceptionOnResponseError(KillBillHttpClient.java:632)
at org.killbill.billing.client.KillBillHttpClient.doPrepareRequest(KillBillHttpClient.java:503)
at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:247)
at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:242)
at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:238)
at org.killbill.billing.client.KillBillClient.pluginPOST(KillBillClient.java:3979)

This is masking the actual error that is being returned. There should be a catch handler there somewhere to detect JsonParseExceptions and return response.getResponseBody() instead. Possibly, just add JsonParseException to the catch block on line 731 of KillBillHttpClient? I realize I could switch the DEBUG flag on, but if this is an intermittent error in production, that flag doesn't help too much.

Implement missing calls

Go through our resources and make sure the following API calls are implemented:

  • All APIs in AccountResource
  • All APIs in BundleResource
  • All APIs in CatalogResource
  • All APIs in CreditResource
  • All APIs in InvoicePaymentResource
  • All APIs in InvoiceResource
  • All APIs in PaymentMethodResource
  • All APIs in PaymentResource
  • All APIs in SubscriptionResource

Additionally, get rid of all the @Deprecated methods (the Kill Bill server tests will need to be updated).

Notes:

  • To be done on the work-for-release-0.19.x branch only
  • Create one PR per Resource to simplify the review (both here and in the Kill Bill repo)
  • For testing, add new (or update existing) Kill Bill server tests

Wrong date format in CatalogApi::getProductForSubscriptionAndDate

public Product getProductForSubscriptionAndDate(final UUID subscriptionId, final LocalDate requestedDate, final RequestOptions inputOptions) throws KillBillClientException {

According to the latest version of the KillBill API, GET /1.0/kb/catalog/product expects a LocalDateTime, not a LocalDate. In the current implementation of the library, LocalDate is passed, which causes an exception.
Now kill bill requires date time in ISO format. You can look at the Kill Bill code to see for yourself. The implementation of the getLastEventBeforeDate method uses the ISO format

CreateSubscriptionWithAddons always requires product name, product category, billing period

Hi Guys,

KB version 0.18.3

The client currently does the following check... which to me makes sense.

public Bundle createSubscriptionWithAddOns(final Iterable<Subscription> subscriptions, final LocalDate requestedDate, final int timeoutSec, final RequestOptions inputOptions) throws KillBillClientException {
        for (final Subscription subscription : subscriptions) {
            if (subscription.getPlanName() == null) {
                Preconditions.checkNotNull(subscription.getProductName(), "Subscription#productName cannot be null");
                Preconditions.checkNotNull(subscription.getProductCategory(), "Subscription#productCategory cannot be null");
                Preconditions.checkNotNull(subscription.getBillingPeriod(), "Subscription#billingPeriod cannot be null");
                Preconditions.checkNotNull(subscription.getPriceList(), "Subscription#priceList cannot be null");
                if (subscription.getProductCategory() == ProductCategory.BASE) {
                    Preconditions.checkNotNull(subscription.getAccountId(), "Account#accountId cannot be null for base subscription");
                }
            }
        }

If no plan name is provided on the passed in subscriptions then ensure Product Name, Product Category, Billing Period are provided.

The implication from the above is that these details could be obtained by the server by looking up the plan if provided.

However in reality if you call the createEntitlementWithAddOns endpoint and don't supply these additional fields (regardless of plan name) you will cop the below error.

2017-03-24T07:46:18,805+0000 lvl='INFO', log='LoggingFilter', th='catalina-exec-4', xff='', rId='a9b9c59d-6dea-46a0-b484-23612321239d', aRId='', tRId='4', 139 * Server in-bound request
139 > POST http://10.1.1.150:8080/1.0/kb/subscriptions/createEntitlementWithAddOns
139 > x-killbill-apikey: pctest2
139 > x-killbill-apisecret: pctest2secret
139 > x-killbill-createdby: Testing User
139 > x-killbill-comment: kill-bill-net-tests
139 > x-killbill-reason: KillBill Api Test
139 > accept: application/json, text/html
139 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
139 > user-agent: RestSharp/105.0.1.0
139 > content-type: application/json
139 > host: 10.1.1.150:8080
139 > content-length: 648
139 > accept-encoding: gzip, deflate
139 > connection: Keep-Alive
139 > 

2017-03-24T07:46:18,813+0000 lvl='WARN', log='JaxRsResourceBase', th='catalina-exec-4', xff='', rId='a9b9c59d-6dea-46a0-b484-23612321239d', aRId='', tRId='4', Parameter requestedDate is being deprecated: Instead use parameters entitlementDate,billingDate
java.lang.NullPointerException
	at org.killbill.billing.jaxrs.resources.SubscriptionResource$2.apply(SubscriptionResource.java:279)
	at org.killbill.billing.jaxrs.resources.SubscriptionResource$2.apply(SubscriptionResource.java:276)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at com.google.common.collect.Iterators.size(Iterators.java:191)
	at com.google.common.collect.Iterables.size(Iterables.java:108)
	at org.killbill.billing.jaxrs.resources.SubscriptionResource.createEntitlementWithAddOns(SubscriptionResource.java:276)
	at org.killbill.commons.skeleton.metrics.TimedResourceInterceptor.invoke(TimedResourceInterceptor.java:67)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)

I personally think the client is correct and that the server is not handling the scenario correctly.

Wrongly named JsonProperty in HostedPaymentPageFormDescriptor constructor

I'm getting the following error when calling buildFormDescriptor

com.fasterxml.jackson.databind.JsonMappingException: Duplicate creator property "formFields" (index 0 vs 1)

After looking into the sources, it looks like there's a typo in
https://github.com/killbill/killbill-client-java/blob/master/src/main/java/org/killbill/billing/client/model/HostedPaymentPageFormDescriptor.java
as all JsonProperty are named formFields

    public HostedPaymentPageFormDescriptor(@JsonProperty("formFields") final String kbAccountId,
                                           @JsonProperty("formFields") final String formMethod,
                                           @JsonProperty("formFields") final String formUrl,
                                           @JsonProperty("formFields") final Map<String, String> formFields,
                                           @JsonProperty("formFields") final Map<String, String> properties) {

Can't upload template

When trying to upload a template (even default one like the one from the documentation: https://github.com/killbill/killbill/blob/master/util/src/main/resources/org/killbill/billing/util/invoice/templates/HtmlInvoiceTemplate.mustache) I get following exception:

Code is just plain api call with template in string:

invoiceApi.uploadInvoiceTemplate(template, RequestOptions.builder().withCreatedBy("wojtek").build());
org.killbill.billing.client.KillBillClientException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (jdk.internal.net.http.ResponseSubscribers$HttpResponseInputStream); line: 1, column: 2]

	at org.killbill.billing.client.KillBillHttpClient.unmarshalResponse(KillBillHttpClient.java:481)
	at org.killbill.billing.client.KillBillHttpClient.deserializeResponse(KillBillHttpClient.java:410)
	at org.killbill.billing.client.KillBillHttpClient.throwExceptionOnResponseError(KillBillHttpClient.java:387)
	at org.killbill.billing.client.KillBillHttpClient.doPrepareRequestInternal(KillBillHttpClient.java:349)
	at org.killbill.billing.client.KillBillHttpClient.doPrepareRequest(KillBillHttpClient.java:296)
	at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:210)
	at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:205)
	at org.killbill.billing.client.api.gen.InvoiceApi.uploadInvoiceTemplate(InvoiceApi.java:833)
	at org.killbill.billing.client.api.gen.InvoiceApi.uploadInvoiceTemplate(InvoiceApi.java:812)
…
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (jdk.internal.net.http.ResponseSubscribers$HttpResponseInputStream); line: 1, column: 2]
	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:735)
	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:659)
	at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2737)
	at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:902)
	at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:794)
	at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4761)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4667)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3666)
	at org.killbill.billing.client.KillBillHttpClient.unmarshalResponse(KillBillHttpClient.java:469)
	... 76 more

btw. it doesn't work from CURL neither with 400 error:

<!doctype html>
<html lang="en">
<head><title>HTTP Status 400 – Bad Request</title>
    <style type="text/css">
        body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}
    </style>
</head>
<body>
    <h1>HTTP Status 400 – Bad Request</h1>
    <hr class="line"/>
    <p><b>Type</b> Status Report</p>
    <p><b>Message</b> Bad Request</p>
    <p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p>
    <hr class="line"/>
    <h3>Apache Tomcat/8.5.91</h3></body>
</html>

Creating a payment method as default does not work

The accountApi.createPaymentMethod does not set the supplied payment method as default even though the payment method is created with isDefault=true.

The following code can be used to reproduce the issue:

	UUID accountId = UUID.fromString("8d67706e-9001-498a-b197-8f2bd0ba1106");
		UUID paymentMethodId = null;
		String externalKey = UUID.randomUUID().toString();
		Boolean isDefault = true; // Will set this new payment method as default
		String pluginName = "__EXTERNAL_PAYMENT__"; 
		PaymentMethodPluginDetail info = new PaymentMethodPluginDetail();
		ImmutableList<AuditLog> EMPTY_AUDIT_LOGS = ImmutableList.<AuditLog>of();

		PaymentMethod paymentMethod = new PaymentMethod(paymentMethodId, 
		                                                externalKey, 
		                                                accountId, 
		                                                isDefault, 
		                                                pluginName, 
		                                                info, 
		                                                EMPTY_AUDIT_LOGS);
		ImmutableList<String> NULL_PLUGIN_NAMES = null;
		ImmutableMap<String, String> NULL_PLUGIN_PROPERTIES = null;

		PaymentMethod paymentMethodPP = accountApi.createPaymentMethod(accountId, 
		                                                               paymentMethod, 
		                                                               NULL_PLUGIN_NAMES, 
		                                                               NULL_PLUGIN_PROPERTIES, 
		                                                               requestOptions);
		assertNotNull(paymentMethodPP);
		assertTrue(paymentMethodPP.isDefault());

Typo on method.

On file KillBillClient.java on line 3477 the method addSimplePan should be addSimplePlan.

HTTP-400 without Response body (client 0.4)

Bad Request status is set to server response (in UsageResource.class, method recordUsage) without content. Same in AccountResource.class method createPaymentMethod.

The problem occures if client side deserialized response (deserializeResponse) with status >= 400.
In line 400:
in = response.getResponseBodyAsStream();
result = mapper.readValue(in, clazz);

The input stream is empty so the mapper throws while readValue: JsonMappingException: No content to map due to end-of-input

can you comprehend or confrim this?

Best regards
Alex

Not able to create basic account killbill-client-java library

I encountered issue with creating basic account using this library.
I'm using:
killbill - 0.18.19 (Docker based)
killbill-client-java - 0.41.9

Next peace of code:

public static void main(String[] args) throws Exception {
        final KillBillHttpClient killBillHttpClient = new KillBillHttpClient("http://127.0.0.1:8080",
                "admin",
                "password",
                "nick-em",
                "nick-em-secret");
        final KillBillClient killBillClient = new KillBillClient(killBillHttpClient);

        // Create an account
        Account account = new Account();
        account.setName("John Doe");
        account.setEmail("[email protected]");
        account.setCurrency("USD");
        account = killBillClient.createAccount(account, RequestOptions.builder()
                .withCreatedBy("Nick Em")
                .withReason("Test reason")
                .withComment("No comments").build());
    }

Always throws:

Exception in thread "main" org.killbill.billing.client.KillBillClientException: Unrecognized field "referenceTime" (class org.killbill.billing.jaxrs.json.AccountJson), not marked as ignorable (26 known properties: "firstNameLength", "paymentMethodId", "isMigrated", "accountId", "auditLogs", "name", "isNotifiedForInvoices", "billCycleDayLocal", "accountBalance", "currency", "externalKey", "accountCBA", "country", "postalCode", "timeZone", "locale", "email", "address1", "parentAccountId", "notes", "isPaymentDelegatedToParent", "city", "phone", "state", "company", "address2"])
 at [Source: org.apache.catalina.connector.CoyoteInputStream@62392429; line: 1, column: 517] (through reference chain: org.killbill.billing.jaxrs.json.AccountJson["referenceTime"])
        at org.killbill.billing.client.KillBillHttpClient.throwExceptionOnResponseError(KillBillHttpClient.java:636)
        at org.killbill.billing.client.KillBillHttpClient.doPrepareRequest(KillBillHttpClient.java:501)
        at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:247)
        at org.killbill.billing.client.KillBillHttpClient.doPost(KillBillHttpClient.java:242)
        at org.killbill.billing.client.KillBillClient.createAccount(KillBillClient.java:295)
        at com.nick.em.Main.main(Main.java:34)

but when I'm using curl everything is OK.

curl -v \
    -u admin:password \
    -H "X-Killbill-ApiKey: nick-em" \
    -H "X-Killbill-ApiSecret: nick-em-secret" \
    -H "Content-Type: application/json" \
    -H "X-Killbill-CreatedBy: Nick Em" \
    -X POST \
    --data-binary '{"name":"John Doe","email":"[email protected]","currency":"USD"}' \
    "http://127.0.0.1:8080/1.0/kb/accounts"

So, there is out - that is client library issue.

NPE when creating payment method

If isDefault isn't set on a PaymentMethod object, createPaymentMethod will throw an NPE (L1056). We should use a sane default (maybe true?).

Make context path customizable

Assume I have changed my context path in my installation from "/1.0/kb/" to "/api/v1/", then i am using Java client to make requests, this end up in 404 or null response from client lib.

Probably we can create a property that picks up the context path from application configuration instead of hardcoding this in client lib to resolve this issue!!

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.