Freeform Freeform for Craft

Developer

Stripe Payment Events

To extend Freeform's Stripe Payments, use the events listed below:

When updating Payment metadata 5.1.9+

This event lets you add your own data that gets sent to Stripe for Payment Intents and Subscriptions:

use Solspace\Freeform\Integrations\PaymentGateways\Stripe;
use Solspace\Freeform\Integrations\PaymentGateways\Events\UpdateMetadataEvent;

Event::on(
  Stripe::class,
  Stripe::EVENT_UPDATE_PAYMENT_METADATA,
  function (UpdateMetadataEvent $event) {
    $event->addData('description', 'My custom payment intent description');
    $event->addData('custom metadata entry', 'Some more data to be persisted in metadata');
  }
)
1
2
3
4
5
6
7
8
9
10
11

When updating Subscription data

This event lets you add your own data that gets sent to Stripe for Subscriptions:

use Solspace\Freeform\Integrations\PaymentGateways\Stripe;
use Solspace\Freeform\Events\Payments\UpdateDataEvent;

Event::on(
  Stripe::class,
  Stripe::EVENT_UPDATE_SUBSCRIPTION_DATA,
  function (UpdateDataEvent $event) {
    $event->addData('description', 'My custom subscription description');
  }
)
1
2
3
4
5
6
7
8
9
10