@brainerce/mcp-server 2.3.0 → 2.4.0
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/dist/bin/http.js +30 -3
- package/dist/bin/stdio.js +30 -3
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +30 -3
- package/dist/index.mjs +30 -3
- package/package.json +1 -1
package/dist/bin/http.js
CHANGED
|
@@ -314,6 +314,20 @@ function CheckoutPage() {
|
|
|
314
314
|
if (!paymentData) return <div>Unable to initialize payment</div>;
|
|
315
315
|
|
|
316
316
|
// Render payment UI based on provider
|
|
317
|
+
if (paymentData.provider === 'sandbox') {
|
|
318
|
+
return (
|
|
319
|
+
<div className="text-center p-6 bg-amber-50 border border-amber-200 rounded-lg">
|
|
320
|
+
<h3 className="font-semibold mb-2">Test Mode</h3>
|
|
321
|
+
<p className="text-sm text-gray-600 mb-4">No real payment will be charged.</p>
|
|
322
|
+
<button onClick={async () => {
|
|
323
|
+
await client.completeGuestCheckout(checkoutId);
|
|
324
|
+
window.location.href = \\\`/order-confirmation?checkout_id=\\\${checkoutId}\\\`;
|
|
325
|
+
}} className="bg-amber-500 text-white px-6 py-2 rounded">
|
|
326
|
+
Complete Test Order
|
|
327
|
+
</button>
|
|
328
|
+
</div>
|
|
329
|
+
);
|
|
330
|
+
}
|
|
317
331
|
if (paymentData.provider === 'grow') {
|
|
318
332
|
return <GrowPaymentForm paymentUrl={paymentData.clientSecret} checkoutId={paymentData.checkoutId} />;
|
|
319
333
|
}
|
|
@@ -432,11 +446,12 @@ const growProvider = providers.find(p => p.provider === 'grow');
|
|
|
432
446
|
const paypalProvider = providers.find(p => p.provider === 'paypal');
|
|
433
447
|
\`\`\`
|
|
434
448
|
|
|
435
|
-
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
449
|
+
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'|'sandbox'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
436
450
|
|
|
437
451
|
- **Stripe:** \`npm install @stripe/stripe-js @stripe/react-stripe-js\` \u2014 \`loadStripe(publicKey, { stripeAccount })\`
|
|
438
452
|
- **Grow:** No SDK \u2014 uses iframe with payment URL. Supports credit cards, Bit, Apple Pay, Google Pay.
|
|
439
|
-
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons
|
|
453
|
+
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons\`
|
|
454
|
+
- **Sandbox:** No SDK needed \u2014 when \`sandboxPaymentsEnabled\` is true, \`getPaymentProviders()\` includes a sandbox provider with \`renderType: 'sandbox'\`. Show a "Complete Test Order" button. Call \`completeGuestCheckout(checkoutId)\` to finalize. Orders are marked \`isTestOrder: true\`.`;
|
|
440
455
|
}
|
|
441
456
|
function getProductsSection(_currency) {
|
|
442
457
|
return `## Products & Variants
|
|
@@ -10533,7 +10548,8 @@ var DETAILED = `# Required Pages \u2014 Detailed Guide
|
|
|
10533
10548
|
- Step 1: Customer info (email, name)
|
|
10534
10549
|
- Step 2: Shipping address form
|
|
10535
10550
|
- Step 3: Shipping method selection (from rates returned by \`setShippingAddress()\`)
|
|
10536
|
-
- Step 4: Payment (auto-detects Stripe/Grow/PayPal via \`getPaymentProviders()\`)
|
|
10551
|
+
- Step 4: Payment (auto-detects Stripe/Grow/PayPal/Sandbox via \`getPaymentProviders()\`)
|
|
10552
|
+
- If \`sandboxPaymentsEnabled\` is on, a sandbox provider with \`renderType: 'sandbox'\` is included \u2014 show a "Complete Test Order" button instead of real payment UI. Call \`completeGuestCheckout(checkoutId)\` to finalize.
|
|
10537
10553
|
- Order summary sidebar showing \`checkout.lineItems\` (NOT cart.items!)
|
|
10538
10554
|
- Tax display after address entry
|
|
10539
10555
|
- Reservation countdown
|
|
@@ -10775,6 +10791,9 @@ function formatCapabilities(caps) {
|
|
|
10775
10791
|
lines.push(
|
|
10776
10792
|
`- Email verification: ${caps.connection.requireEmailVerification ? "required" : "not required"}`
|
|
10777
10793
|
);
|
|
10794
|
+
lines.push(
|
|
10795
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "enabled (test orders without real payment)" : "disabled"}`
|
|
10796
|
+
);
|
|
10778
10797
|
lines.push(
|
|
10779
10798
|
`- Inventory reservation: ${caps.connection.reservationStrategy} (${caps.connection.reservationTimeout} min timeout)`
|
|
10780
10799
|
);
|
|
@@ -10814,6 +10833,11 @@ function formatCapabilities(caps) {
|
|
|
10814
10833
|
'Email verification is required \u2014 ALWAYS build the verify-email page. Use get-code-example("verify-email").'
|
|
10815
10834
|
);
|
|
10816
10835
|
}
|
|
10836
|
+
if (caps.connection.sandboxPaymentsEnabled) {
|
|
10837
|
+
suggestions.push(
|
|
10838
|
+
`Sandbox payments are enabled \u2014 the PaymentStep component shows a "Complete Test Order" button when renderType is 'sandbox'. No real charges. Test orders are marked isTestOrder: true.`
|
|
10839
|
+
);
|
|
10840
|
+
}
|
|
10817
10841
|
if (caps.connection.reservationStrategy !== "ON_PAYMENT") {
|
|
10818
10842
|
suggestions.push(
|
|
10819
10843
|
'Inventory reservation is active \u2014 show a countdown timer. Use get-code-example("reservation-countdown").'
|
|
@@ -10967,6 +10991,9 @@ function formatCapabilitiesSummary(caps) {
|
|
|
10967
10991
|
lines.push(
|
|
10968
10992
|
`- Guest checkout tracking: ${caps.connection.guestCheckoutTracking ? "enabled" : "disabled"}`
|
|
10969
10993
|
);
|
|
10994
|
+
lines.push(
|
|
10995
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "ENABLED \u2014 payment step shows test order button (no real charges)" : "disabled"}`
|
|
10996
|
+
);
|
|
10970
10997
|
return lines.join("\n");
|
|
10971
10998
|
}
|
|
10972
10999
|
function buildStoreBundle(options) {
|
package/dist/bin/stdio.js
CHANGED
|
@@ -312,6 +312,20 @@ function CheckoutPage() {
|
|
|
312
312
|
if (!paymentData) return <div>Unable to initialize payment</div>;
|
|
313
313
|
|
|
314
314
|
// Render payment UI based on provider
|
|
315
|
+
if (paymentData.provider === 'sandbox') {
|
|
316
|
+
return (
|
|
317
|
+
<div className="text-center p-6 bg-amber-50 border border-amber-200 rounded-lg">
|
|
318
|
+
<h3 className="font-semibold mb-2">Test Mode</h3>
|
|
319
|
+
<p className="text-sm text-gray-600 mb-4">No real payment will be charged.</p>
|
|
320
|
+
<button onClick={async () => {
|
|
321
|
+
await client.completeGuestCheckout(checkoutId);
|
|
322
|
+
window.location.href = \\\`/order-confirmation?checkout_id=\\\${checkoutId}\\\`;
|
|
323
|
+
}} className="bg-amber-500 text-white px-6 py-2 rounded">
|
|
324
|
+
Complete Test Order
|
|
325
|
+
</button>
|
|
326
|
+
</div>
|
|
327
|
+
);
|
|
328
|
+
}
|
|
315
329
|
if (paymentData.provider === 'grow') {
|
|
316
330
|
return <GrowPaymentForm paymentUrl={paymentData.clientSecret} checkoutId={paymentData.checkoutId} />;
|
|
317
331
|
}
|
|
@@ -430,11 +444,12 @@ const growProvider = providers.find(p => p.provider === 'grow');
|
|
|
430
444
|
const paypalProvider = providers.find(p => p.provider === 'paypal');
|
|
431
445
|
\`\`\`
|
|
432
446
|
|
|
433
|
-
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
447
|
+
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'|'sandbox'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
434
448
|
|
|
435
449
|
- **Stripe:** \`npm install @stripe/stripe-js @stripe/react-stripe-js\` \u2014 \`loadStripe(publicKey, { stripeAccount })\`
|
|
436
450
|
- **Grow:** No SDK \u2014 uses iframe with payment URL. Supports credit cards, Bit, Apple Pay, Google Pay.
|
|
437
|
-
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons
|
|
451
|
+
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons\`
|
|
452
|
+
- **Sandbox:** No SDK needed \u2014 when \`sandboxPaymentsEnabled\` is true, \`getPaymentProviders()\` includes a sandbox provider with \`renderType: 'sandbox'\`. Show a "Complete Test Order" button. Call \`completeGuestCheckout(checkoutId)\` to finalize. Orders are marked \`isTestOrder: true\`.`;
|
|
438
453
|
}
|
|
439
454
|
function getProductsSection(_currency) {
|
|
440
455
|
return `## Products & Variants
|
|
@@ -10531,7 +10546,8 @@ var DETAILED = `# Required Pages \u2014 Detailed Guide
|
|
|
10531
10546
|
- Step 1: Customer info (email, name)
|
|
10532
10547
|
- Step 2: Shipping address form
|
|
10533
10548
|
- Step 3: Shipping method selection (from rates returned by \`setShippingAddress()\`)
|
|
10534
|
-
- Step 4: Payment (auto-detects Stripe/Grow/PayPal via \`getPaymentProviders()\`)
|
|
10549
|
+
- Step 4: Payment (auto-detects Stripe/Grow/PayPal/Sandbox via \`getPaymentProviders()\`)
|
|
10550
|
+
- If \`sandboxPaymentsEnabled\` is on, a sandbox provider with \`renderType: 'sandbox'\` is included \u2014 show a "Complete Test Order" button instead of real payment UI. Call \`completeGuestCheckout(checkoutId)\` to finalize.
|
|
10535
10551
|
- Order summary sidebar showing \`checkout.lineItems\` (NOT cart.items!)
|
|
10536
10552
|
- Tax display after address entry
|
|
10537
10553
|
- Reservation countdown
|
|
@@ -10773,6 +10789,9 @@ function formatCapabilities(caps) {
|
|
|
10773
10789
|
lines.push(
|
|
10774
10790
|
`- Email verification: ${caps.connection.requireEmailVerification ? "required" : "not required"}`
|
|
10775
10791
|
);
|
|
10792
|
+
lines.push(
|
|
10793
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "enabled (test orders without real payment)" : "disabled"}`
|
|
10794
|
+
);
|
|
10776
10795
|
lines.push(
|
|
10777
10796
|
`- Inventory reservation: ${caps.connection.reservationStrategy} (${caps.connection.reservationTimeout} min timeout)`
|
|
10778
10797
|
);
|
|
@@ -10812,6 +10831,11 @@ function formatCapabilities(caps) {
|
|
|
10812
10831
|
'Email verification is required \u2014 ALWAYS build the verify-email page. Use get-code-example("verify-email").'
|
|
10813
10832
|
);
|
|
10814
10833
|
}
|
|
10834
|
+
if (caps.connection.sandboxPaymentsEnabled) {
|
|
10835
|
+
suggestions.push(
|
|
10836
|
+
`Sandbox payments are enabled \u2014 the PaymentStep component shows a "Complete Test Order" button when renderType is 'sandbox'. No real charges. Test orders are marked isTestOrder: true.`
|
|
10837
|
+
);
|
|
10838
|
+
}
|
|
10815
10839
|
if (caps.connection.reservationStrategy !== "ON_PAYMENT") {
|
|
10816
10840
|
suggestions.push(
|
|
10817
10841
|
'Inventory reservation is active \u2014 show a countdown timer. Use get-code-example("reservation-countdown").'
|
|
@@ -10965,6 +10989,9 @@ function formatCapabilitiesSummary(caps) {
|
|
|
10965
10989
|
lines.push(
|
|
10966
10990
|
`- Guest checkout tracking: ${caps.connection.guestCheckoutTracking ? "enabled" : "disabled"}`
|
|
10967
10991
|
);
|
|
10992
|
+
lines.push(
|
|
10993
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "ENABLED \u2014 payment step shows test order button (no real charges)" : "disabled"}`
|
|
10994
|
+
);
|
|
10968
10995
|
return lines.join("\n");
|
|
10969
10996
|
}
|
|
10970
10997
|
function buildStoreBundle(options) {
|
package/dist/index.d.mts
CHANGED
|
@@ -50,6 +50,7 @@ interface StoreCapabilities {
|
|
|
50
50
|
ordersWriteEnabled: boolean;
|
|
51
51
|
guestCheckoutTracking: boolean;
|
|
52
52
|
requireEmailVerification: boolean;
|
|
53
|
+
sandboxPaymentsEnabled: boolean;
|
|
53
54
|
reservationStrategy: string;
|
|
54
55
|
reservationTimeout: number;
|
|
55
56
|
lowStockWarning: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ interface StoreCapabilities {
|
|
|
50
50
|
ordersWriteEnabled: boolean;
|
|
51
51
|
guestCheckoutTracking: boolean;
|
|
52
52
|
requireEmailVerification: boolean;
|
|
53
|
+
sandboxPaymentsEnabled: boolean;
|
|
53
54
|
reservationStrategy: string;
|
|
54
55
|
reservationTimeout: number;
|
|
55
56
|
lowStockWarning: boolean;
|
package/dist/index.js
CHANGED
|
@@ -329,6 +329,20 @@ function CheckoutPage() {
|
|
|
329
329
|
if (!paymentData) return <div>Unable to initialize payment</div>;
|
|
330
330
|
|
|
331
331
|
// Render payment UI based on provider
|
|
332
|
+
if (paymentData.provider === 'sandbox') {
|
|
333
|
+
return (
|
|
334
|
+
<div className="text-center p-6 bg-amber-50 border border-amber-200 rounded-lg">
|
|
335
|
+
<h3 className="font-semibold mb-2">Test Mode</h3>
|
|
336
|
+
<p className="text-sm text-gray-600 mb-4">No real payment will be charged.</p>
|
|
337
|
+
<button onClick={async () => {
|
|
338
|
+
await client.completeGuestCheckout(checkoutId);
|
|
339
|
+
window.location.href = \\\`/order-confirmation?checkout_id=\\\${checkoutId}\\\`;
|
|
340
|
+
}} className="bg-amber-500 text-white px-6 py-2 rounded">
|
|
341
|
+
Complete Test Order
|
|
342
|
+
</button>
|
|
343
|
+
</div>
|
|
344
|
+
);
|
|
345
|
+
}
|
|
332
346
|
if (paymentData.provider === 'grow') {
|
|
333
347
|
return <GrowPaymentForm paymentUrl={paymentData.clientSecret} checkoutId={paymentData.checkoutId} />;
|
|
334
348
|
}
|
|
@@ -447,11 +461,12 @@ const growProvider = providers.find(p => p.provider === 'grow');
|
|
|
447
461
|
const paypalProvider = providers.find(p => p.provider === 'paypal');
|
|
448
462
|
\`\`\`
|
|
449
463
|
|
|
450
|
-
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
464
|
+
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'|'sandbox'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
451
465
|
|
|
452
466
|
- **Stripe:** \`npm install @stripe/stripe-js @stripe/react-stripe-js\` \u2014 \`loadStripe(publicKey, { stripeAccount })\`
|
|
453
467
|
- **Grow:** No SDK \u2014 uses iframe with payment URL. Supports credit cards, Bit, Apple Pay, Google Pay.
|
|
454
|
-
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons
|
|
468
|
+
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons\`
|
|
469
|
+
- **Sandbox:** No SDK needed \u2014 when \`sandboxPaymentsEnabled\` is true, \`getPaymentProviders()\` includes a sandbox provider with \`renderType: 'sandbox'\`. Show a "Complete Test Order" button. Call \`completeGuestCheckout(checkoutId)\` to finalize. Orders are marked \`isTestOrder: true\`.`;
|
|
455
470
|
}
|
|
456
471
|
function getProductsSection(_currency) {
|
|
457
472
|
return `## Products & Variants
|
|
@@ -10548,7 +10563,8 @@ var DETAILED = `# Required Pages \u2014 Detailed Guide
|
|
|
10548
10563
|
- Step 1: Customer info (email, name)
|
|
10549
10564
|
- Step 2: Shipping address form
|
|
10550
10565
|
- Step 3: Shipping method selection (from rates returned by \`setShippingAddress()\`)
|
|
10551
|
-
- Step 4: Payment (auto-detects Stripe/Grow/PayPal via \`getPaymentProviders()\`)
|
|
10566
|
+
- Step 4: Payment (auto-detects Stripe/Grow/PayPal/Sandbox via \`getPaymentProviders()\`)
|
|
10567
|
+
- If \`sandboxPaymentsEnabled\` is on, a sandbox provider with \`renderType: 'sandbox'\` is included \u2014 show a "Complete Test Order" button instead of real payment UI. Call \`completeGuestCheckout(checkoutId)\` to finalize.
|
|
10552
10568
|
- Order summary sidebar showing \`checkout.lineItems\` (NOT cart.items!)
|
|
10553
10569
|
- Tax display after address entry
|
|
10554
10570
|
- Reservation countdown
|
|
@@ -10790,6 +10806,9 @@ function formatCapabilities(caps) {
|
|
|
10790
10806
|
lines.push(
|
|
10791
10807
|
`- Email verification: ${caps.connection.requireEmailVerification ? "required" : "not required"}`
|
|
10792
10808
|
);
|
|
10809
|
+
lines.push(
|
|
10810
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "enabled (test orders without real payment)" : "disabled"}`
|
|
10811
|
+
);
|
|
10793
10812
|
lines.push(
|
|
10794
10813
|
`- Inventory reservation: ${caps.connection.reservationStrategy} (${caps.connection.reservationTimeout} min timeout)`
|
|
10795
10814
|
);
|
|
@@ -10829,6 +10848,11 @@ function formatCapabilities(caps) {
|
|
|
10829
10848
|
'Email verification is required \u2014 ALWAYS build the verify-email page. Use get-code-example("verify-email").'
|
|
10830
10849
|
);
|
|
10831
10850
|
}
|
|
10851
|
+
if (caps.connection.sandboxPaymentsEnabled) {
|
|
10852
|
+
suggestions.push(
|
|
10853
|
+
`Sandbox payments are enabled \u2014 the PaymentStep component shows a "Complete Test Order" button when renderType is 'sandbox'. No real charges. Test orders are marked isTestOrder: true.`
|
|
10854
|
+
);
|
|
10855
|
+
}
|
|
10832
10856
|
if (caps.connection.reservationStrategy !== "ON_PAYMENT") {
|
|
10833
10857
|
suggestions.push(
|
|
10834
10858
|
'Inventory reservation is active \u2014 show a countdown timer. Use get-code-example("reservation-countdown").'
|
|
@@ -10982,6 +11006,9 @@ function formatCapabilitiesSummary(caps) {
|
|
|
10982
11006
|
lines.push(
|
|
10983
11007
|
`- Guest checkout tracking: ${caps.connection.guestCheckoutTracking ? "enabled" : "disabled"}`
|
|
10984
11008
|
);
|
|
11009
|
+
lines.push(
|
|
11010
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "ENABLED \u2014 payment step shows test order button (no real charges)" : "disabled"}`
|
|
11011
|
+
);
|
|
10985
11012
|
return lines.join("\n");
|
|
10986
11013
|
}
|
|
10987
11014
|
function buildStoreBundle(options) {
|
package/dist/index.mjs
CHANGED
|
@@ -284,6 +284,20 @@ function CheckoutPage() {
|
|
|
284
284
|
if (!paymentData) return <div>Unable to initialize payment</div>;
|
|
285
285
|
|
|
286
286
|
// Render payment UI based on provider
|
|
287
|
+
if (paymentData.provider === 'sandbox') {
|
|
288
|
+
return (
|
|
289
|
+
<div className="text-center p-6 bg-amber-50 border border-amber-200 rounded-lg">
|
|
290
|
+
<h3 className="font-semibold mb-2">Test Mode</h3>
|
|
291
|
+
<p className="text-sm text-gray-600 mb-4">No real payment will be charged.</p>
|
|
292
|
+
<button onClick={async () => {
|
|
293
|
+
await client.completeGuestCheckout(checkoutId);
|
|
294
|
+
window.location.href = \\\`/order-confirmation?checkout_id=\\\${checkoutId}\\\`;
|
|
295
|
+
}} className="bg-amber-500 text-white px-6 py-2 rounded">
|
|
296
|
+
Complete Test Order
|
|
297
|
+
</button>
|
|
298
|
+
</div>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
287
301
|
if (paymentData.provider === 'grow') {
|
|
288
302
|
return <GrowPaymentForm paymentUrl={paymentData.clientSecret} checkoutId={paymentData.checkoutId} />;
|
|
289
303
|
}
|
|
@@ -402,11 +416,12 @@ const growProvider = providers.find(p => p.provider === 'grow');
|
|
|
402
416
|
const paypalProvider = providers.find(p => p.provider === 'paypal');
|
|
403
417
|
\`\`\`
|
|
404
418
|
|
|
405
|
-
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
419
|
+
Each provider has: \`id\`, \`provider\` ('stripe'|'grow'|'paypal'|'sandbox'), \`name\`, \`publicKey\`, \`stripeAccountId\` (Stripe only), \`supportedMethods\`, \`testMode\`, \`isDefault\`.
|
|
406
420
|
|
|
407
421
|
- **Stripe:** \`npm install @stripe/stripe-js @stripe/react-stripe-js\` \u2014 \`loadStripe(publicKey, { stripeAccount })\`
|
|
408
422
|
- **Grow:** No SDK \u2014 uses iframe with payment URL. Supports credit cards, Bit, Apple Pay, Google Pay.
|
|
409
|
-
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons
|
|
423
|
+
- **PayPal:** \`npm install @paypal/react-paypal-js\` \u2014 \`PayPalScriptProvider\` + \`PayPalButtons\`
|
|
424
|
+
- **Sandbox:** No SDK needed \u2014 when \`sandboxPaymentsEnabled\` is true, \`getPaymentProviders()\` includes a sandbox provider with \`renderType: 'sandbox'\`. Show a "Complete Test Order" button. Call \`completeGuestCheckout(checkoutId)\` to finalize. Orders are marked \`isTestOrder: true\`.`;
|
|
410
425
|
}
|
|
411
426
|
function getProductsSection(_currency) {
|
|
412
427
|
return `## Products & Variants
|
|
@@ -10503,7 +10518,8 @@ var DETAILED = `# Required Pages \u2014 Detailed Guide
|
|
|
10503
10518
|
- Step 1: Customer info (email, name)
|
|
10504
10519
|
- Step 2: Shipping address form
|
|
10505
10520
|
- Step 3: Shipping method selection (from rates returned by \`setShippingAddress()\`)
|
|
10506
|
-
- Step 4: Payment (auto-detects Stripe/Grow/PayPal via \`getPaymentProviders()\`)
|
|
10521
|
+
- Step 4: Payment (auto-detects Stripe/Grow/PayPal/Sandbox via \`getPaymentProviders()\`)
|
|
10522
|
+
- If \`sandboxPaymentsEnabled\` is on, a sandbox provider with \`renderType: 'sandbox'\` is included \u2014 show a "Complete Test Order" button instead of real payment UI. Call \`completeGuestCheckout(checkoutId)\` to finalize.
|
|
10507
10523
|
- Order summary sidebar showing \`checkout.lineItems\` (NOT cart.items!)
|
|
10508
10524
|
- Tax display after address entry
|
|
10509
10525
|
- Reservation countdown
|
|
@@ -10745,6 +10761,9 @@ function formatCapabilities(caps) {
|
|
|
10745
10761
|
lines.push(
|
|
10746
10762
|
`- Email verification: ${caps.connection.requireEmailVerification ? "required" : "not required"}`
|
|
10747
10763
|
);
|
|
10764
|
+
lines.push(
|
|
10765
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "enabled (test orders without real payment)" : "disabled"}`
|
|
10766
|
+
);
|
|
10748
10767
|
lines.push(
|
|
10749
10768
|
`- Inventory reservation: ${caps.connection.reservationStrategy} (${caps.connection.reservationTimeout} min timeout)`
|
|
10750
10769
|
);
|
|
@@ -10784,6 +10803,11 @@ function formatCapabilities(caps) {
|
|
|
10784
10803
|
'Email verification is required \u2014 ALWAYS build the verify-email page. Use get-code-example("verify-email").'
|
|
10785
10804
|
);
|
|
10786
10805
|
}
|
|
10806
|
+
if (caps.connection.sandboxPaymentsEnabled) {
|
|
10807
|
+
suggestions.push(
|
|
10808
|
+
`Sandbox payments are enabled \u2014 the PaymentStep component shows a "Complete Test Order" button when renderType is 'sandbox'. No real charges. Test orders are marked isTestOrder: true.`
|
|
10809
|
+
);
|
|
10810
|
+
}
|
|
10787
10811
|
if (caps.connection.reservationStrategy !== "ON_PAYMENT") {
|
|
10788
10812
|
suggestions.push(
|
|
10789
10813
|
'Inventory reservation is active \u2014 show a countdown timer. Use get-code-example("reservation-countdown").'
|
|
@@ -10937,6 +10961,9 @@ function formatCapabilitiesSummary(caps) {
|
|
|
10937
10961
|
lines.push(
|
|
10938
10962
|
`- Guest checkout tracking: ${caps.connection.guestCheckoutTracking ? "enabled" : "disabled"}`
|
|
10939
10963
|
);
|
|
10964
|
+
lines.push(
|
|
10965
|
+
`- Sandbox payments: ${caps.connection.sandboxPaymentsEnabled ? "ENABLED \u2014 payment step shows test order button (no real charges)" : "disabled"}`
|
|
10966
|
+
);
|
|
10940
10967
|
return lines.join("\n");
|
|
10941
10968
|
}
|
|
10942
10969
|
function buildStoreBundle(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainerce/mcp-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "MCP server for AI-powered Brainerce store building. Provides SDK docs, types, and code examples to AI tools like Lovable, Cursor, and Claude Code.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"brainerce-mcp": "dist/bin/stdio.js"
|