hps-plugin-payment-paypal
By Hyperse
hps-plugin-payment-paypal is a Payment Paypal plugin in the Hub Pay group.hps-plugin-payment-paypal provides Payment Paypal plugin capabilities for Hub Pay. Payments, billing, invoicing, and money-related capabilities. It is especially useful for payment workflows.
CoreVendure Plugins
Specifications
Technical details and package information for this product.
Package
@hyperse-hub/hps-plugin-payment-paypal
Support languages
TypeScript, JavaScript, Prolog, Shell, CSS
Last published
July 13, 2026
@hyperse-hub/hps-plugin-payment-paypal
PayPal payment integration for Vendure: payment method handler, REST webhook, and Shop API mutations that work with @hyperse-hub/hps-plugin-payment-core shared flows.
1. Overview
- Vendure payment handler — Registers handler code
paypal-payment-provider with Admin-configurable args (sandbox, brand, OAuth credentials, optional publishable key).
- Webhook-driven settlement — PayPal notifies your server; the controller verifies the event and completes the order payment path in line with Vendure’s order state machine.
- Storefront — Creates a PayPal-side payment intent via GraphQL, then uses Vendure’s standard
addPaymentToOrder and optionally refreshPaymentStatus from the core plugin for polling.
2. Requirements
- Vendure
>= 3.0.0
- Node.js
>= 20
@hyperse-hub/hps-plugin-payment-core (installed transitively when you add this package)
3. Install
yarn add @hyperse-hub/hps-plugin-payment-paypal
4. Vendure registration
import { HpsPluginPaymentPaypal } from '@hyperse-hub/hps-plugin-payment-paypal'
HpsPluginPaymentCore is imported by this plugin; you do not need to register the core plugin separately unless you rely on it for other custom code.
5. Key concepts
5.1 Payment method configuration (Admin)
Create a PaymentMethod in the Admin UI using the PayPal handler. Configure:
- Sandbox — Use PayPal sandbox for non-production.
- Client credentials — Client ID and secret from the PayPal developer dashboard.
- Brand name — Shown in PayPal checkout where applicable.
- Publishable key (optional) — Exposed to the storefront for client-side SDK usage; see Shop API below.
Store any extra JSON the storefront needs in PaymentMethod.customFields.clientConfig (core plugin); the core resolves PaymentMethodQuote.clientConfig for GraphQL quotes.
5.2 HTTP endpoint
- Webhook / payment notification —
POST /payment/paypal
Configure the same URL in the PayPal developer app so capture and completion events reach Vendure. Signature headers are validated by the controller.
5.3 Shop GraphQL
createPaypalPaymentIntent — Mutation (authenticated customer, active order). Returns a PayPal transaction identifier used to drive the JS SDK or redirect flow.
PaymentMethodQuote.paypalPublishableKey — Resolves the optional publishable key from the payment method handler args for the quoted method.
refreshPaymentStatus — Provided by payment-core; use after redirect or when the client needs to sync settlement with the server.
5.4 End-to-end flow (mental model)
- Customer has an active order; storefront calls
createPaypalPaymentIntent.
- Customer completes payment in PayPal (hosted fields, redirect, or SDK).
- Storefront calls
addPaymentToOrder with metadata your handler expects (see handler implementation).
- PayPal sends a webhook to
/payment/paypal; the server verifies and settles the payment.
- If the UI needs a safety net, poll
refreshPaymentStatus with orderId + transactionId returned from addPaymentToOrder.
6. Options
HpsPluginPaymentPaypal.init({}) accepts an options object; extend HpsPluginPaymentPaypalOptions in this package when new settings are added. Currently the surface is minimal—most configuration lives on the PaymentMethod handler args in Admin.
@hyperse-hub/hps-plugin-payment-core — Shared refreshPaymentStatus, PaymentMethodQuote.clientConfig, and PaymentHelperService.
8. License
MIT
;