Skip to main content

Stripe Integration

Stripe is used for processing card payments. The integration handles payment capture, webhook events, and refund processing.

Components

ComponentFileRole
StripeApisrc/CoreBundle/Api/StripeApi.phpStripe API client

Configuration

Required parameters in parameters.yml:

stripe:
secret_key: "sk_..."
publishable_key: "pk_..."
webhook_secret: "whsec_..."

Data Flow

Payment Flow

  1. The customer completes checkout on the Magento front-end
  2. Magento creates a Stripe PaymentIntent
  3. Stripe processes the card and confirms the payment
  4. A webhook notifies Logidav of the successful transaction
  5. StripeApi records the transaction in the database

Refund Flow

Error Handling

ScenarioBehavior
Card declinedStatus recorded; order remains pending
Webhook signature invalidRequest rejected; logged as security event
Partial refund failureAlert raised; manual review required
API timeoutRetry with exponential backoff

:::warning Webhook verification Always verify the webhook signature using the webhook_secret. Unverified webhooks should be rejected to prevent fraudulent transaction confirmations. :::