OMS configuration for Stripe

Edit on GitHub

The complete default payment OMS configuration is available at vendor/spryker-eco/stripe/config/Zed/oms/StripeManual01.xml. For marketplace projects, use StripeManualMarketplace01.xml from the same location.

The payment flow of the default OMS involves authorizing the initial payment. The amount is temporarily blocked when the payment method permits. Then, the OMS sends requests to capture, that is, transfer of the previously blocked amount from the customer’s account to the store account.

The Stripe/Capture command initiates the capture action. By default, this command is initiated when a Back Office user clicks Ship on the Order Overview page.

Capture behavior

StripeCaptureCommandPlugin always captures the full authorized amount. Stripe allows only one capture per PaymentIntent. Items canceled after capture are handled via refunds using the Stripe/Refund command.

Optionally, you can change and configure your own payment OMS based on StripeManual01.xml from the eco package and change this behavior according to your business flow. For more information about OMS configuration, see Install the Order Management feature.

To configure your payment OMS based on StripeManual01.xml, copy StripeManual01.xml with the Subprocess folder to the project root config/Zed/oms. Then, change the file’s name and the value of <process name= in the file.

The following example shows how to configure the order state machine transition from ready for dispatch to payment capture pending:

State machine example
<?xml version="1.0"?>
<statemachine
        xmlns="spryker:oms-01"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="spryker:oms-01 https://static.spryker.com/oms-01.xsd"
>

   <process name="SomeProjectProcess" main="true">

      <!-- other configurations -->

      <states>

         <!-- other states -->

         <state name="payment capture pending" display="oms.state.in-progress"/>

         <!-- other states -->

      </states>

      <transitions>

         <!-- other transitions -->

         <transition happy="true">
            <source>ready for dispatch</source>
            <target>payment capture pending</target>
            <event>capture payment</event>
         </transition>

         <!-- other transitions -->

      </transitions>

      <events>

         <!-- other events -->

         <event name="capture payment" onEnter="true" command="Stripe/Capture"/>

         <!-- other events -->

      </events>

   </process>

</statemachine>

By default, the timeout for the payment authorization action is set to seven days. If the order is in the payment authorization pending state, after a day the order state is changed to payment authorization failed. Another day later, the order is transitioned to the payment authorization canceled state.

To decrease or increase timeouts or change the states, update config/Zed/oms/Subprocess/PaymentAuthorization01.xml.