First confirmation of a payment in a subscription

Hello!

So once I’ve created a subscription and I’ve received the various webhooks invocations, e.g. in this order:

CUSTOMER_SUBSCRIPTION_NEW_CYCLE,
INVOICE_CREATED,
CUSTOMER_SUBSCRIPTION_CREATED,
(3 minutes later) INVOICE_PAYMENT_CREATED,
PAYMENT_SUCCEEDED,
INVOICE_FINALIZED,
(7 minutes later) PAYMENT_COMPLETED,
INVOICE_PAYMENT_SUCCEEDED

When the customer signs up for a subscription the first time, I’d rather want the funds withdrawn within a few seconds, just like with the CheckoutPage implementation (that I also have for one-off purchases).

Should I be doing something to push this faster through (like e.g. finalizing the invoice, completing the payment?)

Or is this related to the test environment?

Or am I missing something entirely?

Thanks!

I just tried this. After creating the product and plan, I created a subscription (with no free trial period), and I got the following webhooks:

  • CUSTOMER_SUBSCRIPTION_NEW_CYCLE
  • INVOICE_CREATED
  • CUSTOMER_SUBSCRIPTION_CREATED

4 seconds later, I got these:

  • INVOICE_FINALIZED
  • PAYMENT_COMPLETED
  • PAYMENT_SUCCEEDED
  • INVOICE_PAYMENT_SUCCEEDED
  • INVOICE_PAYMENT_CREATED

Try it again and let me know what you get.

1 Like

Hello Charles and thank you for the reply.

So I’ve tried this again and I can see a pattern in this… there seems to be a batch run on Rapyds side every 15 minutes or so where the secondary batch of webhooks are sent:

INVOICE_PAYMENT_CREATED,
PAYMENT_SUCCEEDED,
INVOICE_FINALIZED,
PAYMENT_COMPLETED,
INVOICE_PAYMENT_SUCCEEDED

I’m getting notified pretty consistently every 15 minutes at
HH:03:43,
HH:18:43,
HH:33:43 and
HH:48:43

All the replies get batched up and delivered at these times.

So I’m wondering if you were perhaps simply lucky when you performed this? Can you try this a couple of times and see if you get this consistently?

I’ve tried different currencies and amounts with same results. I wonder if I might be doing something that could be causing this delay?

1 Like

I got the same behavior you did. I then tried β€˜Complete a Cycle’ (a sandbox method) to see what happens, and I think that will do what you want it to. You can also test the various β€˜invoice’ methods.

I hope this helps. Let me know if you need anything else, and good luck with your project :medal_sports:

1 Like