Re: [Kill Bill users] How to associate an given payment with an given invoice

109 views
Skip to first unread message

stephane brossier

unread,
Jul 13, 2018, 8:51:37 PM7/13/18
to mat...@synapseconsulting.jp, Kill Bill users mailing-list
Yes it is possible, but in `0.18` the syntax is a bit convoluted. We have just released KB `0.20`, not officially announced, and there is an easier support for the api. We have not had time yet to document the endpoint, but i can send you a pointer to the code . We should have that endpoint document in our new api doc in a couple of days i think.


On Thu, Jul 12, 2018 at 12:00 AM, <mat...@synapseconsulting.jp> wrote:
In KillBill, can I associate an given payment with an given invoice?
I want to connect these without creating payment. Is it possible?

If possible, should I use "Trigger a payment for invoice"?
https://killbill.github.io/slate/?java#trigger-a-payment-for-invoice
I tried to "trigger payment of invoice", but a payment was generated. Subsequently, when I pulled the trigger I specified paymentExternalKey of existing payment as paymentExternalKey. But I got the next error.
     "Message": "Invalid payment transition PURCHASE from state PURCHASE_SUCCESS"

If it is possible that  associating an given payment with an given invoice, I have a some questions.
(If impossible, please ignore)
· Does the status of payment transaction have an impact? It must be in pending state, etc.
·Should I use  “Trigger a payment for invoice”?
If so, can you show me the sample how to specify the following parameters?
If not, could you please advise me?


parameters of "Trigger a payment for invoice"
{
  "targetInvoiceId": "string",
  "accountId": "string",
  "paymentId": "string",
  "paymentNumber": "string",
  "paymentExternalKey": "string",
  "authAmount": 0,
  "capturedAmount": 0,
  "purchasedAmount": 0,
  "refundedAmount": 0,
  "creditedAmount": 0,
  "currency": "string",
  "paymentMethodId": "string",
  "transactions": [
    {
      "transactionId": "string",
      "transactionExternalKey": "string",
      "paymentId": "string",
      "paymentExternalKey": "string",
      "transactionType": "AUTHORIZE",
      "amount": 0,
      "currency": "AED",
      "effectiveDate": "2018-07-11T08:36:35.603Z",
      "processedAmount": 0,
      "processedCurrency": "string",
      "status": "SUCCESS",
      "gatewayErrorCode": "string",
      "gatewayErrorMsg": "string",
      "firstPaymentReferenceId": "string",
      "secondPaymentReferenceId": "string",
      "properties": [
        {
          "key": "string",
          "value": "string",
          "isUpdatable": false
        }
      ],
      "auditLogs": [
        {
          "changeType": "string",
          "changeDate": "2018-07-11T08:36:35.603Z",
          "changedBy": "string",
          "reasonCode": "string",
          "comments": "string",
          "userToken": "string"
        }
      ]
    }
  ],
  "paymentAttempts": [
    {
      "accountId": "string",
      "paymentMethodId": "string",
      "paymentExternalKey": "string",
      "transactionId": "string",
      "transactionExternalKey": "string",
      "transactionType": "AUTHORIZE",
      "effectiveDate": "2018-07-11T08:36:35.603Z",
      "stateName": "string",
      "amount": 0,
      "currency": "AED",
      "pluginName": "string",
      "pluginProperties": [
        {
          "key": "string",
          "value": "string",
          "isUpdatable": false
        }
      ],
      "auditLogs": [
        {
          "changeType": "string",
          "changeDate": "2018-07-11T08:36:35.603Z",
          "changedBy": "string",
          "reasonCode": "string",
          "comments": "string",
          "userToken": "string"
        }
      ]
    }
  ],
  "auditLogs": [
    {
      "changeType": "string",
      "changeDate": "2018-07-11T08:36:35.603Z",
      "changedBy": "string",
      "reasonCode": "string",
      "comments": "string",
      "userToken": "string"
    }
  ]
}

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/3e2c94fb-4bbe-4d59-868e-cbf6d2bd062b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mat...@synapseconsulting.jp

unread,
Jul 17, 2018, 2:13:04 AM7/17/18
to Kill Bill users mailing-list
Thank you for reply.
And sorry for my late reply.

> Yes it is possible
Do you mean the given "external" payment? In other words, recording external payment as killbill's payment and associate it with invoice?

I want to know if it is possible that connect a given payment by killbill to a given invoice (by killbill) without creating payment. Is that possible?

Thanks,
Takeshi

2018年7月14日土曜日 9時51分37秒 UTC+9 stephane brossier:

stephane brossier

unread,
Jul 17, 2018, 1:57:59 PM7/17/18
to mat...@synapseconsulting.jp, Kill Bill users mailing-list
Takeshi,

I am a bit unclear about the terminology you are using. What exactly do you mean by 'connect a given payment by killbill to a given invoice'?

Is you use you use that you have an unpaid invoice inside Kill Bill system and an external payment that happened outside of Kill Bill, and you  are trying to mark that invoice as being paid through this external payment?

Thanks for clarifying

S.
 

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.

mat...@synapseconsulting.jp

unread,
Jul 18, 2018, 5:41:03 AM7/18/18
to Kill Bill users mailing-list
Sorry for using unclear terminology.
Please let me explain a bit.

There is a unpaid invoice generated by a subscription.
There is a payment of PURCHASE_SUCCESS(payment was created and transited in during HPP payment flow ).
What I'm hoping is to connect these and to compute invoice balance.
In other words, to set payment of PURCHASE_SUCCESS against unpaid invoice.

Is it possible?

Thanks, 
Takeshi 

2018年7月18日水曜日 2時57分59秒 UTC+9 stephane brossier:

stephane brossier

unread,
Jul 18, 2018, 1:00:33 PM7/18/18
to mat...@synapseconsulting.jp, Kill Bill users mailing-list
Takeshi,

We don't have a way to link an arbitrary existing Payment to an existing (unpaid) Invoice. 
However, at the time you create the Payment, you can specify that this Payment is for a particular (unpaid) Invoice. The api is described here.

Let me know if that helps,

Stéphane

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.

mat...@synapseconsulting.jp

unread,
Jul 19, 2018, 3:58:57 AM7/19/18
to Kill Bill users mailing-list
Stéphane,
Thank you for reply. 

Your advice help me.
At last, Please let me question about invoice-payment behaviour.

Does payment reflect on Invoice 's balance if i go through the below process?
1. Generate payment against unpaid invoice (trigger-a-payment-for-invoice )
2. Keep the status of the payment transaction in pending state
3. Later, set status of the payment transaction successful.

I found almost the same question and answer below,
(Question regarding state of unpaid invoice after POST /1.0/kb/paymentTransactions
https://groups.google.com/forum/#!searchin/killbilling-users/invoice$20payment$20pending%7Csort:relevance/killbilling-users/lj-MumZaHVs/7R3gQajTAwAJ )
but I did not know if this was trigger-a-payment-for-invoice issue, so I asked a question.

Thanks,  
Takeshi  

2018年7月19日木曜日 2時00分33秒 UTC+9 stephane brossier:

stephane brossier

unread,
Jul 19, 2018, 2:00:59 PM7/19/18
to mat...@synapseconsulting.jp, Kill Bill users mailing-list
On Thu, Jul 19, 2018 at 12:58 AM, <mat...@synapseconsulting.jp> wrote:
Stéphane,
Thank you for reply. 

Your advice help me.
At last, Please let me question about  invoice-payment behaviour.

Does payment reflect  on Invoice 's balance if i go through the below process?
1. Generate payment against unpaid invoice (trigger-a-payment-for-invoice )
2. Keep the status of the payment transaction in pending state
3. Later, set status of the payment transaction successful.

Yes. As the final transition occurs, the balance on the invoice will reflect the (successful) payment.

I found almost the same question and answer below,
(Question regarding state of unpaid invoice after POST /1.0/kb/paymentTransactions
 https://groups.google.com/forum/#!searchin/killbilling-users/invoice$20payment$20pending%7Csort:relevance/killbilling-users/lj-MumZaHVs/7R3gQajTAwAJ )
but I did not know if this was trigger-a-payment-for-invoice issue, so I asked a question.

Thanks,  
Takeshi  

2018年7月19日木曜日 2時00分33秒 UTC+9 stephane brossier:
> Takeshi,
>
>
> We don't have a way to link an arbitrary existing Payment to an existing (unpaid) Invoice. 
>
> However, at the time you create the Payment, you can specify that this Payment is for a particular (unpaid) Invoice. The api is described here.
>
>
>
> Let me know if that helps,
>
>
> Stéphane
>

--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.

mat...@synapseconsulting.jp

unread,
Jul 20, 2018, 12:05:18 AM7/20/18
to Kill Bill users mailing-list
Stéphane, 
Thank you very much for your answer.
I understand.

Thanks,   
Takeshi   

2018年7月20日金曜日 3時00分59秒 UTC+9 stephane brossier:
Reply all
Reply to author
Forward
0 new messages