@easypayment/medusa-payment-paypal 1.3.11 → 1.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.medusa/server/src/admin/index.js +7 -7
- package/.medusa/server/src/admin/index.mjs +7 -7
- package/CHANGELOG.md +12 -0
- package/README.md +42 -84
- package/package.json +1 -1
|
@@ -487,6 +487,9 @@ function AdditionalSettingsTab() {
|
|
|
487
487
|
)
|
|
488
488
|
] }) });
|
|
489
489
|
}
|
|
490
|
+
function PayPalApplePayPage() {
|
|
491
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
492
|
+
}
|
|
490
493
|
const URL_RE = /(https?:\/\/[^\s]+[^\s.,!?])/g;
|
|
491
494
|
function NoticeText({ message }) {
|
|
492
495
|
const parts = message.split(URL_RE);
|
|
@@ -705,9 +708,6 @@ function AdvancedCardPaymentsTab() {
|
|
|
705
708
|
)
|
|
706
709
|
] }) });
|
|
707
710
|
}
|
|
708
|
-
function PayPalApplePayPage() {
|
|
709
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
710
|
-
}
|
|
711
711
|
const config = adminSdk.defineRouteConfig({
|
|
712
712
|
label: "PayPal Connection"
|
|
713
713
|
});
|
|
@@ -1797,14 +1797,14 @@ const routeModule = {
|
|
|
1797
1797
|
Component: AdditionalSettingsTab,
|
|
1798
1798
|
path: "/settings/paypal/additional-settings"
|
|
1799
1799
|
},
|
|
1800
|
-
{
|
|
1801
|
-
Component: AdvancedCardPaymentsTab,
|
|
1802
|
-
path: "/settings/paypal/advanced-card-payments"
|
|
1803
|
-
},
|
|
1804
1800
|
{
|
|
1805
1801
|
Component: PayPalApplePayPage,
|
|
1806
1802
|
path: "/settings/paypal/apple-pay"
|
|
1807
1803
|
},
|
|
1804
|
+
{
|
|
1805
|
+
Component: AdvancedCardPaymentsTab,
|
|
1806
|
+
path: "/settings/paypal/advanced-card-payments"
|
|
1807
|
+
},
|
|
1808
1808
|
{
|
|
1809
1809
|
Component: PayPalConnectionPage,
|
|
1810
1810
|
path: "/settings/paypal/connection"
|
|
@@ -484,6 +484,9 @@ function AdditionalSettingsTab() {
|
|
|
484
484
|
)
|
|
485
485
|
] }) });
|
|
486
486
|
}
|
|
487
|
+
function PayPalApplePayPage() {
|
|
488
|
+
return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
489
|
+
}
|
|
487
490
|
const URL_RE = /(https?:\/\/[^\s]+[^\s.,!?])/g;
|
|
488
491
|
function NoticeText({ message }) {
|
|
489
492
|
const parts = message.split(URL_RE);
|
|
@@ -702,9 +705,6 @@ function AdvancedCardPaymentsTab() {
|
|
|
702
705
|
)
|
|
703
706
|
] }) });
|
|
704
707
|
}
|
|
705
|
-
function PayPalApplePayPage() {
|
|
706
|
-
return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
707
|
-
}
|
|
708
708
|
const config = defineRouteConfig({
|
|
709
709
|
label: "PayPal Connection"
|
|
710
710
|
});
|
|
@@ -1794,14 +1794,14 @@ const routeModule = {
|
|
|
1794
1794
|
Component: AdditionalSettingsTab,
|
|
1795
1795
|
path: "/settings/paypal/additional-settings"
|
|
1796
1796
|
},
|
|
1797
|
-
{
|
|
1798
|
-
Component: AdvancedCardPaymentsTab,
|
|
1799
|
-
path: "/settings/paypal/advanced-card-payments"
|
|
1800
|
-
},
|
|
1801
1797
|
{
|
|
1802
1798
|
Component: PayPalApplePayPage,
|
|
1803
1799
|
path: "/settings/paypal/apple-pay"
|
|
1804
1800
|
},
|
|
1801
|
+
{
|
|
1802
|
+
Component: AdvancedCardPaymentsTab,
|
|
1803
|
+
path: "/settings/paypal/advanced-card-payments"
|
|
1804
|
+
},
|
|
1805
1805
|
{
|
|
1806
1806
|
Component: PayPalConnectionPage,
|
|
1807
1807
|
path: "/settings/paypal/connection"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@easypayment/medusa-payment-paypal` are documented here.
|
|
4
4
|
|
|
5
|
+
## 1.3.13 — 2026-11-26
|
|
6
|
+
|
|
7
|
+
README only. No code changes.
|
|
8
|
+
|
|
9
|
+
- Reformatted the README so it displays correctly on the Medusa integrations
|
|
10
|
+
page as well as npm: tables are now lists, collapsible sections are now
|
|
11
|
+
regular headings, and links to the changelog and license are absolute.
|
|
12
|
+
|
|
13
|
+
## 1.3.12 — 2026-11-26
|
|
14
|
+
|
|
15
|
+
Code formatting only. No functional changes.
|
|
16
|
+
|
|
5
17
|
## 1.3.11 — 2026-11-23
|
|
6
18
|
|
|
7
19
|
Code formatting only. No functional changes.
|
package/README.md
CHANGED
|
@@ -4,35 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@easypayment/medusa-payment-paypal)
|
|
6
6
|
[](https://www.npmjs.com/package/@easypayment/medusa-payment-paypal)
|
|
7
|
-
[](LICENSE)
|
|
7
|
+
[](https://github.com/easypaymentplugins/medusa-paypal/blob/main/LICENSE)
|
|
8
8
|
[](https://medusajs.com)
|
|
9
9
|
[](https://developer.paypal.com)
|
|
10
10
|
|
|
11
11
|
This is the **backend plugin**. It adds PayPal to your Medusa server and Medusa Admin. The checkout components for your storefront are in the companion package, [@easypayment/medusa-paypal-ui](https://www.npmjs.com/package/@easypayment/medusa-paypal-ui).
|
|
12
12
|
|
|
13
|
-
## Contents
|
|
14
|
-
|
|
15
|
-
- [What you get](#-what-you-get)
|
|
16
|
-
- [Requirements](#-requirements)
|
|
17
|
-
- [Installation](#-installation)
|
|
18
|
-
- [Setup in 5 steps](#-setup-in-5-steps)
|
|
19
|
-
- [Customize](#-customize)
|
|
20
|
-
- [Going live](#-going-live)
|
|
21
|
-
- [Advanced options](#-advanced-options)
|
|
22
|
-
- [Support](#-support)
|
|
23
|
-
- [License](#-license)
|
|
24
|
-
|
|
25
13
|
## ✨ What you get
|
|
26
14
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| 🔐 **3D Secure** | Extra card security, configurable in one click |
|
|
35
|
-
| 🔄 **Reliable by design** | Payments are verified with PayPal at every step. Webhooks, retries and safety nets are handled for you |
|
|
15
|
+
- 🔵 **PayPal Buttons**: one-click PayPal checkout for your customers
|
|
16
|
+
- 💳 **Card payments**: secure credit and debit card fields, hosted by PayPal (PCI compliant)
|
|
17
|
+
- 🔧 **Admin dashboard**: connect your PayPal account and manage everything from Medusa Admin
|
|
18
|
+
- 🌍 **Test and Live modes**: try everything safely in Sandbox before going live
|
|
19
|
+
- 💰 **Capture or authorize**: charge at checkout, or authorize first and capture from the order later
|
|
20
|
+
- 🔐 **3D Secure**: extra card security, configurable in one click
|
|
21
|
+
- 🔄 **Reliable by design**: payments are verified with PayPal at every step. Webhooks, retries and safety nets are handled for you
|
|
36
22
|
|
|
37
23
|
## ✅ Requirements
|
|
38
24
|
|
|
@@ -125,10 +111,8 @@ Your credentials are saved automatically, and webhooks are registered for you.
|
|
|
125
111
|
|
|
126
112
|
Go to **Medusa Admin → Settings → Regions → your region** and enable:
|
|
127
113
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
| `pp_paypal_paypal` | PayPal Buttons |
|
|
131
|
-
| `pp_paypal_card_paypal_card` | Card payments |
|
|
114
|
+
- `pp_paypal_paypal`: PayPal Buttons
|
|
115
|
+
- `pp_paypal_card_paypal_card`: Card payments
|
|
132
116
|
|
|
133
117
|
### 5. Add PayPal to your storefront
|
|
134
118
|
|
|
@@ -140,20 +124,16 @@ The checkout UI is a separate package. Install it in your **storefront** project
|
|
|
140
124
|
|
|
141
125
|
Everything is managed in **Medusa Admin → Settings → PayPal**. Changes apply right away, with no restart.
|
|
142
126
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
| **Advanced Card Payments** | Turn card payments on or off, checkout title, 3D Secure mode |
|
|
147
|
-
| **Additional Settings** | Payment action (capture or authorize), brand name shown at PayPal, landing page, instant payments, item details, shipping address, invoice prefix, card statement name |
|
|
127
|
+
- **PayPal Settings**: turn PayPal on or off, checkout title, button color, shape, width, height and label
|
|
128
|
+
- **Advanced Card Payments**: turn card payments on or off, checkout title, 3D Secure mode
|
|
129
|
+
- **Additional Settings**: payment action (capture or authorize), brand name shown at PayPal, landing page, instant payments, item details, shipping address, invoice prefix, card statement name
|
|
148
130
|
|
|
149
131
|
## 🔐 Going live
|
|
150
132
|
|
|
151
133
|
Set these two environment variables on your server before taking real payments:
|
|
152
134
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
| `PAYPAL_ENCRYPTION_KEY` | Any long random text. Your PayPal credentials are then stored encrypted in the database. Keep the key safe: if it is lost, reconnect PayPal |
|
|
156
|
-
| `MEDUSA_BACKEND_URL` | Your backend's public address, for example `https://api.mystore.com`, so PayPal can reach your store with payment notifications |
|
|
135
|
+
- `PAYPAL_ENCRYPTION_KEY`: any long random text. Your PayPal credentials are then stored encrypted in the database. Keep the key safe: if it is lost, reconnect PayPal.
|
|
136
|
+
- `MEDUSA_BACKEND_URL`: your backend's public address, for example `https://api.mystore.com`, so PayPal can reach your store with payment notifications.
|
|
157
137
|
|
|
158
138
|
Then switch the environment to **Live** in **Settings → PayPal → PayPal Connection** and connect your live PayPal account.
|
|
159
139
|
|
|
@@ -161,39 +141,29 @@ Then switch the environment to **Live** in **Settings → PayPal → PayPal Conn
|
|
|
161
141
|
|
|
162
142
|
Everything works without these. They are for developers who need to tune the plugin.
|
|
163
143
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
| `PAYPAL_PARTNER_SERVICE_URL` | Built-in | Overrides the partner onboarding service used by the connect flow |
|
|
188
|
-
| `PAYPAL_SELLER_NONCE` | Partner service nonce | Only change this if you also run your own `PAYPAL_PARTNER_SERVICE_URL`. It must match the nonce that service puts in its onboarding links |
|
|
189
|
-
| `PAYPAL_PARTNER_MERCHANT_ID_SANDBOX` / `PAYPAL_PARTNER_MERCHANT_ID_LIVE` | Built-in | Overrides the partner merchant IDs used for onboarding |
|
|
190
|
-
|
|
191
|
-
</details>
|
|
192
|
-
|
|
193
|
-
<details>
|
|
194
|
-
<summary><b>Declined cards</b></summary>
|
|
195
|
-
|
|
196
|
-
<br>
|
|
144
|
+
### Environment variables
|
|
145
|
+
|
|
146
|
+
- `STOREFRONT_URL` (or `STORE_URL`): Storefront address used for PayPal return and cancel pages. Can also be set in Admin. Default: Request origin, if listed in `STORE_CORS`.
|
|
147
|
+
- `PAYPAL_ENCRYPTION_STRICT`: `true` refuses to save credentials unencrypted. Default: `false`.
|
|
148
|
+
- `PAYPAL_ADMIN_ORIGIN`: Restricts the onboarding popup to your admin URL. Default: First `ADMIN_CORS` entry.
|
|
149
|
+
- `PAYPAL_SEND_SHIPPING_ADDRESS`: The shipping address the buyer entered at checkout is sent on PayPal orders (`SET_PROVIDED_ADDRESS`), which PayPal Seller Protection needs. Set `false` to let buyers pick an address in PayPal instead. Also an admin setting. Default: `true`.
|
|
150
|
+
- `PAYPAL_CURRENCY`: Fallback currency if none is configured. Default: `EUR`.
|
|
151
|
+
- `PAYPAL_HTTP_TIMEOUT_MS`: Timeout for calls to PayPal. Default: `30000`.
|
|
152
|
+
- `PAYPAL_SETTINGS_CACHE_MS`: In-process cache for plugin settings reads. `0` disables it. Default: `15000`.
|
|
153
|
+
- `PAYPAL_WEBHOOK_COMPLETE_CART`: Safety net that finishes an order when the payment succeeded but the buyer's browser closed. `false` disables it. Default: `true`.
|
|
154
|
+
- `PAYPAL_WEBHOOK_REPLAY_WINDOW_MINUTES`: Rejects webhook deliveries older than this. Default: `60`.
|
|
155
|
+
- `PAYPAL_WEBHOOK_STALE_PROCESSING_MS`: When the retry job picks up interrupted webhook events again. Default: `300000`.
|
|
156
|
+
- `PAYPAL_WEBHOOK_ID_LIVE` / `PAYPAL_WEBHOOK_ID_SANDBOX`: Manual webhook ID override. Default: Automatic.
|
|
157
|
+
- `PAYPAL_RATE_LIMIT_MAX` / `PAYPAL_RATE_LIMIT_WINDOW_MS`: Optional request limit for the public checkout routes. Default: Off / `60000`.
|
|
158
|
+
- `PAYPAL_WEBHOOK_RATE_LIMIT_MAX` / `PAYPAL_WEBHOOK_RATE_LIMIT_WINDOW_MS`: Optional request limit for the webhook endpoint, separate from the one above. Default: Off / `60000`.
|
|
159
|
+
- `PAYPAL_ALERT_WEBHOOK_URLS`: Comma-separated URLs that receive operational alerts, including dead-lettered webhook events. Default: Unset.
|
|
160
|
+
- `PAYPAL_REQUEST_LOG`: `1` or `true` forces the request/response log on, regardless of the admin toggle. Default: Off.
|
|
161
|
+
- `PAYPAL_LOG_DIR`: Directory for the `paypal-requests-YYYY-MM-DD.log` file written when logging is on. Keep it outside the folders `medusa develop` watches, or every logged request restarts the dev server. Default: `.medusa/paypal-logs` in the project.
|
|
162
|
+
- `PAYPAL_PARTNER_SERVICE_URL`: Overrides the partner onboarding service used by the connect flow. Default: Built-in.
|
|
163
|
+
- `PAYPAL_SELLER_NONCE`: Only change this if you also run your own `PAYPAL_PARTNER_SERVICE_URL`. It must match the nonce that service puts in its onboarding links. Default: Partner service nonce.
|
|
164
|
+
- `PAYPAL_PARTNER_MERCHANT_ID_SANDBOX` / `PAYPAL_PARTNER_MERCHANT_ID_LIVE`: Overrides the partner merchant IDs used for onboarding. Default: Built-in.
|
|
165
|
+
|
|
166
|
+
### Declined cards
|
|
197
167
|
|
|
198
168
|
When PayPal declines a capture, `/store/paypal/capture-order` responds `402` with a buyer-friendly `message` and a structured `decline` object:
|
|
199
169
|
|
|
@@ -203,23 +173,13 @@ When PayPal declines a capture, `/store/paypal/capture-order` responds `402` wit
|
|
|
203
173
|
|
|
204
174
|
Storefronts can use it to show a message such as "insufficient funds, try another card" and to decide whether to offer a retry.
|
|
205
175
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<details>
|
|
209
|
-
<summary><b>Monitoring</b></summary>
|
|
210
|
-
|
|
211
|
-
<br>
|
|
176
|
+
### Monitoring
|
|
212
177
|
|
|
213
178
|
- Operational counters live in the `paypal_metric` table.
|
|
214
179
|
- Every webhook is recorded in `paypal_webhook_event` and retried automatically. Events that exhaust their retries are dead-lettered and pushed to `PAYPAL_ALERT_WEBHOOK_URLS`.
|
|
215
180
|
- Audit events are logged as JSON lines tagged `"log":"paypal_audit"`, with secrets redacted.
|
|
216
181
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
<details>
|
|
220
|
-
<summary><b>Integration log for PayPal review</b></summary>
|
|
221
|
-
|
|
222
|
-
<br>
|
|
182
|
+
### Integration log for PayPal review
|
|
223
183
|
|
|
224
184
|
Turn on **Settings → PayPal → Additional Settings → Request/response logging** (off by default) to append every PayPal API call, and every plugin API request and response, to `.medusa/paypal-logs/paypal-requests-YYYY-MM-DD.log`.
|
|
225
185
|
|
|
@@ -227,14 +187,12 @@ Turn on **Settings → PayPal → Additional Settings → Request/response loggi
|
|
|
227
187
|
- Download it from the same settings page with **Download log**, or at `GET /admin/paypal/logs?download=1`.
|
|
228
188
|
- Turn logging off again once the review is complete.
|
|
229
189
|
|
|
230
|
-
</details>
|
|
231
|
-
|
|
232
190
|
## 💬 Support
|
|
233
191
|
|
|
234
192
|
- 🐛 **Found a bug, or have a question or feature request?** [Open an issue](https://github.com/easypaymentplugins/medusa-paypal/issues)
|
|
235
193
|
- 🛒 **Storefront UI package:** [@easypayment/medusa-paypal-ui](https://www.npmjs.com/package/@easypayment/medusa-paypal-ui)
|
|
236
|
-
- 📝 **Release notes:** see [CHANGELOG.md](CHANGELOG.md)
|
|
194
|
+
- 📝 **Release notes:** see [CHANGELOG.md](https://github.com/easypaymentplugins/medusa-paypal/blob/main/CHANGELOG.md)
|
|
237
195
|
|
|
238
196
|
## 📄 License
|
|
239
197
|
|
|
240
|
-
[MIT](LICENSE) © Easy Payment
|
|
198
|
+
[MIT](https://github.com/easypaymentplugins/medusa-paypal/blob/main/LICENSE) © Easy Payment
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easypayment/medusa-payment-paypal",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.13",
|
|
4
4
|
"description": "PayPal & credit card payments for Medusa v2 — PayPal Buttons, hosted card fields, 3D Secure, and an admin dashboard. Built by a PayPal Partner.",
|
|
5
5
|
"author": "EasyPayment Plugins",
|
|
6
6
|
"license": "MIT",
|