Developer tools
Plugins
Mirakl
Payments

Payments

Learn how to accept payments when using the Mirakl Connector.

Accepting payments

Stripe recommends implementing separate charges and transfers for marketplaces powered by Mirakl to allow multiple sellers to get paid with one transaction and according to the schedule set by the Operator within Mirakl.

Here is the workflow for accepting payments:

  1. Create a Mirakl Order via OR01 as usual.

  2. Collect the customer’s payment method and create a payment.

You can choose from Stripe’s large offering of payment methods: card payments, digital wallets, bank debits & transfers and local payment methods

  1. Update the Mirakl Order via PA01.

We recommend that you set the Mirakl order.transaction_number attribute to the Stripe charge.id value.

  1. You or the connector create a Transfer for each Mirakl sub-Order.

See below for more information regarding the built-in Transfers feature.

Built-in transfers

Set ENABLES_AUTOMATIC_TRANSFER_CREATION=true in your environment file to enable this feature.

  1. The transfers job fetches newly created Mirakl Orders via OR11.

When testing you can trigger the job manually on a specific Mirakl Order:

bin/console connector:dispatch:process-transfer <ORDER_ID> -e prod
  1. For every new order, the connector creates a StripeTransfer record with status=TRANSFER_PENDING and a new ProcessTransfer message is added to the queuing system.
  1. ProcessTransfer messages are consumed. The connector attempts to create the Transfer on Stripe.

If order.transaction_number is set to the charge.id as recommended, the transfer.source_transaction is also set to that value.

The miraklId (order ID) and miraklShopId are added to the Transfer metadata so you can track each money movement.

  1. The StripeTransfer record is updated to either a successful or failed status. Failed Transfers are attempted again three times.

Built-in refunds

Set ENABLES_AUTOMATIC_REFUND_CREATION=true in your environment file to enable this feature.

  1. The refunds job fetches pending Mirakl Refunds via PA12.

When testing you can trigger the job manually:

bin/console connector:dispatch:process-transfer -e prod
  1. For every pending refund, the connector creates a StripeRefund record with status=REFUND_PENDING and a new ProcessRefund message is added to the queuing system.
  1. ProcessRefund messages are consumed. The connector attempts to create the Refund on Stripe.
  1. The StripeRefund record is updated to either a successful or failed status. Failed Refunds are attempted again three times. On success, the Mirakl Refund is updated via PA02.

Alerting

Once a day, the alerting job sends an email with all failed operations along with the reason.

Next step

Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.