@alleyboss/micropay-solana-x402-paywall 3.3.2 → 3.3.3

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.
@@ -178,8 +178,8 @@ function usePaywallResource({
178
178
  }
179
179
  const res = await fetch(url, { headers });
180
180
  if (res.status === 402) {
181
- const wwwAuth = res.headers.get("WWW-Authenticate");
182
- console.log("[usePaywallResource] 402 Response. WWW-Authenticate:", wwwAuth);
181
+ const wwwAuth = res.headers.get("WWW-Authenticate") || res.headers.get("Payment-Required");
182
+ console.log("[usePaywallResource] 402 Response. Header:", wwwAuth);
183
183
  if (wwwAuth) {
184
184
  setPaymentHeader(wwwAuth);
185
185
  try {
@@ -176,8 +176,8 @@ function usePaywallResource({
176
176
  }
177
177
  const res = await fetch(url, { headers });
178
178
  if (res.status === 402) {
179
- const wwwAuth = res.headers.get("WWW-Authenticate");
180
- console.log("[usePaywallResource] 402 Response. WWW-Authenticate:", wwwAuth);
179
+ const wwwAuth = res.headers.get("WWW-Authenticate") || res.headers.get("Payment-Required");
180
+ console.log("[usePaywallResource] 402 Response. Header:", wwwAuth);
181
181
  if (wwwAuth) {
182
182
  setPaymentHeader(wwwAuth);
183
183
  try {
package/dist/index.cjs CHANGED
@@ -190,8 +190,8 @@ function usePaywallResource({
190
190
  }
191
191
  const res = await fetch(url, { headers });
192
192
  if (res.status === 402) {
193
- const wwwAuth = res.headers.get("WWW-Authenticate");
194
- console.log("[usePaywallResource] 402 Response. WWW-Authenticate:", wwwAuth);
193
+ const wwwAuth = res.headers.get("WWW-Authenticate") || res.headers.get("Payment-Required");
194
+ console.log("[usePaywallResource] 402 Response. Header:", wwwAuth);
195
195
  if (wwwAuth) {
196
196
  setPaymentHeader(wwwAuth);
197
197
  try {
package/dist/index.js CHANGED
@@ -184,8 +184,8 @@ function usePaywallResource({
184
184
  }
185
185
  const res = await fetch(url, { headers });
186
186
  if (res.status === 402) {
187
- const wwwAuth = res.headers.get("WWW-Authenticate");
188
- console.log("[usePaywallResource] 402 Response. WWW-Authenticate:", wwwAuth);
187
+ const wwwAuth = res.headers.get("WWW-Authenticate") || res.headers.get("Payment-Required");
188
+ console.log("[usePaywallResource] 402 Response. Header:", wwwAuth);
189
189
  if (wwwAuth) {
190
190
  setPaymentHeader(wwwAuth);
191
191
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alleyboss/micropay-solana-x402-paywall",
3
- "version": "3.3.2",
3
+ "version": "3.3.3",
4
4
  "description": "Production-ready Solana micropayments library wrapper for official x402 SDK",
5
5
  "author": "AlleyBoss",
6
6
  "license": "MIT",