"Encrypted data used outside of valid time period error" while using killbill-adyen plugin

1,088 views
Skip to first unread message

saikrri...@gmail.com

unread,
May 22, 2017, 3:09:59 PM5/22/17
to Kill Bill users mailing-list
Hi,
I am using killbill-adyen plugin for integration with Adyen.

I am getting "Encrypted data used outside of valid time period error" from payment gateway while I am trying to subscribe to a product.
The "card.encrypted.json" is generated and added as a payment method to a user(24 hours ago). The Adyen states that "card.encrypted.json" is only valid for the 24 hours.

When the "card.encrypted.json" is added as a payment method to a user:
Can this user be able to subscribe to a plan and get his invoices settled every month?
If so, how is it handled because the "card.encrypted.json" is valid only for the first 24 hours.

If not, is there any way from killbill-adyen plugin to allow a user to subscribe to a plan and get his invoices settled every month?

Thank you for your support,
Sai


Pierre-Alexandre Meyer

unread,
May 22, 2017, 3:58:35 PM5/22/17
to saikrishna chunchu, Kill Bill users mailing-list
Hello,

On Mon, May 22, 2017 at 12:09 PM, <saikrri...@gmail.com> wrote:
I am getting "Encrypted data used outside of valid time period error" from payment gateway while I am trying to subscribe to a product.
The "card.encrypted.json" is generated and added as a payment method to a user(24 hours ago). The Adyen states that "card.encrypted.json" is only valid for the 24 hours.

Did you trigger a payment (e.g. $1 auth voided right away) upon payment method creation? Can you verify the recurring contract has been added in the backoffice?

Unlike other gateways, Adyen requires a payment to tokenize the card, see this example:

 
--
Pierre

saikrri...@gmail.com

unread,
May 22, 2017, 5:52:09 PM5/22/17
to Kill Bill users mailing-list, saikrri...@gmail.com
Yes,
I added a paymentMethod to a user by passing "card.encrypted.json" that is generated by using adyen's JS.
I subscribed to a plan. The payment is successful.
After couple of days, I subscribed to a another plan. That is when I am seeing the error "Encrypted data used outside of valid time period error". When I checked with Adyen, they mentioned that the "card.encrypted.json" is valid only for 24 hours.


When I subscribed to a plan, will it create a recurring contract in Adyen?
Is it specific to Adyen or is that how handled with the other payment gateways as well(e.g. Stripe)?

The payment tab of kaui
16 2017-05-22 $0 $0 $0 PLUGIN_FAILURE
15 2017-05-20 $451.61 $451.61 $0 SUCCESS

Pierre-Alexandre Meyer

unread,
May 23, 2017, 2:11:35 AM5/23/17
to saikrishna chunchu, Kill Bill users mailing-list
On Mon, May 22, 2017 at 2:52 PM, <saikrri...@gmail.com> wrote:
I added a paymentMethod to a user by passing "card.encrypted.json" that is generated by using adyen's JS.

Simply creating the payment method isn't enough, you need to trigger a real payment then call the "refresh" payment methods API to sync the recurring token, that will be used for subsequent payments:
When I checked with Adyen, they mentioned that the "card.encrypted.json" is valid only for 24 hours.

Yes, the blob can only be used for the first payment typically. Subsequent payments need a recurring contract. 
 
Is it specific to Adyen or is that how handled with the other payment gateways as well(e.g. Stripe)?

It is an Adyen-specific behavior. Other gateways typically have a "tokenization" API that is triggered outside the payment flow (called during addPaymentMethod, see https://github.com/killbill/killbill-litle-demo/blob/f63898e51bc77b8f71a710eb9a1788f8fc2cac66/app.rb#L37-L43 for instance). Adyen, on the other hand, requires a real payment to tokenize (hence my suggestion to auth $1 and void it right away).

--
Pierre
Message has been deleted

Pierre-Alexandre Meyer

unread,
May 26, 2017, 4:07:39 PM5/26/17
to saikrishna chunchu, Kill Bill users mailing-list
On Wed, May 24, 2017 at 1:42 PM, <saikrri...@gmail.com> wrote:
Before calling this API, payment method(adyen's encrypted card json) is added to the user

This is not how the flow works.

I've added some more detailed cURLs to the README (https://github.com/killbill/killbill-adyen-plugin#client-side-encryption-cse) but I highly encourage you to run and get familiar with the demo first (https://github.com/killbill/killbill-adyen-demo).

--
Pierre

saikrri...@gmail.com

unread,
May 29, 2017, 9:49:32 PM5/29/17
to Kill Bill users mailing-list, saikrri...@gmail.com

I figured out the flow from the demo(I forgot to update about it here ). It is working for me now.
Thank you Pierre for updating README, it is definitely going to be helpful for others.

Adyen team mentioned that, an authorization can also be created for $0 in order to generate recurringDetailId(recurringDetailReference).

Thanks,
Sai

Pierre-Alexandre Meyer

unread,
May 30, 2017, 5:46:37 AM5/30/17
to saikrishna chunchu, Kill Bill users mailing-list
On Tue, May 30, 2017 at 2:49 AM, <saikrri...@gmail.com> wrote:
I figured out the flow from the demo(I forgot to update about it here ). It is working for me now.
Thank you Pierre for updating README, it is definitely going to be helpful for others.

👍 

Adyen team mentioned that, an authorization can also be created for $0 in order to generate recurringDetailId(recurringDetailReference).

Ah great, I didn't know it was supported now.

--
Pierre
Reply all
Reply to author
Forward
0 new messages