Killbill-Stripe Plugin - Canadian Bank Account via Token - Error ACH payments from CA are not currently supported

119 views
Skip to first unread message

Macdonald Robinson

unread,
Jun 20, 2023, 4:57:09 PM6/20/23
to Kill Bill users mailing-list
Hi There,

I am trying to create a payment method via the killbill api using a token, the token was created using the stripe endpoint with a Canadian Bank Account, when I try to create a Payment Method I am getting the error below.

Endpoint: {{KillBillApiUrl}}/accounts/c1db6d2d-d67b-4381-b7ee-9a15c3be2e42/paymentMethods?isDefault=true

Body:
{
    "isDefault"true,
    "pluginName""killbill-stripe",
    "pluginInfo": {
        "externalPaymentMethodId"null,
        "isDefaultPaymentMethod"true,
        "properties": [
            {
                "key""token",
                "value""btok_",
                "isUpdatable"true
            }
        ]
    },
    "auditLogs": []
}

Response:
{
    "className""org.killbill.billing.payment.api.PaymentApiException",
    "code"7005,
    "message""Failed to add payment method for account c1db6d2d-d67b-4381-b7ee-9a15c3be2e42 : Error calling Stripe while adding payment method",
    "causeClassName""org.killbill.billing.payment.plugin.api.PaymentPluginApiException",
    "causeMessage""Error calling Stripe while adding payment method",
    "stackTrace": []
}

KillBill Log:
`{cause=PaymentPluginApiException{errorMessage='Error calling Stripe while adding payment method', errorType='This bank account is not a valid source for payments. Only valid sources can be attached to a customer. You can validate a bank account at creation time by passing the parameter usage='source'. The particular issue is: ACH payments from CA are not currently supported.; request-id: '}, code=7005, formattedMsg='Failed to add payment method for account c1db6d2d-d67b-4381-b7ee-9a15c3be2e42 : Error calling Stripe while adding payment method'}`

Can you please tell me how I can allow canadian bank account payments via killbill-stripe? I couldn't find any information about this, FYI I did turn on Canadian pre-authorized debits in the stripe payment methods setting:

chrome_D17iDAm3dU.png

Please note if the bank account is a US bank account it works correctly, it just doesn't work for canadian bank accounts, I am guessing it is because the ACH is not valid for canada, but I am not sure how to change it to get it to work for the Canadian PAD maybe its a setting in the plugin properties? but I couldn't find any info about this

Thanks

Pierre-Alexandre Meyer

unread,
Jun 21, 2023, 5:32:02 AM6/21/23
to Macdonald Robinson, Kill Bill users mailing-list
Looking at the following error:

  Only valid sources can be attached to a customer. You can validate a bank account at creation time by passing the parameter usage='source'

It sounds like Stripe refuses to attach the token to the customer for recurring payments. I am wondering if there is an additional step required when creating the token?

I'm not familiar with the Stripe Canadian Bank Account flow: do you have an account manager / customer success contact at Stripe who could help us understand what is missing?

--
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-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/089fb2fc-93fe-4eab-bac4-7fe6941271a1n%40googlegroups.com.


--
Pierre

Macdonald Robinson

unread,
Jun 21, 2023, 4:31:34 PM6/21/23
to Kill Bill users mailing-list
Hi,

Thanks for your response, but I don't think this has to do with the token, because the token is created correctly, with the type "bank_account". I think this is an issue / limitation with the killbill-stripe plugin, because based on the Stripe Docs: https://stripe.com/docs/payments/acss-debit/accept-a-payment

"First, create a PaymentIntent on your server and specify the amount to collect and currency (usually cad). If you already have another integration using the Payment Intents API, add acss_debit to the list of payment method types for your PaymentIntent. Specify the id of the Customer."


And I only see settings about card_, ach_ and sepa_ but nothing related to acss_debit 

Is there additional plugin properties that I need to provide besides the token to tell killbill-stripe the payment method to use? or is there another way for us to achieve this via the killbill-stripe plugin?

Thanks

Pierre-Alexandre Meyer

unread,
Jun 21, 2023, 4:55:02 PM6/21/23
to Macdonald Robinson, Kill Bill users mailing-list
I am wondering if something like this would work, based on the documentation (in bold) you sent?


I was trying to find CA test bank accounts in the Stripe docs, without luck. Do you know how to test this? Alternatively, would you be able to build/test the patch in your environment?

Macdonald Robinson

unread,
Jun 21, 2023, 6:01:27 PM6/21/23
to Kill Bill users mailing-list
Hey Pierre,

Thanks for your help on this.

The Stripe Docs do have info about setting up CA Bank accounts here: https://stripe.com/docs/connect/testing ( scroll down to the section called "Bank numbers" ) and you will see a dropdown, select Canada

You should be able to just use this Stripe API to generate the token for the CAD Bank account: 

Using Postman just make a POST request to: https://api.stripe.com/v1/tokens?bank_account[country]=CA&bank_account[currency]=CAD&bank_account[account_holder_name]=Jenny Rosen&bank_account[account_holder_type]=Individual&bank_account[routing_number]=11000-000&bank_account[account_number]=000123456789

That should return a Token that you can use for testing with the killbill-stripe plugin

Thanks!

Pierre-Alexandre Meyer

unread,
Jun 22, 2023, 3:28:28 AM6/22/23
to Macdonald Robinson, Kill Bill users mailing-list
Thanks, I can now reproduce the issue by simply creating a token and trying to attach it to a Stripe Customer (independently of Kill Bill and the plugin).

FWIW According to this comment, tokens cannot be attached to customers outside of the US: https://github.com/stripe/stripe-php/issues/817#issuecomment-561513725

Are you sure the token-based flow you are describing is supported? Can you describe how it's implemented in your current system (in case you are migrating from another system to Kill Bill)?

Macdonald Robinson

unread,
Jun 22, 2023, 12:55:12 PM6/22/23
to Kill Bill users mailing-list
Hi Pierre,

I was playing around with the Stripe Setup Intent API and was able to successfully create a Canadian Bank Account and have it attached to the customer in stripe using this setup intent API Flow:

Create Intent: 

Confirm Intent:

I then made a Payment directly through stripe and the status says "Pending" ( I am still looking into how to make it succeed )

chrome_zWY0tPpT8l.png
 
Do you know how I can do this via kill-bill stripe? I don't want to use the stripe API directly but go through killbill-stripe

Thanks!

Pierre-Alexandre Meyer

unread,
Jun 22, 2023, 1:00:01 PM6/22/23
to Macdonald Robinson, Kill Bill users mailing-list
On Thu, Jun 22, 2023 at 5:55 PM Macdonald Robinson <macon...@gmail.com> wrote:
Do you know how I can do this via kill-bill stripe? I don't want to use the stripe API directly but go through killbill-stripe

Yup, understood :-) I'm just not sure if it's supported yet or if any of our users are using this in Canada today.

Once we understand the exact sequence of operations that need to happen, we can certainly write a test and fix things in the plugin if needed!

Cheers,

--
Pierre

Macdonald Robinson

unread,
Jun 22, 2023, 2:56:25 PM6/22/23
to Kill Bill users mailing-list
Hey Pierre,

I dont think you will have customers using Bank Account from Canada since it looks like kill-bill stripe doesn't support this, but stripe for sure does, so this seems to be a limitation with the killbill-stripe plugin. I was chatting with Stripe Support on Discord ( https://discord.com/channels/841573134531821608/1121462623582556301/1121470635953115236 and https://discord.com/channels/841573134531821608/1121485444312465530

"ACH and ACSS both work fine and are available and have been for a long time"

"As it stands right now we cannot create Canadian Bank Accounts using ACSS
using kill bill stripe plugin

yeah but that's a question for that plugin right? They should be working with us instead? Or you shouldn't use them? "

So if killbill-stripe doesn't support this then it might not work for our needs as it doesn't work with Canadian Bank Accounts

Thanks

Macdonald Robinson

unread,
Jun 22, 2023, 3:33:43 PM6/22/23
to Kill Bill users mailing-list
Oh Also They were saying not to use the Token approach, but to use payment method, payment intent and setup intent APIs instead, how can we do this through killbill-stripe?
Message has been deleted

karan bansal

unread,
Jun 25, 2023, 8:40:01 AM6/25/23
to Kill Bill users mailing-list
Hi Mac,

Can you please create a customer in Stripe directly and try to attach the Canadian bank account as payment method to it and let me know if it allows you to add it OR errors out. 

Regards
Karan

Reply all
Reply to author
Forward
0 new messages