PHPackages                             spryker-eco/stripe - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. spryker-eco/stripe

ActiveLibrary[Payment Processing](/categories/payments)

spryker-eco/stripe
==================

Stripe module

1.0.3(1w ago)036.7k1proprietaryPHPPHP &gt;=8.3CI passing

Since Apr 16Pushed 2mo agoCompare

[ Source](https://github.com/spryker-eco/stripe)[ Packagist](https://packagist.org/packages/spryker-eco/stripe)[ RSS](/packages/spryker-eco-stripe/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (56)Versions (6)Used By (1)

Stripe Module
=============

[](#stripe-module)

[![Latest Stable Version](https://camo.githubusercontent.com/7f93b9186d96dc156f3df15099c263bbd8736c1a90ddc2f7b46d3fe281155de5/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722d65636f2f7374726970652f762f737461626c652e737667)](https://packagist.org/packages/spryker-eco/stripe)[![Minimum PHP Version](https://camo.githubusercontent.com/9c50dc780fa576f5c39b4feff00c05345c1471be0808881a09e750b91220dc54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e332d3838393242462e737667)](https://php.net/)

Integration
-----------

[](#integration)

### Step 1: Install the package

[](#step-1-install-the-package)

```
composer require spryker-eco/stripe
```

---

### Step 2: Remove old ACP MessageBroker plugins (if any)

[](#step-2-remove-old-acp-messagebroker-plugins-if-any)

**File:** `src/Pyz/Zed/MessageBroker/MessageBrokerDependencyProvider.php`

Remove these imports and their instantiations from `getMessageHandlerPlugins()`:

```
// Remove these use statements:
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentMethodMessageHandlerPlugin;
use Spryker\Zed\Payment\Communication\Plugin\MessageBroker\PaymentOperationsMessageHandlerPlugin;
use Spryker\Zed\PaymentApp\Communication\Plugin\MessageBroker\PaymentAppOperationsMessageHandlerPlugin;
use Spryker\Zed\SalesPaymentDetail\Communication\Plugin\MessageBroker\SalesPaymentDetailMessageHandlerPlugin;
use Spryker\Zed\MerchantApp\Communication\Plugin\MessageBroker\MerchantAppOnboardingMessageHandlerPlugin;
```

---

### Step 3: Update OMS configuration

[](#step-3-update-oms-configuration)

**File:** `config/Shared/config_default.php`

Add the Stripe OMS process location and activate the state machine:

```
$config[OmsConstants::PROCESS_LOCATION] = [
    OmsConfig::DEFAULT_PROCESS_LOCATION,
    APPLICATION_ROOT_DIR . '/vendor/spryker-eco/stripe/config/Zed/oms', // Add this line
];

$config[OmsConstants::ACTIVE_PROCESSES] = [
    // Replace ForeignPaymentStateMachine01 and ForeignPaymentB2CStateMachine01 with the Stripe process
    'StripeManual01', // or StripeManualMarketplace01 for marketplace projects
];

$config[SalesConstants::PAYMENT_METHOD_STATEMACHINE_MAPPING] = [
    \SprykerEco\Shared\Stripe\StripeConfig::PAYMENT_PROVIDER_NAME => 'StripeManual01', // or StripeManualMarketplace01 for marketplace projects
];
```

---

### Step 4: Register Stripe OMS command and condition plugins

[](#step-4-register-stripe-oms-command-and-condition-plugins)

**File:** `src/Pyz/Zed/Oms/OmsDependencyProvider.php`

Add Stripe command plugins to `extendCommandPlugins()`:

```
use SprykerEco\Zed\Stripe\Communication\Plugin\Oms\Command\StripeCancelCommandPlugin;
use SprykerEco\Zed\Stripe\Communication\Plugin\Oms\Command\StripeCaptureCommandPlugin;
use SprykerEco\Zed\Stripe\Communication\Plugin\Oms\Command\StripeRefundCommandPlugin;

// In extendCommandPlugins():
$commandCollection->add(new StripeCaptureCommandPlugin(), 'Stripe/Capture');
$commandCollection->add(new StripeRefundCommandPlugin(), 'Stripe/Refund');
$commandCollection->add(new StripeCancelCommandPlugin(), 'Stripe/Cancel');

// ----- for Marketplace only
$commandCollection->add(new MerchantPayoutCommandByOrderPlugin(), 'SalesPaymentMerchant/Payout');
$commandCollection->add(new MerchantPayoutReverseCommandByOrderPlugin(), 'SalesPaymentMerchant/ReversePayout');
```

> **Note:** `StripeCaptureCommandPlugin` always captures the full authorized amount regardless of which items are in the OMS batch. Stripe allows only one capture per PaymentIntent — any remaining uncaptured amount is automatically released after the first capture. Items canceled after capture are handled via refunds.

Also add payment conditions to `extendConditionPlugins()`:

```
// In extendConditionPlugins():
$conditionCollection->add(new IsPaymentAppPaymentStatusAuthorizationFailedConditionPlugin(), 'Payment/IsAuthorizationFailed');
$conditionCollection->add(new IsPaymentAppPaymentStatusAuthorizedConditionPlugin(), 'Payment/IsAuthorized');
$conditionCollection->add(new IsPaymentAppPaymentStatusCanceledConditionPlugin(), 'Payment/IsCanceled');
$conditionCollection->add(new IsPaymentAppPaymentStatusCancellationFailedConditionPlugin(), 'Payment/IsCancellationFailed');
$conditionCollection->add(new IsPaymentAppPaymentStatusCapturedConditionPlugin(), 'Payment/IsCaptured');
$conditionCollection->add(new IsPaymentAppPaymentStatusCaptureFailedConditionPlugin(), 'Payment/IsCaptureFailed');
$conditionCollection->add(new IsPaymentAppPaymentStatusCaptureRequestedConditionPlugin(), 'Payment/IsCaptureRequested');
$conditionCollection->add(new IsPaymentAppPaymentStatusOverpaidConditionPlugin(), 'Payment/IsOverpaid');
$conditionCollection->add(new IsPaymentAppPaymentStatusUnderpaidConditionPlugin(), 'Payment/IsUnderpaid');
$conditionCollection->add(new IsPaymentAppPaymentStatusRefundedConditionPlugin(), 'Payment/IsRefunded');
$conditionCollection->add(new IsPaymentAppPaymentStatusRefundFailedConditionPlugin(), 'Payment/IsRefundFailed');

// ------- for Marketplace only
$conditionCollection->add(new IsMerchantPaidOutConditionPlugin(), 'SalesPaymentMerchant/IsMerchantPaidOut');
$conditionCollection->add(new IsMerchantPayoutReversedConditionPlugin(), 'SalesPaymentMerchant/IsMerchantPayoutReversed');
```

---

### Step 5: Register the Stripe payout transmission plugin (marketplace only)

[](#step-5-register-the-stripe-payout-transmission-plugin-marketplace-only)

**File:** `src/Pyz/Zed/SalesPaymentMerchant/SalesPaymentMerchantDependencyProvider.php`

Register `StripePayoutTransmissionPlugin` so the `SalesPaymentMerchant` module routes merchant payouts and payout reversals through direct Stripe Connect API calls:

```
use SprykerEco\Zed\Stripe\Communication\Plugin\SalesPaymentMerchant\StripePayoutTransmissionPlugin;

// In getMerchantPayoutTransmissionPlugins():
return [
    new StripePayoutTransmissionPlugin(),
];
```

The OMS subprocesses `StripeMerchantPayout01.xml` and `StripeMerchantPayoutReverse01.xml` use the generic `SalesPaymentMerchant/Payout` and `SalesPaymentMerchant/ReversePayout` commands. `StripePayoutTransmissionPlugin` intercepts those commands and executes Stripe Connect transfers (forward payouts) or transfer reversals (payout reversals) directly via the Stripe API.

---

### Step 6: Register Stripe checkout post-save plugin

[](#step-6-register-stripe-checkout-post-save-plugin)

**File:** `src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php`

```
use SprykerEco\Zed\Stripe\Communication\Plugin\Checkout\StripeCheckoutPostSavePlugin;

// In getCheckoutPostHooks():
new StripeCheckoutPostSavePlugin(),
```

---

### Step 7: Register Stripe Yves checkout plugins

[](#step-7-register-stripe-yves-checkout-plugins)

**File:** `src/Pyz/Yves/CheckoutPage/CheckoutPageDependencyProvider.php`

```
use SprykerEco\Shared\Stripe\StripeConfig as SharedStripeConfig;
use SprykerEco\Yves\Stripe\Plugin\StepEngine\StripeStepHandlerPlugin;
use SprykerEco\Yves\Stripe\Plugin\StepEngine\StripeSubFormPlugin;

// In extendPaymentMethodHandler():
$paymentMethodHandler->add(new StripeStepHandlerPlugin(), SharedStripeConfig::PAYMENT_METHOD_NAME);

// In extendSubFormPluginCollection():
$paymentSubFormPluginCollection->add(new StripeSubFormPlugin());
```

---

### Step 8: Register payment method filter plugin (optional)

[](#step-8-register-payment-method-filter-plugin-optional)

Only required if you need custom filtering logic, for example, to hide Stripe or other payment methods based on the Quote. Extend `StripePaymentMethodFilterPlugin` with your filtering logic.

**File:** `src/Pyz/Zed/Payment/PaymentDependencyProvider.php`

```
use SprykerEco\Zed\Stripe\Communication\Plugin\Payment\StripePaymentMethodFilterPlugin;

// In getPaymentMethodFilterPlugins():
new StripePaymentMethodFilterPlugin(),
```

---

### Step 9: Register Stripe routes

[](#step-9-register-stripe-routes)

**File:** `src/Pyz/Yves/Router/RouterDependencyProvider.php`

```
use SprykerEco\Yves\Stripe\Plugin\Router\StripeRouteProviderPlugin;

// In getRouteProvider():
new StripeRouteProviderPlugin(),
```

---

### Step 10: Add Stripe payment form to the checkout payment template

[](#step-10-add-stripe-payment-form-to-the-checkout-payment-template)

**File:** `src/Pyz/Yves/CheckoutPage/Theme/default/views/payment/payment.twig`

Add the Stripe form entry to the `customForms` map:

```
{% define data = {
    customForms: {
        'Payone/credit_card': ['credit-card', 'payone'],
        'Stripe/stripe': ['stripe'],
    },
} %}
```

---

### Step 11: Register the marketplace installer plugin (marketplace only)

[](#step-11-register-the-marketplace-installer-plugin-marketplace-only)

**File:** `src/Pyz/Zed/Installer/InstallerDependencyProvider.php`

```
use SprykerEco\Zed\Stripe\Communication\Plugin\Installer\StripeMarketplaceInstallerPlugin;

// In getInstallerPlugins():
new StripeMarketplaceInstallerPlugin(),
```

---

### Step 12: Allow Stripe controllers in the Merchant Portal security config (marketplace only)

[](#step-12-allow-stripe-controllers-in-the-merchant-portal-security-config-marketplace-only)

By default, Merchant Portal rejects all routes that do not match the portal pattern. The `/stripe/*` endpoint must be excluded from authentication.

**File:** `src/Pyz/Zed/SecurityMerchantPortalGui/SecurityMerchantPortalGuiConfig.php`

```
