Skip to 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:

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

Data Flow ​

View diagram source
sequenceDiagram
    participant CUST as Customer
    participant MAG as Magento Checkout
    participant STRIPE as Stripe API
    participant API as StripeApi
    participant DB as Database

    CUST->>MAG: Submit payment
    MAG->>STRIPE: Create PaymentIntent
    STRIPE-->>MAG: Confirm payment
    STRIPE->>API: Webhook (payment_intent.succeeded)
    API->>DB: Record transaction

Diagram

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 ​

View diagram source
sequenceDiagram
    participant SVC as Logidav
    participant API as StripeApi
    participant STRIPE as Stripe API

    SVC->>API: initiateRefund(transactionId, amount)
    API->>STRIPE: POST /refunds
    STRIPE-->>API: Refund confirmation
    API->>SVC: Update transaction status

Diagram

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

Webhook verification

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

Internal developer documentation for Menzzo systems.