Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in registerPushNotification #146

Open
reshmabidikar opened this issue Aug 11, 2023 · 4 comments
Open

Issue in registerPushNotification #146

reshmabidikar opened this issue Aug 11, 2023 · 4 comments

Comments

@reshmabidikar
Copy link
Contributor

reshmabidikar commented Aug 11, 2023

The registerPushNotificationCallback code does not work.

On invoking this code as follows:

const api: killbill.TenantApi = new killbill.TenantApi(config);
const cb = 'http://demo/callmeback';
api.registerPushNotificationCallback('created-by', cb, 'reason', 'comment')

The following error is shown in the Kill Bill logs:

2023-08-11T06:15:35,983+0000 lvl='WARN', log='WebComponent', th='http-nio-8080-exec-6', xff='', rId='', tok='', aRId='', tRId='1', A servlet request to the URI http://localhost:8080/1.0/kb/tenants/registerNotificationCallback?cb=http%3A%2F%2Fdemo%2Fcallmeback contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
2023-08-11T06:15:35,985+0000 lvl='INFO', log='LoggingFeature', th='http-nio-8080-exec-6', xff='', rId='', tok='', aRId='', tRId='1', 15 * Server has received a request on thread http-nio-8080-exec-6
15 > POST http://localhost:8080/1.0/kb/tenants/registerNotificationCallback?cb=http%3A%2F%2Fdemo%2Fcallmeback
15 > accept: application/json, text/plain, */*
15 > accept-encoding: gzip, compress, deflate, br
15 > authorization: **********
15 > connection: close
15 > content-length: 0
15 > content-type: application/x-www-form-urlencoded
15 > host: localhost:8080
15 > user-agent: axios/1.4.0
15 > x-killbill-apikey: bob
15 > x-killbill-apisecret: *****
15 > x-killbill-comment: comment
15 > x-killbill-createdby: created-by
15 > x-killbill-reason: reason

2023-08-11T06:15:35,986+0000 lvl='INFO', log='LoggingFeature', th='http-nio-8080-exec-6', xff='', rId='', tok='', aRId='', tRId='1', 15 * Server responded with a response on thread http-nio-8080-exec-6
15 < 415
15 < Content-Type: application/json

There is no record inserted in the tenant_kvs table corresponding to the push notification.

On investigating this further, I think this is due to the content-type: application/x-www-form-urlencoded header sent by the javascript client.

@KBbitsP
Copy link

KBbitsP commented Aug 15, 2023

It appears that PUT calls are not working with JS client :

const api: killbill.AccountApi = new killbill.AccountApi(config);   

    api.setDefaultPaymentMethod(
      'put account id here',
      'put payment method id here,
      'KB'
    );

The calls do not fail, they show success but the intended updates do not happen.

const api: killbill.AccountApi = new killbill.AccountApi(config);

    /* const response: AxiosResponse<void, any> = await api.transferChildCreditToParent(
      '1874ab74-df29-4409-b665-2012b1c2803c',
      'KB'
    );
    console.log(response.data); */

    api.transferChildCreditToParent('1874ab74-df29-4409-b665-2012b1c2803c', 'KB');

@KBbitsP
Copy link

KBbitsP commented Sep 13, 2023

Found similar issue with Bundle API :

  1. https://killbill.github.io/slate/bundle.html#update-a-bundle-external-key
    const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);
    const bundleBody: killbill.Bundle = { accountId: 'd869f861-0c60-4086-a3fc-49ad855d48c0', externalKey: 'newExternalKey2' };
    const bundleID = 'd1067966-c34f-4e93-abf7-7285582e0691';
    bundleApi.renameExternalKey(bundleBody, bundleID, 'created_by');
  1. https://killbill.github.io/slate/bundle.html#transfer-a-bundle-to-another-account

     const bundleApi: killbill.BundleApi = new killbill.BundleApi(config);
     const bundleBody: killbill.Bundle = {  accountId: '3e5e2f75-728f-4fc4-a8fc-066e7420bd69'   };
     const bundleID = 'd1067966-c34f-4e93-abf7-7285582e0691';
     bundleApi.transferBundle(bundleBody, bundleID, 'created_by');
    
  2. https://killbill.github.io/slate/bundle.html#pause-a-bundle


const bundleID = '7f5b6b8e-0936-4d6b-ab05-820632f385b0';

bundleApi.pauseBundle(bundleID, 'created_by');
  1. https://killbill.github.io/slate/bundle.html#resume-a-bundle

const bundleID = 'd1067966-c34f-4e93-abf7-7285582e0691'; 

bundleApi.resumeBundle(bundleID, 'created_by');

@reshmabidikar
Copy link
Contributor Author

reshmabidikar commented Sep 21, 2023

A similar issue occurs for the following endpoints:

  1. Trigger invoice run
  2. Commit Invoice
  3. Void Invoice
  4. Trigger Invoice Group Run

@KBbitsP
Copy link

KBbitsP commented Sep 29, 2023

Found the issue with below endpoint : https://killbill.github.io/slate/payment.html#remove-tags-from-a-payment

const paymentApi: killbill.PaymentApi = new killbill.PaymentApi(config);

const paymentId = 'bfc12b3c-0042-48c5-b233-2d8e015f49f6';

const tagDefIds = ['5071f544-c29f-47f5-a2ab-a6092c5bba74'];

paymentApi.deletePaymentTags(paymentId,'created_by',tagDefIds);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants