Search by

mihai-stana / spryker-paypal

mihaistana

Direct PayPal (Orders v2) payment integration for Spryker Commerce OS: Yves, Glue and Storefront API, OMS, webhooks, refunds, authorize/capture and PayPal Express.

Package info

github.com/mihaistana/spryker-paypal

pkg:composer/mihai-stana/spryker-paypal

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.2 2026-12-03 16:08 UTC

This package is auto-updated.

Last update: 2026-12-03 16:10:05 UTC


README

Direct PayPal integration for Spryker Commerce OS on the PayPal Orders v2 API, installable with composer. It covers the Yves storefront, the legacy Glue REST API and the Storefront API (API Platform).

This is an independent open source package. It is not affiliated with Spryker or PayPal.

Features

  • Redirect checkout: the buyer approves on PayPal and comes back to the shop; Yves and headless (Glue).
  • PayPal Express: PayPal buttons on the cart page (JS SDK). Email, name and shipping address come from PayPal and the checkout continues at the shipment step. Also headless for customer and guest carts.
  • Pay Later: Pay Later button and PayPal's Pay Later messages on product and cart pages.
  • Capture or authorize: intent CAPTURE, or AUTHORIZE with capture and void from the Back Office (OMS).
  • Refunds per order item from the OMS.
  • Webhooks verified with PayPal's signature API, stored once per event, always answered with HTTP 200; on Yves or on the Glue Storefront API for shops without a public Yves.
  • Two OMS processes (PaypalCapture01, PaypalAuthorize01) with a synchronization fallback for buyers who never return from PayPal.
  • Safe by design: idempotent PayPal calls (PayPal-Request-Id), payments are never captured twice or after they failed, Express orders are bound to their cart, the secret never leaves Zed, API logs mask credentials and payment data.

Not included: card fields (Advanced Credit and Debit Card Payments), vaulting, Venmo and other alternative payment methods, subscriptions, the Merchant Portal.

Compatibility

Spryker release PHP Status
202610.0 8.4 Tested end to end against the PayPal sandbox (b2c demo shop: Yves, Glue, Express, Pay Later, webhooks, refunds)
202512.0 8.3, 8.4 Installs without changing the release's locked versions; not run end to end
  • Storefront API resource: optional spryker/api-platform, tested with 1.51.1 on 202610.0.
  • Glue Storefront webhook route: needs the GlueStorefrontApiApplication, present since 202512.
  • Older releases are not supported: the module uses typed class constants (PHP 8.3) and Spryker's Storefront API kernel classes.

Installation

composer require mihai-stana/spryker-paypal
// config/Shared/config_default.php
$config[KernelConstants::CORE_NAMESPACES][] = 'MihaiStana';

$config[\MihaiStana\Shared\Paypal\PaypalConstants::CLIENT_ID] = getenv('SPRYKER_PAYPAL_CLIENT_ID') ?: '';
$config[\MihaiStana\Shared\Paypal\PaypalConstants::CLIENT_SECRET] = getenv('SPRYKER_PAYPAL_CLIENT_SECRET') ?: '';
$config[\MihaiStana\Shared\Paypal\PaypalConstants::ENVIRONMENT] = getenv('SPRYKER_PAYPAL_ENVIRONMENT') ?: 'sandbox';

Then wire the plugins for the frontends you use, import the payment method and activate an OMS process: INTEGRATION.md walks through every step, with verification and troubleshooting.

How it works

Buyer ──► Yves / Glue ──► Zed (Paypal module) ──► PayPal Orders v2 API
             │                 │   ▲
             │                 │   └── webhooks (Yves or Glue Storefront) ── PayPal
             │                 └── OMS: capture / void / refund / sync
             └── /paypal/return or POST /order-payments completes the payment
  • The PayPal client and the secret live in Zed only; Yves and Glue talk to Zed through the module's client.
  • The PayPal order is created when the order is placed (redirect) or from the cart (Express). The amount sent to PayPal is always the order total, with items, shipping, handling and discount balanced to it.
  • Payments are completed by whichever comes first: the buyer's return, a webhook, or the OMS synchronization after one hour. All three are idempotent.
  • Tables: spy_msp_paypal_payment, spy_msp_paypal_payment_transaction (every PayPal call with status and error), spy_msp_paypal_webhook_event.

Development

The package needs a Spryker project to run its tests (generated transfers and Propel classes). It is developed against a b2c demo shop with the repository mounted as a composer path repository:

docker/sdk cli vendor/bin/codecept run -c vendor/mihai-stana/spryker-paypal
docker/sdk cli vendor/bin/phpstan analyse -c <phpstan config including the package> --level 8
composer cs-check   # in this repository

CI runs composer validation, a syntax check on PHP 8.3 and 8.4, the code style check and a lowest-dependencies install.

See CHANGELOG.md for the release history.

Credits

Scaffolded from spryker-community/payment-template (MIT).

License

MIT, see LICENSE.