formie
formie copied to clipboard
Stripe: billing_cycle_anchor
Question
Is it possible to pass the 1st of the following month as billing_cycle_anchor
when using a payment field?
Thanks
Additional context
No response
Not via the UI, but you can achieve this with module code to add your own content to the payload sent to Stripe.
use verbb\formie\events\ModifyPaymentPayloadEvent;
use verbb\formie\integrations\payments\Stripe;
use yii\base\Event;
Event::on(Stripe::class, Stripe::EVENT_MODIFY_SINGLE_PAYLOAD, function(ModifyPaymentPayloadEvent $event) {
$event->payload['billing_cycle_anchor'] = '123';
});
@engram-design that event doesn't get fired...
Event::on(Stripe::class, Stripe::EVENT_MODIFY_SINGLE_PAYLOAD, function(ModifyPaymentPayloadEvent $event) {
// log the event
Craft::info('Stripe event fired', __METHOD__);
});
Nothing is being logged
The event does get triggered and have just confirmed on my end. Can you report what version of Formie you're on?
Then again, if this is for a subscription payment, that event will be a different one.
Not via the UI, but you can achieve this with module code to add your own content to the payload sent to Stripe.
use verbb\formie\events\ModifyPaymentPayloadEvent;
use verbb\formie\integrations\payments\Stripe;
use yii\base\Event;
Event::on(Stripe::class, Stripe::EVENT_MODIFY_SUBSCRIPTION_PAYLOAD, function(ModifyPaymentPayloadEvent $event) {
$event->payload['billing_cycle_anchor'] = '123';
});