@easypayment/medusa-payment-paypal 1.3.7 → 1.3.8
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/.medusa/server/src/api/admin/paypal/logs/route.d.ts.map +1 -1
- package/.medusa/server/src/api/admin/paypal/logs/route.js.map +1 -1
- package/CHANGELOG.md +22 -0
- package/README.md +107 -61
- package/package.json +2 -2
- package/src/api/admin/paypal/logs/route.ts +1 -4
|
@@ -599,6 +599,9 @@ function AdvancedCardPaymentsTab() {
|
|
|
599
599
|
)
|
|
600
600
|
] }) });
|
|
601
601
|
}
|
|
602
|
+
function PayPalGooglePayPage() {
|
|
603
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
604
|
+
}
|
|
602
605
|
function PayPalApplePayPage() {
|
|
603
606
|
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
604
607
|
}
|
|
@@ -1397,9 +1400,6 @@ function PayPalConnectionPage() {
|
|
|
1397
1400
|
` })
|
|
1398
1401
|
] });
|
|
1399
1402
|
}
|
|
1400
|
-
function PayPalGooglePayPage() {
|
|
1401
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
1402
|
-
}
|
|
1403
1403
|
function PayPalPayLaterMessagingPage() {
|
|
1404
1404
|
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
1405
1405
|
}
|
|
@@ -1634,6 +1634,10 @@ const routeModule = {
|
|
|
1634
1634
|
Component: AdvancedCardPaymentsTab,
|
|
1635
1635
|
path: "/settings/paypal/advanced-card-payments"
|
|
1636
1636
|
},
|
|
1637
|
+
{
|
|
1638
|
+
Component: PayPalGooglePayPage,
|
|
1639
|
+
path: "/settings/paypal/google-pay"
|
|
1640
|
+
},
|
|
1637
1641
|
{
|
|
1638
1642
|
Component: PayPalApplePayPage,
|
|
1639
1643
|
path: "/settings/paypal/apple-pay"
|
|
@@ -1642,10 +1646,6 @@ const routeModule = {
|
|
|
1642
1646
|
Component: PayPalConnectionPage,
|
|
1643
1647
|
path: "/settings/paypal/connection"
|
|
1644
1648
|
},
|
|
1645
|
-
{
|
|
1646
|
-
Component: PayPalGooglePayPage,
|
|
1647
|
-
path: "/settings/paypal/google-pay"
|
|
1648
|
-
},
|
|
1649
1649
|
{
|
|
1650
1650
|
Component: PayPalPayLaterMessagingPage,
|
|
1651
1651
|
path: "/settings/paypal/pay-later-messaging"
|
|
@@ -598,6 +598,9 @@ function AdvancedCardPaymentsTab() {
|
|
|
598
598
|
)
|
|
599
599
|
] }) });
|
|
600
600
|
}
|
|
601
|
+
function PayPalGooglePayPage() {
|
|
602
|
+
return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
603
|
+
}
|
|
601
604
|
function PayPalApplePayPage() {
|
|
602
605
|
return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
603
606
|
}
|
|
@@ -1396,9 +1399,6 @@ function PayPalConnectionPage() {
|
|
|
1396
1399
|
` })
|
|
1397
1400
|
] });
|
|
1398
1401
|
}
|
|
1399
|
-
function PayPalGooglePayPage() {
|
|
1400
|
-
return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
1401
|
-
}
|
|
1402
1402
|
function PayPalPayLaterMessagingPage() {
|
|
1403
1403
|
return /* @__PURE__ */ jsx(Navigate, { to: "/settings/paypal/connection", replace: true });
|
|
1404
1404
|
}
|
|
@@ -1633,6 +1633,10 @@ const routeModule = {
|
|
|
1633
1633
|
Component: AdvancedCardPaymentsTab,
|
|
1634
1634
|
path: "/settings/paypal/advanced-card-payments"
|
|
1635
1635
|
},
|
|
1636
|
+
{
|
|
1637
|
+
Component: PayPalGooglePayPage,
|
|
1638
|
+
path: "/settings/paypal/google-pay"
|
|
1639
|
+
},
|
|
1636
1640
|
{
|
|
1637
1641
|
Component: PayPalApplePayPage,
|
|
1638
1642
|
path: "/settings/paypal/apple-pay"
|
|
@@ -1641,10 +1645,6 @@ const routeModule = {
|
|
|
1641
1645
|
Component: PayPalConnectionPage,
|
|
1642
1646
|
path: "/settings/paypal/connection"
|
|
1643
1647
|
},
|
|
1644
|
-
{
|
|
1645
|
-
Component: PayPalGooglePayPage,
|
|
1646
|
-
path: "/settings/paypal/google-pay"
|
|
1647
|
-
},
|
|
1648
1648
|
{
|
|
1649
1649
|
Component: PayPalPayLaterMessagingPage,
|
|
1650
1650
|
path: "/settings/paypal/pay-later-messaging"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/admin/paypal/logs/route.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAO7E;;;;;;GAMG;AACH,wBAAsB,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/admin/paypal/logs/route.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAO7E;;;;;;GAMG;AACH,wBAAsB,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,2BA8BhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../../../../src/api/admin/paypal/logs/route.ts"],"names":[],"mappings":";;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../../../../src/api/admin/paypal/logs/route.ts"],"names":[],"mappings":";;;;;AAgBA,kBA8BC;AA9CD,4CAAmB;AACnB,gDAAuB;AAEvB,oFAIwD;AAExD;;;;;;GAMG;AACI,KAAK,UAAU,GAAG,CAAC,GAAkB,EAAE,GAAmB;IAC/D,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,GAAG,CAAC,KAA2C,CAAA;QAC7D,MAAM,aAAa,GACjB,KAAK,CAAC,QAAQ,KAAK,GAAG;YACtB,KAAK,CAAC,QAAQ,KAAK,MAAM;YACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAA;QAEhC,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,QAAQ,GAAG,IAAA,+BAAc,EAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAA;YAChE,CAAC;YACD,MAAM,IAAI,GAAG,cAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;YACpC,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,2BAA2B,CAAC,CAAA;YAC1D,GAAG,CAAC,SAAS,CAAC,qBAAqB,EAAE,yBAAyB,IAAI,GAAG,CAAC,CAAA;YACtE,OAAO,GAAG,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;QACpD,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,CAAC;YACd,OAAO,EAAE,IAAA,wCAAuB,GAAE;YAClC,KAAK,EAAE,IAAA,6BAAY,GAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CACX,2BAA2B,EAC3B,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACnC,CAAA;QACD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC,CAAA;IACxE,CAAC;AACH,CAAC"}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@easypayment/medusa-payment-paypal` are documented here.
|
|
4
4
|
|
|
5
|
+
## 1.3.8 — 2026-11-17
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **README rewritten for faster setup.** Added a contents list, a "Customize"
|
|
10
|
+
table that matches the admin tabs, a "Going live" table, and split the
|
|
11
|
+
advanced material into collapsible sections (environment variables, declined
|
|
12
|
+
cards, monitoring, integration log). The connect step now names the admin
|
|
13
|
+
page and the manual-credentials link as they appear in Medusa Admin, and
|
|
14
|
+
`STORE_URL` is documented as an alias of `STOREFRONT_URL`.
|
|
15
|
+
- No runtime changes.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **README:** removed the "Start a discussion" link, which returned 404, and
|
|
20
|
+
replaced emoji that render as plain glyphs or break heading anchors on npm
|
|
21
|
+
and GitHub.
|
|
22
|
+
- **package.json:** `repository.url` is now in the normalized `git+https://`
|
|
23
|
+
form, so `npm publish` no longer auto-corrects it with a warning.
|
|
24
|
+
- **Formatting:** `src/api/admin/paypal/logs/route.ts` now passes
|
|
25
|
+
`prettier --check`.
|
|
26
|
+
|
|
5
27
|
## 1.3.7 — 2026-11-16
|
|
6
28
|
|
|
7
29
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PayPal for Medusa
|
|
2
2
|
|
|
3
|
-
**Accept PayPal and credit card payments in your Medusa v2 store
|
|
3
|
+
**Accept PayPal and credit card payments in your Medusa v2 store. Built by an official PayPal Partner.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@easypayment/medusa-payment-paypal)
|
|
6
6
|
[](https://www.npmjs.com/package/@easypayment/medusa-payment-paypal)
|
|
@@ -8,20 +8,31 @@
|
|
|
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
|
+
|
|
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)
|
|
12
24
|
|
|
13
25
|
## ✨ What you get
|
|
14
26
|
|
|
15
27
|
| Feature | Details |
|
|
16
|
-
|
|
28
|
+
| --- | --- |
|
|
17
29
|
| 🔵 **PayPal Buttons** | One-click PayPal checkout for your customers |
|
|
18
|
-
| 💳 **Card
|
|
19
|
-
|
|
|
20
|
-
| 🌍 **Test
|
|
30
|
+
| 💳 **Card payments** | Secure credit and debit card fields, hosted by PayPal (PCI compliant) |
|
|
31
|
+
| 🔧 **Admin dashboard** | Connect your PayPal account and manage everything from Medusa Admin |
|
|
32
|
+
| 🌍 **Test and Live modes** | Try everything safely in Sandbox before going live |
|
|
33
|
+
| 💰 **Capture or authorize** | Charge at checkout, or authorize first and capture from the order later |
|
|
21
34
|
| 🔐 **3D Secure** | Extra card security, configurable in one click |
|
|
22
|
-
| 🔄 **Reliable by design** | Payments are verified with PayPal at every step
|
|
23
|
-
|
|
24
|
-
---
|
|
35
|
+
| 🔄 **Reliable by design** | Payments are verified with PayPal at every step. Webhooks, retries and safety nets are handled for you |
|
|
25
36
|
|
|
26
37
|
## ✅ Requirements
|
|
27
38
|
|
|
@@ -29,8 +40,6 @@
|
|
|
29
40
|
- Node.js **20+**
|
|
30
41
|
- PostgreSQL
|
|
31
42
|
|
|
32
|
-
---
|
|
33
|
-
|
|
34
43
|
## 🚀 Installation
|
|
35
44
|
|
|
36
45
|
In your Medusa backend folder, run:
|
|
@@ -39,12 +48,12 @@ In your Medusa backend folder, run:
|
|
|
39
48
|
npm install @easypayment/medusa-payment-paypal
|
|
40
49
|
```
|
|
41
50
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## ⚙️ Setup — 5 steps
|
|
51
|
+
## 🧩 Setup in 5 steps
|
|
45
52
|
|
|
46
53
|
### 1. Add the plugin to `medusa-config.ts`
|
|
47
54
|
|
|
55
|
+
Add the `plugins` entry and the two payment providers:
|
|
56
|
+
|
|
48
57
|
```ts
|
|
49
58
|
import { loadEnv, defineConfig } from "@medusajs/framework/utils"
|
|
50
59
|
|
|
@@ -103,92 +112,129 @@ npx medusa db:migrate
|
|
|
103
112
|
|
|
104
113
|
### 3. Connect your PayPal account
|
|
105
114
|
|
|
106
|
-
1. Start your Medusa server
|
|
107
|
-
2. Open **Medusa Admin → Settings → PayPal
|
|
108
|
-
3. Choose **Sandbox** (testing) or **Live** (real payments)
|
|
109
|
-
4. Click **Connect to PayPal** and follow the steps
|
|
115
|
+
1. Start your Medusa server.
|
|
116
|
+
2. Open **Medusa Admin → Settings → PayPal → PayPal Connection**.
|
|
117
|
+
3. Choose **Sandbox** (testing) or **Live** (real payments).
|
|
118
|
+
4. Click **Connect to PayPal** and follow the steps in the PayPal window.
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
Your credentials are saved automatically, and webhooks are registered for you.
|
|
112
121
|
|
|
113
|
-
> 💡 Prefer manual setup? Click **
|
|
122
|
+
> 💡 Prefer manual setup? Click **Click here to insert credentials manually** and paste your Client ID and Secret from [developer.paypal.com](https://developer.paypal.com/dashboard/).
|
|
114
123
|
|
|
115
124
|
### 4. Turn PayPal on in your region
|
|
116
125
|
|
|
117
126
|
Go to **Medusa Admin → Settings → Regions → your region** and enable:
|
|
118
127
|
|
|
119
128
|
| Payment provider | What it is |
|
|
120
|
-
|
|
129
|
+
| --- | --- |
|
|
121
130
|
| `pp_paypal_paypal` | PayPal Buttons |
|
|
122
131
|
| `pp_paypal_card_paypal_card` | Card payments |
|
|
123
132
|
|
|
124
133
|
### 5. Add PayPal to your storefront
|
|
125
134
|
|
|
126
|
-
The checkout UI
|
|
135
|
+
The checkout UI is a separate package. Install it in your **storefront** project and follow its step-by-step guide:
|
|
136
|
+
|
|
137
|
+
📦 **[@easypayment/medusa-paypal-ui](https://www.npmjs.com/package/@easypayment/medusa-paypal-ui)**: ready-made PayPal components for Next.js storefronts.
|
|
127
138
|
|
|
128
|
-
|
|
139
|
+
## 🎨 Customize
|
|
129
140
|
|
|
130
|
-
|
|
141
|
+
Everything is managed in **Medusa Admin → Settings → PayPal**. Changes apply right away, with no restart.
|
|
131
142
|
|
|
132
|
-
|
|
143
|
+
| Tab | What you can change |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| **PayPal Settings** | Turn PayPal on or off, checkout title, button color, shape, width, height and label |
|
|
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, invoice prefix, card statement name |
|
|
133
148
|
|
|
134
|
-
|
|
149
|
+
## 🔐 Going live
|
|
135
150
|
|
|
136
|
-
|
|
137
|
-
- **Advanced Card Payments** — turn card payments on/off, 3D Secure mode
|
|
138
|
-
- **Additional Settings** — capture vs. authorize, brand name shown at PayPal, invoice prefix
|
|
151
|
+
Set these two environment variables on your server before taking real payments:
|
|
139
152
|
|
|
140
|
-
|
|
153
|
+
| Variable | Why |
|
|
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 |
|
|
141
157
|
|
|
142
|
-
|
|
158
|
+
Then switch the environment to **Live** in **Settings → PayPal → PayPal Connection** and connect your live PayPal account.
|
|
143
159
|
|
|
144
|
-
|
|
145
|
-
|
|
160
|
+
## 🧰 Advanced options
|
|
161
|
+
|
|
162
|
+
Everything works without these. They are for developers who need to tune the plugin.
|
|
146
163
|
|
|
147
164
|
<details>
|
|
148
|
-
<summary><b>
|
|
165
|
+
<summary><b>Environment variables</b></summary>
|
|
149
166
|
|
|
150
167
|
<br>
|
|
151
168
|
|
|
152
169
|
| Variable | Default | What it does |
|
|
153
|
-
|
|
154
|
-
| `STOREFRONT_URL` |
|
|
155
|
-
| `PAYPAL_ENCRYPTION_STRICT` | `false` | `true`
|
|
156
|
-
| `
|
|
157
|
-
| `
|
|
170
|
+
| --- | --- | --- |
|
|
171
|
+
| `STOREFRONT_URL` (or `STORE_URL`) | Request origin, if listed in `STORE_CORS` | Storefront address used for PayPal return and cancel pages. Can also be set in Admin |
|
|
172
|
+
| `PAYPAL_ENCRYPTION_STRICT` | `false` | `true` refuses to save credentials unencrypted |
|
|
173
|
+
| `PAYPAL_ADMIN_ORIGIN` | First `ADMIN_CORS` entry | Restricts the onboarding popup to your admin URL |
|
|
174
|
+
| `PAYPAL_SEND_SHIPPING_ADDRESS` | `false` | `true` sends the cart's shipping address on PayPal orders (`SET_PROVIDED_ADDRESS`), which improves PayPal Seller Protection eligibility |
|
|
175
|
+
| `PAYPAL_CURRENCY` | `EUR` | Fallback currency if none is configured |
|
|
176
|
+
| `PAYPAL_HTTP_TIMEOUT_MS` | `30000` | Timeout for calls to PayPal |
|
|
177
|
+
| `PAYPAL_SETTINGS_CACHE_MS` | `15000` | In-process cache for plugin settings reads. `0` disables it |
|
|
158
178
|
| `PAYPAL_WEBHOOK_COMPLETE_CART` | `true` | Safety net that finishes an order when the payment succeeded but the buyer's browser closed. `false` disables it |
|
|
159
|
-
| `PAYPAL_RATE_LIMIT_MAX` / `PAYPAL_RATE_LIMIT_WINDOW_MS` | *(off)* / `60000` | Optional request limit for the public checkout routes |
|
|
160
|
-
| `PAYPAL_WEBHOOK_RATE_LIMIT_MAX` / `PAYPAL_WEBHOOK_RATE_LIMIT_WINDOW_MS` | *(off)* / `60000` | Optional request limit for the webhook endpoint (separate from the above) |
|
|
161
179
|
| `PAYPAL_WEBHOOK_REPLAY_WINDOW_MINUTES` | `60` | Rejects webhook deliveries older than this |
|
|
162
|
-
| `PAYPAL_WEBHOOK_STALE_PROCESSING_MS` | `300000` | When the retry job
|
|
163
|
-
| `PAYPAL_WEBHOOK_ID_LIVE` / `PAYPAL_WEBHOOK_ID_SANDBOX` |
|
|
164
|
-
| `
|
|
165
|
-
| `
|
|
166
|
-
| `PAYPAL_ALERT_WEBHOOK_URLS` |
|
|
167
|
-
| `
|
|
168
|
-
| `PAYPAL_REQUEST_LOG` | *(off)* | `1`/`true` force-enables the request/response log file regardless of the admin toggle (normally enabled from **Settings → PayPal → Additional Settings**) |
|
|
180
|
+
| `PAYPAL_WEBHOOK_STALE_PROCESSING_MS` | `300000` | When the retry job picks up interrupted webhook events again |
|
|
181
|
+
| `PAYPAL_WEBHOOK_ID_LIVE` / `PAYPAL_WEBHOOK_ID_SANDBOX` | Automatic | Manual webhook ID override |
|
|
182
|
+
| `PAYPAL_RATE_LIMIT_MAX` / `PAYPAL_RATE_LIMIT_WINDOW_MS` | Off / `60000` | Optional request limit for the public checkout routes |
|
|
183
|
+
| `PAYPAL_WEBHOOK_RATE_LIMIT_MAX` / `PAYPAL_WEBHOOK_RATE_LIMIT_WINDOW_MS` | Off / `60000` | Optional request limit for the webhook endpoint, separate from the one above |
|
|
184
|
+
| `PAYPAL_ALERT_WEBHOOK_URLS` | Unset | Comma-separated URLs that receive operational alerts, including dead-lettered webhook events |
|
|
185
|
+
| `PAYPAL_REQUEST_LOG` | Off | `1` or `true` forces the request/response log on, regardless of the admin toggle |
|
|
169
186
|
| `PAYPAL_LOG_DIR` | `./logs` | Directory for the `paypal-requests-YYYY-MM-DD.log` file written when logging is on |
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `PAYPAL_PARTNER_MERCHANT_ID_SANDBOX` / `PAYPAL_PARTNER_MERCHANT_ID_LIVE` |
|
|
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 |
|
|
173
190
|
|
|
174
|
-
|
|
191
|
+
</details>
|
|
175
192
|
|
|
176
|
-
|
|
193
|
+
<details>
|
|
194
|
+
<summary><b>Declined cards</b></summary>
|
|
177
195
|
|
|
178
|
-
|
|
196
|
+
<br>
|
|
197
|
+
|
|
198
|
+
When PayPal declines a capture, `/store/paypal/capture-order` responds `402` with a buyer-friendly `message` and a structured `decline` object:
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
{ code, message, retryable, avs_code?, cvv_code? }
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Storefronts can use it to show a message such as "insufficient funds, try another card" and to decide whether to offer a retry.
|
|
179
205
|
|
|
180
206
|
</details>
|
|
181
207
|
|
|
182
|
-
|
|
208
|
+
<details>
|
|
209
|
+
<summary><b>Monitoring</b></summary>
|
|
183
210
|
|
|
184
|
-
|
|
211
|
+
<br>
|
|
185
212
|
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
213
|
+
- Operational counters live in the `paypal_metric` table.
|
|
214
|
+
- 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
|
+
- Audit events are logged as JSON lines tagged `"log":"paypal_audit"`, with secrets redacted.
|
|
216
|
+
|
|
217
|
+
</details>
|
|
218
|
+
|
|
219
|
+
<details>
|
|
220
|
+
<summary><b>Integration log for PayPal review</b></summary>
|
|
221
|
+
|
|
222
|
+
<br>
|
|
223
|
+
|
|
224
|
+
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 `logs/paypal-requests-YYYY-MM-DD.log`.
|
|
225
|
+
|
|
226
|
+
- Credentials are redacted. The `PayPal-Partner-Attribution-Id` (BN code) is kept, so the file is safe to hand to PayPal's go-live review.
|
|
227
|
+
- Download it from the same settings page with **Download log**, or at `GET /admin/paypal/logs?download=1`.
|
|
228
|
+
- Turn logging off again once the review is complete.
|
|
229
|
+
|
|
230
|
+
</details>
|
|
231
|
+
|
|
232
|
+
## 💬 Support
|
|
189
233
|
|
|
190
|
-
|
|
234
|
+
- 🐛 **Found a bug, or have a question or feature request?** [Open an issue](https://github.com/easypaymentplugins/medusa-paypal/issues)
|
|
235
|
+
- 🛒 **Storefront UI package:** [@easypayment/medusa-paypal-ui](https://www.npmjs.com/package/@easypayment/medusa-paypal-ui)
|
|
236
|
+
- 📝 **Release notes:** see [CHANGELOG.md](CHANGELOG.md)
|
|
191
237
|
|
|
192
238
|
## 📄 License
|
|
193
239
|
|
|
194
|
-
MIT ©
|
|
240
|
+
[MIT](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.8",
|
|
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",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"repository": {
|
|
89
89
|
"type": "git",
|
|
90
|
-
"url": "https://github.com/easypaymentplugins/medusa-paypal.git"
|
|
90
|
+
"url": "git+https://github.com/easypaymentplugins/medusa-paypal.git"
|
|
91
91
|
},
|
|
92
92
|
"homepage": "https://github.com/easypaymentplugins/medusa-paypal#readme",
|
|
93
93
|
"bugs": {
|
|
@@ -29,10 +29,7 @@ export async function GET(req: MedusaRequest, res: MedusaResponse) {
|
|
|
29
29
|
}
|
|
30
30
|
const name = path.basename(filePath)
|
|
31
31
|
res.setHeader("Content-Type", "text/plain; charset=utf-8")
|
|
32
|
-
res.setHeader(
|
|
33
|
-
"Content-Disposition",
|
|
34
|
-
`attachment; filename="${name}"`
|
|
35
|
-
)
|
|
32
|
+
res.setHeader("Content-Disposition", `attachment; filename="${name}"`)
|
|
36
33
|
return res.send(fs.readFileSync(filePath, "utf8"))
|
|
37
34
|
}
|
|
38
35
|
|