Skip to content

Commit a2049ce

Browse files
authored
chore: update Script API documentation to version 26.2 (#100)
- New PayPal methods in SalesforcePaymentsMgr (refundPayPalOrderCapture, voidPayPalOrderAuthorization) - Cookie methods deprecated for RFC 6265 compliance (comment, version) - Request.addHttpCookie deprecated (removed in 99.2) - Add /update-script-api-docs command for future updates
1 parent 55397bf commit a2049ce

6 files changed

Lines changed: 204 additions & 34 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Update Script API Documentation
2+
3+
Download the latest B2C Commerce Script API documentation from the configured sandbox and update the bundled docs in the SDK.
4+
5+
## Steps
6+
7+
1. Download Script API docs from the configured sandbox using `./cli docs download`
8+
2. Replace the markdown files in `packages/b2c-tooling-sdk/data/script-api/`
9+
3. Regenerate the search index with `pnpm --filter @salesforce/b2c-tooling-sdk run generate:docs-index`
10+
4. Show the version extracted from `index.md` header
11+
5. Show git status/diff summary of what changed
12+
13+
## Commands to Run
14+
15+
```bash
16+
# Download to temp directory
17+
./cli docs download /tmp/script-api-docs-update
18+
19+
# Check version
20+
head -1 /tmp/script-api-docs-update/index.md
21+
22+
# Replace existing files
23+
rm -f packages/b2c-tooling-sdk/data/script-api/*.md
24+
cp /tmp/script-api-docs-update/*.md packages/b2c-tooling-sdk/data/script-api/
25+
26+
# Regenerate index
27+
pnpm --filter @salesforce/b2c-tooling-sdk run generate:docs-index
28+
29+
# Show changes
30+
git status packages/b2c-tooling-sdk/data/script-api/ --short
31+
git diff packages/b2c-tooling-sdk/data/script-api/*.md --stat
32+
33+
# Cleanup
34+
rm -rf /tmp/script-api-docs-update
35+
```
36+
37+
After running, summarize:
38+
- The Script API version (from index.md header like "# B2C Commerce Script API 26.2")
39+
- Number of files updated
40+
- Key changes (new classes, deprecated methods, etc.)

packages/b2c-tooling-sdk/data/script-api/dw.extensions.payments.SalesforcePaymentsMgr.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ This class does not have a constructor, so you cannot create it directly.
5959
| static [handleAdyenAdditionalDetails](dw.extensions.payments.SalesforcePaymentsMgr.md#handleadyenadditionaldetailsorder-string-object)([Order](dw.order.Order.md), [String](TopLevel.String.md), [Object](TopLevel.Object.md)) | <p> Handles the given additional Adyen payment details and associates the associated payment with the given order, if applicable. |
6060
| static [onCustomerRegistered](dw.extensions.payments.SalesforcePaymentsMgr.md#oncustomerregisteredorder)([Order](dw.order.Order.md)) | Handles the account registration of the shopper who placed the given order. |
6161
| static [refundAdyenPayment](dw.extensions.payments.SalesforcePaymentsMgr.md#refundadyenpaymentorderpaymentinstrument-money-object)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [Money](dw.value.Money.md), [Object](TopLevel.Object.md)) | Refunds previously captured funds for the given order payment instrument. |
62+
| static [refundPayPalOrderCapture](dw.extensions.payments.SalesforcePaymentsMgr.md#refundpaypalordercapturesalesforcepaypalorder)([SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)) | Refunds the capture for the given PayPal order. |
6263
| static [refundPaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#refundpaymentintentsalesforcepaymentintent-money-object)([SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), [Money](dw.value.Money.md), [Object](TopLevel.Object.md)) | Refunds previously captured funds for the given payment intent. |
6364
| static [removeAdyenSavedPaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#removeadyensavedpaymentmethodsalesforceadyensavedpaymentmethod)([SalesforceAdyenSavedPaymentMethod](dw.extensions.payments.SalesforceAdyenSavedPaymentMethod.md)) | Deletes an Adyen saved payment method. |
6465
| static [removeSavedPaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#removesavedpaymentmethodsalesforcepaymentmethod)([SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)) | Removes the given saved payment method so that it is no longer presented to the given customer for reuse in checkouts. |
@@ -67,6 +68,7 @@ This class does not have a constructor, so you cannot create it directly.
6768
| static [savePaymentMethod](dw.extensions.payments.SalesforcePaymentsMgr.md#savepaymentmethodcustomer-salesforcepaymentmethod)([Customer](dw.customer.Customer.md), [SalesforcePaymentMethod](dw.extensions.payments.SalesforcePaymentMethod.md)) | Saves the given payment method to be presented to the given customer for reuse in subsequent checkouts. |
6869
| static [setPaymentDetails](dw.extensions.payments.SalesforcePaymentsMgr.md#setpaymentdetailsorderpaymentinstrument-salesforcepaymentdetails)([OrderPaymentInstrument](dw.order.OrderPaymentInstrument.md), [SalesforcePaymentDetails](dw.extensions.payments.SalesforcePaymentDetails.md)) | Sets the details to the Salesforce Payments payment associated with the given payment instrument. |
6970
| static [updatePaymentIntent](dw.extensions.payments.SalesforcePaymentsMgr.md#updatepaymentintentsalesforcepaymentintent-shipment-money-string-object)([SalesforcePaymentIntent](dw.extensions.payments.SalesforcePaymentIntent.md), [Shipment](dw.order.Shipment.md), [Money](dw.value.Money.md), [String](TopLevel.String.md), [Object](TopLevel.Object.md)) | Updates the provided information in the given payment intent. |
71+
| static [voidPayPalOrderAuthorization](dw.extensions.payments.SalesforcePaymentsMgr.md#voidpaypalorderauthorizationsalesforcepaypalorder)([SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)) | Voids the authorization for the given PayPal order. |
7072

7173
### Methods inherited from class Object
7274

@@ -745,6 +747,29 @@ use [getSavedPaymentMethods(Customer)](dw.extensions.payments.SalesforcePayments
745747
- Exception - if there was an error refunding the payment instrument
746748

747749

750+
---
751+
752+
### refundPayPalOrderCapture(SalesforcePayPalOrder)
753+
- static refundPayPalOrderCapture(paypalOrder: [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)): [Status](dw.system.Status.md)
754+
- : Refunds the capture for the given PayPal order.
755+
756+
757+
The PayPal order must have a capture in a status that supports refund. See the PayPal documentation for more
758+
details.
759+
760+
761+
**Parameters:**
762+
- paypalOrder - PayPal order whose capture to refund
763+
764+
**Returns:**
765+
- Status 'OK' or 'ERROR'. Status detail `'error'` contains the PayPal error information, if it
766+
is available in the response.
767+
768+
769+
**Throws:**
770+
- Exception - if there was an error refunding the capture for the PayPal order
771+
772+
748773
---
749774

750775
### refundPaymentIntent(SalesforcePaymentIntent, Money, Object)
@@ -936,6 +961,29 @@ use [getSavedPaymentMethods(Customer)](dw.extensions.payments.SalesforcePayments
936961
- Exception - if the parameter validation failed or there's an error updating the payment intent
937962

938963

964+
---
965+
966+
### voidPayPalOrderAuthorization(SalesforcePayPalOrder)
967+
- static voidPayPalOrderAuthorization(paypalOrder: [SalesforcePayPalOrder](dw.extensions.payments.SalesforcePayPalOrder.md)): [Status](dw.system.Status.md)
968+
- : Voids the authorization for the given PayPal order.
969+
970+
971+
The PayPal order must have an authorization in a status that supports voiding. See the PayPal documentation for
972+
more details.
973+
974+
975+
**Parameters:**
976+
- paypalOrder - PayPal order whose authorization to void
977+
978+
**Returns:**
979+
- Status 'OK' or 'ERROR'. Status detail `'error'` contains the PayPal error information, if it
980+
is available in the response.
981+
982+
983+
**Throws:**
984+
- Exception - if there was an error voiding the authorization for the PayPal order
985+
986+
939987
---
940988

941989
<!-- prettier-ignore-end -->

packages/b2c-tooling-sdk/data/script-api/dw.system.Request.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ Effectively always returns true.
391391
**Deprecated:**
392392
:::warning
393393
Use [Response.addHttpCookie(Cookie)](dw.system.Response.md#addhttpcookiecookie) instead.
394+
:::
395+
**API Version:**
396+
:::note
397+
No longer available as of version 99.2.
398+
This method is deprecated and will be removed in the next API version.
394399
:::
395400
396401
---

packages/b2c-tooling-sdk/data/script-api/dw.web.Cookie.md

Lines changed: 108 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
3030

3131
| Property | Description |
3232
| --- | --- |
33-
| [comment](#comment): [String](TopLevel.String.md) | Returns the comment associated with the cookie. |
33+
| ~~[comment](#comment): [String](TopLevel.String.md)~~ | Returns the comment that was previously set for this cookie, or null if no comment was set. |
3434
| [domain](#domain): [String](TopLevel.String.md) | Returns the domain associated with the cookie. |
3535
| [httpOnly](#httponly): [Boolean](TopLevel.Boolean.md) | Identifies if the cookie is http-only. |
3636
| [maxAge](#maxage): [Number](TopLevel.Number.md) | Returns the maximum age of the cookie, specified in seconds. |
3737
| [name](#name): [String](TopLevel.String.md) `(read-only)` | Returns the cookie's name. |
3838
| [path](#path): [String](TopLevel.String.md) | Returns the path for the cookie. |
3939
| [secure](#secure): [Boolean](TopLevel.Boolean.md) | Identifies if the cookie is secure. |
4040
| [value](#value): [String](TopLevel.String.md) | Returns the cookie's value. |
41-
| [version](#version): [Number](TopLevel.Number.md) | Returns the version for the cookie. |
41+
| ~~[version](#version): [Number](TopLevel.Number.md)~~ | Returns the version that was previously set for this cookie. |
4242

4343
## Constructor Summary
4444

@@ -50,23 +50,23 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
5050

5151
| Method | Description |
5252
| --- | --- |
53-
| [getComment](dw.web.Cookie.md#getcomment)() | Returns the comment associated with the cookie. |
53+
| ~~[getComment](dw.web.Cookie.md#getcomment)()~~ | Returns the comment that was previously set for this cookie, or null if no comment was set. |
5454
| [getDomain](dw.web.Cookie.md#getdomain)() | Returns the domain associated with the cookie. |
5555
| [getMaxAge](dw.web.Cookie.md#getmaxage)() | Returns the maximum age of the cookie, specified in seconds. |
5656
| [getName](dw.web.Cookie.md#getname)() | Returns the cookie's name. |
5757
| [getPath](dw.web.Cookie.md#getpath)() | Returns the path for the cookie. |
5858
| [getSecure](dw.web.Cookie.md#getsecure)() | Identifies if the cookie is secure. |
5959
| [getValue](dw.web.Cookie.md#getvalue)() | Returns the cookie's value. |
60-
| [getVersion](dw.web.Cookie.md#getversion)() | Returns the version for the cookie. |
60+
| ~~[getVersion](dw.web.Cookie.md#getversion)()~~ | Returns the version that was previously set for this cookie. |
6161
| [isHttpOnly](dw.web.Cookie.md#ishttponly)() | Identifies if the cookie is http-only. |
62-
| [setComment](dw.web.Cookie.md#setcommentstring)([String](TopLevel.String.md)) | Sets the comment associated with the cookie. |
62+
| ~~[setComment](dw.web.Cookie.md#setcommentstring)([String](TopLevel.String.md))~~ | Sets a comment associated with this cookie. |
6363
| [setDomain](dw.web.Cookie.md#setdomainstring)([String](TopLevel.String.md)) | Sets the domain associated with the cookie. |
6464
| [setHttpOnly](dw.web.Cookie.md#sethttponlyboolean)([Boolean](TopLevel.Boolean.md)) | Sets the http-only state for the cookie. |
6565
| [setMaxAge](dw.web.Cookie.md#setmaxagenumber)([Number](TopLevel.Number.md)) | Sets the maximum age of the cookie in seconds. |
6666
| [setPath](dw.web.Cookie.md#setpathstring)([String](TopLevel.String.md)) | Sets the path for the cookie. |
6767
| [setSecure](dw.web.Cookie.md#setsecureboolean)([Boolean](TopLevel.Boolean.md)) | Sets the secure state for the cookie. |
6868
| [setValue](dw.web.Cookie.md#setvaluestring)([String](TopLevel.String.md)) | Sets the cookie's value. |
69-
| [setVersion](dw.web.Cookie.md#setversionnumber)([Number](TopLevel.Number.md)) | Sets the version for the cookie. |
69+
| ~~[setVersion](dw.web.Cookie.md#setversionnumber)([Number](TopLevel.Number.md))~~ | Returns the version that was previously set for this cookie. |
7070

7171
### Methods inherited from class Object
7272

@@ -84,10 +84,25 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
8484
## Property Details
8585

8686
### comment
87-
- comment: [String](TopLevel.String.md)
88-
- : Returns the comment associated with the cookie.
87+
- ~~comment: [String](TopLevel.String.md)~~
88+
- : Returns the comment that was previously set for this cookie, or null if no comment was set. Note that comments
89+
are no longer supported in RFC 6265 and will not be sent to clients. This method is maintained for backward
90+
compatibility only.
8991

9092

93+
**Deprecated:**
94+
:::warning
95+
This method is maintained for backward compatibility only. Cookie comments were removed in RFC 6265
96+
and are no longer sent to clients. The returned value only reflects what was previously set using
97+
[setComment(String)](dw.web.Cookie.md#setcommentstring).
98+
99+
:::
100+
**API Version:**
101+
:::note
102+
No longer available as of version 99.2.
103+
This method is deprecated and will be removed in the next API version.
104+
:::
105+
91106
---
92107

93108
### domain
@@ -142,11 +157,24 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
142157
---
143158

144159
### version
145-
- version: [Number](TopLevel.Number.md)
146-
- : Returns the version for the cookie. 0 means original Netscape cookie and
147-
1 means RFC 2109 compliant cookie.
160+
- ~~version: [Number](TopLevel.Number.md)~~
161+
- : Returns the version that was previously set for this cookie. Note that the version is no longer used for
162+
determining cookie compliance as the system now uses RFC 6265 by default. The returned value only reflects what
163+
was previously set using [setVersion(Number)](dw.web.Cookie.md#setversionnumber).
164+
148165

166+
**Deprecated:**
167+
:::warning
168+
This method is maintained for backward compatibility only. The version property is no longer used as
169+
the system now uses RFC 6265 compliance by default. The returned value has no effect on cookie
170+
behavior.
149171

172+
:::
173+
**API Version:**
174+
:::note
175+
No longer available as of version 99.2.
176+
This method is deprecated and will be removed in the next API version.
177+
:::
150178

151179
---
152180

@@ -166,12 +194,27 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
166194
## Method Details
167195

168196
### getComment()
169-
- getComment(): [String](TopLevel.String.md)
170-
- : Returns the comment associated with the cookie.
197+
- ~~getComment(): [String](TopLevel.String.md)~~
198+
- : Returns the comment that was previously set for this cookie, or null if no comment was set. Note that comments
199+
are no longer supported in RFC 6265 and will not be sent to clients. This method is maintained for backward
200+
compatibility only.
201+
171202

172203
**Returns:**
173-
- the comment associated with the cookie.
204+
- the comment that was previously set, or null if no comment was set
205+
206+
**Deprecated:**
207+
:::warning
208+
This method is maintained for backward compatibility only. Cookie comments were removed in RFC 6265
209+
and are no longer sent to clients. The returned value only reflects what was previously set using
210+
[setComment(String)](dw.web.Cookie.md#setcommentstring).
174211

212+
:::
213+
**API Version:**
214+
:::note
215+
No longer available as of version 99.2.
216+
This method is deprecated and will be removed in the next API version.
217+
:::
175218

176219
---
177220

@@ -240,14 +283,27 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
240283
---
241284

242285
### getVersion()
243-
- getVersion(): [Number](TopLevel.Number.md)
244-
- : Returns the version for the cookie. 0 means original Netscape cookie and
245-
1 means RFC 2109 compliant cookie.
286+
- ~~getVersion(): [Number](TopLevel.Number.md)~~
287+
- : Returns the version that was previously set for this cookie. Note that the version is no longer used for
288+
determining cookie compliance as the system now uses RFC 6265 by default. The returned value only reflects what
289+
was previously set using [setVersion(Number)](dw.web.Cookie.md#setversionnumber).
246290

247291

248292
**Returns:**
249-
- the version for the cookie.
293+
- the version number that was set, or 0 if no version was explicitly set
294+
295+
**Deprecated:**
296+
:::warning
297+
This method is maintained for backward compatibility only. The version property is no longer used as
298+
the system now uses RFC 6265 compliance by default. The returned value has no effect on cookie
299+
behavior.
250300

301+
:::
302+
**API Version:**
303+
:::note
304+
No longer available as of version 99.2.
305+
This method is deprecated and will be removed in the next API version.
306+
:::
251307

252308
---
253309

@@ -262,17 +318,25 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
262318
---
263319

264320
### setComment(String)
265-
- setComment(comment: [String](TopLevel.String.md)): void
266-
- : Sets the comment associated with the cookie.
267-
268-
Setting a comment automatically changes the cookie to be a RFC 2109
269-
(set-cookie2) compliant cookie, because comments are only supported with
270-
RFC cookies and not with Netscapes original cookie.
321+
- ~~setComment(comment: [String](TopLevel.String.md)): void~~
322+
- : Sets a comment associated with this cookie. Note that comments are no longer sent to clients as they were removed
323+
in RFC 6265. This method is maintained for backward compatibility but has no effect on the cookie's behavior.
271324

272325

273326
**Parameters:**
274-
- comment - the comment associated with the cookie.
327+
- comment - the comment to associate with the cookie (ignored)
328+
329+
**Deprecated:**
330+
:::warning
331+
This method is maintained for backward compatibility only. Cookie comments were removed in RFC 6265
332+
and will not be sent to clients. The value will be stored but has no effect on cookie behavior.
275333

334+
:::
335+
**API Version:**
336+
:::note
337+
No longer available as of version 99.2.
338+
This method is deprecated and will be removed in the next API version.
339+
:::
276340

277341
---
278342

@@ -346,14 +410,27 @@ See [Request.getHttpCookies()](dw.system.Request.md#gethttpcookies).
346410
---
347411

348412
### setVersion(Number)
349-
- setVersion(version: [Number](TopLevel.Number.md)): void
350-
- : Sets the version for the cookie. 0 means original Netscape cookie and
351-
1 means RFC 2109 compliant cookie. The default is 0.
413+
- ~~setVersion(version: [Number](TopLevel.Number.md)): void~~
414+
- : Returns the version that was previously set for this cookie. Note that the version is no longer used for
415+
determining cookie compliance as the system now uses RFC 6265 by default. The returned value only reflects what
416+
was previously set using [setVersion(Number)](dw.web.Cookie.md#setversionnumber).
352417

353418

354-
**Parameters:**
355-
- version - the version for the cookie.
356-
419+
**Returns:**
420+
- the version number that was set, or 0 if no version was explicitly set
421+
422+
**Deprecated:**
423+
:::warning
424+
This method is maintained for backward compatibility only. The version property is no longer used as
425+
the system now uses RFC 6265 compliance by default. The returned value has no effect on cookie
426+
behavior.
427+
428+
:::
429+
**API Version:**
430+
:::note
431+
No longer available as of version 99.2.
432+
This method is deprecated and will be removed in the next API version.
433+
:::
357434

358435
---
359436

packages/b2c-tooling-sdk/data/script-api/index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "1.0.0",
3-
"generatedAt": "2026-01-10T22:14:13.490Z",
3+
"generatedAt": "2026-01-31T17:45:14.666Z",
44
"entries": [
55
{
66
"id": "dw.alert",
@@ -2755,7 +2755,7 @@
27552755
},
27562756
{
27572757
"id": "index",
2758-
"title": "B2C Commerce Script API 26.1",
2758+
"title": "B2C Commerce Script API 26.2",
27592759
"filePath": "index.md"
27602760
},
27612761
{

packages/b2c-tooling-sdk/data/script-api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# B2C Commerce Script API 26.1
1+
# B2C Commerce Script API 26.2
22

33
## Packages
44
| Package | Description |

0 commit comments

Comments
 (0)