Repository navigation
STF-2488: Update verification input documentation #1997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,25 @@ | ||
| CHANGELOG | ||
| ========= | ||
|
|
||
| 9.3.0 (unreleased) | ||
| ------------------ | ||
|
|
||
| * Updated the documentation for the email and phone verification inputs. Set | ||
| `wasVerificationSuccessful` and `phoneWasVerificationSuccessful` to `true` | ||
| if your system considers the email address or phone number verified as of | ||
| the time of the event. Set them to `false` if it is not verified, for | ||
| example if its only verification is pending or failed. If your system does | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entry does not tell 9.2.x users that one rule is now reversed. The 9.2.x TSDoc said "Omit this if no verification was attempted" for both This entry gives only "pending or failed" as examples of Suggest adding the case and the reversal, for example: "This includes one that you did not try to verify. The 9.2.0 documentation said to leave them unset in that case." The same comment is on the .NET, PHP, and Ruby PRs. 🤖 Comment by Claude Opus 5.5. |
||
| not track verification, leave them unset. Set a verification time only when | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this entry does not say that Suggest one more sentence, for example: "The verification time is now the time of the verification behind a The Java PR has the same comment. 🤖 Comment by Claude Opus 5.5. |
||
| the value is `true`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this entry does not mention the new 🤖 Comment by Claude Opus 5.5. |
||
| * Exported the request property types from the package root: `AccountProps`, | ||
| `CreditCardProps`, `DeviceProps`, `EmailProps`, `EventProps`, | ||
| `LocationProps`, `OrderProps`, `PaymentProps`, `ShippingProps`, | ||
| `ShoppingCartItemProps`, `TransactionProps`, and `TransactionReportProps`. | ||
| The API documentation now shows the descriptions of the request properties | ||
| that inherit them from these types. | ||
| * The package now keeps the documentation comments in its type declarations, | ||
| so editors show them. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: without 🤖 Comment by Claude Opus 5.5. |
||
|
|
||
| 9.2.1 (2026-11-18) | ||
| ------------------ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,18 @@ export { | |
| WebServiceError, | ||
| }; | ||
|
|
||
| export type { AccountProps } from './request/account.js'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: no test uses the new type exports. 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENG-5885 tracks this as a follow-up. It proposes to add type-only imports of each exported type to 🤖 Comment by Claude Opus 5.5. |
||
| export type { CreditCardProps } from './request/credit-card.js'; | ||
| export type { DeviceProps } from './request/device.js'; | ||
| export type { EmailProps } from './request/email.js'; | ||
| export type { EventProps } from './request/event.js'; | ||
| export type { LocationProps } from './request/location.js'; | ||
| export type { OrderProps } from './request/order.js'; | ||
| export type { PaymentProps } from './request/payment.js'; | ||
| export type { ShippingProps } from './request/shipping.js'; | ||
| export type { ShoppingCartItemProps } from './request/shopping-cart-item.js'; | ||
| export type { TransactionProps } from './request/transaction.js'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this export makes 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENG-5885 tracks this, together with the other doc comments that this PR makes visible. It proposes to describe 🤖 Comment by Claude Opus 5.5. |
||
| export type { TransactionReportProps } from './request/transaction-report.js'; | ||
| export type { | ||
| ClientErrorCode, | ||
| WebServiceClientError, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import crypto from 'node:crypto'; | ||
|
|
||
| interface AccountProps { | ||
| export interface AccountProps { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The CHANGELOG says that editors now show the comments. That is not true for these classes, and Suggested fix: 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENG-5885 tracks this as a follow-up. It proposes to add the 🤖 Comment by Claude Opus 5.5. |
||
| /** | ||
| * A unique user ID associated with the end-user in your system. If your | ||
| * system allows the login name for the account to be changed, this should | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ const isEmail = (value: string): boolean => { | |
| return match !== null && isFQDN(match[2]); | ||
| }; | ||
|
|
||
| interface EmailProps { | ||
| export interface EmailProps { | ||
| /** | ||
| * The email address used in the transaction. | ||
| */ | ||
|
|
@@ -53,16 +53,23 @@ interface EmailProps { | |
| */ | ||
| hashAddress?: boolean; | ||
| /** | ||
| * The date and time of the most recent attempt to verify the email address, | ||
| * if known. The time must not be before 1970-01-01T00:00:00Z or more than two | ||
| * days in the future. The web service ignores a time outside this range and | ||
| * returns a warning. | ||
| * The date and time that the end user completed the most recent verification | ||
| * of the email address, if known. Set this only if | ||
| * `wasVerificationSuccessful` is `true`. The time must not be before | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: the specs still send a verification time with
Readers copy request shapes from tests. Suggestion: use 🤖 Comment by Claude Opus 5.5. |
||
| * 1970-01-01T00:00:00Z or more than two days in the future. The web service | ||
| * ignores a time outside this range and returns a warning. | ||
| */ | ||
| verificationTime?: Date; | ||
| /** | ||
| * Whether the most recent verification that the end user controls the email | ||
| * address succeeded, for example by confirming a link sent to the address. | ||
| * Omit this if no verification was attempted. | ||
| * Whether the end user has verified that they control the email address, as | ||
| * of the time of the event, for example by confirming a link sent to the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: "as of the time of the event, for example by confirming a link sent to the address" puts the example after the time phrase. It reads as an example of the time, not of how the user verified the address. maxmind/openapi#28 puts the example in a separate sentence: "For example, the user clicked a link that you sent to the address." Suggest the same here, for example: "Whether the end user has verified that they control the email address, as of the time of the event. For example, the user confirmed a link sent to the address." The same comment is on the Java and .NET PRs. 🤖 Comment by Claude Opus 5.5. |
||
| * address. Set this to `true` if your system considers the email address | ||
| * verified as of the time of the event. An earlier completed verification | ||
| * still counts, even if a newer attempt is pending or failed. Set it to | ||
| * `false` if the email address is not verified. This includes one whose only | ||
| * verification is pending or failed, and one that you did not try to verify. | ||
| * Omitting this is not equivalent to `false`. If your system does not track | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The text does not say to send a value on every request. The dev-site text for STF-2488 says: "Send The phone field ( 🤖 Comment by Claude Opus 5.5. |
||
| * email verification, omit this. | ||
| */ | ||
| wasVerificationSuccessful?: boolean; | ||
| } | ||
|
|
@@ -78,18 +85,9 @@ export default class Email implements EmailProps { | |
| public address?: string; | ||
| /** @inheritDoc EmailProps.domain */ | ||
| public domain?: string; | ||
| /** | ||
| * The date and time of the most recent attempt to verify the email address, | ||
| * if known. The time must not be before 1970-01-01T00:00:00Z or more than two | ||
| * days in the future. The web service ignores a time outside this range and | ||
| * returns a warning. | ||
| */ | ||
| /** @inheritDoc EmailProps.verificationTime */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: in editor hovers, TypeScript adds the For a class that 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENG-5885 tracks this as a follow-up. After the four classes named in the comment on 🤖 Comment by Claude Opus 5.5. |
||
| public verificationTime?: Date; | ||
| /** | ||
| * Whether the most recent verification that the end user controls the email | ||
| * address succeeded, for example by confirming a link sent to the address. | ||
| * Omit this if no verification was attempted. | ||
| */ | ||
| /** @inheritDoc EmailProps.wasVerificationSuccessful */ | ||
| public wasVerificationSuccessful?: boolean; | ||
|
|
||
| private static readonly typoDomains: { [key: string]: string } = { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,19 +49,29 @@ export interface LocationProps { | |
| */ | ||
| phoneCountryCode?: string; | ||
| /** | ||
| * The most recent method used to verify the phone number. | ||
| * The method used for the most recent completed verification of the phone | ||
| * number. If the phone number is not verified, you can set the method of the | ||
| * most recent attempt if your system records it. Do not set this if you did | ||
| * not try to verify the phone number. | ||
| */ | ||
| phoneVerificationMethod?: PhoneVerificationMethod; | ||
| /** | ||
| * The date and time of the most recent verification of the phone number. | ||
| * The time must not be before 1970-01-01T00:00:00Z or more than two days in | ||
| * the future. The web service ignores a time outside this range and returns | ||
| * a warning. | ||
| * The date and time that the end user completed the most recent verification | ||
| * of the phone number, if known. Set this only if | ||
| * `phoneWasVerificationSuccessful` is `true`. The time must not be before | ||
| * 1970-01-01T00:00:00Z or more than two days in the future. The web service | ||
| * ignores a time outside this range and returns a warning. | ||
| */ | ||
| phoneVerificationTime?: Date; | ||
| /** | ||
| * Whether the most recent verification of the phone number succeeded. Omit | ||
| * this if no verification was attempted. | ||
| * Whether the end user has verified that they control the phone number, as of | ||
| * the time of the event. Set this to `true` if your system considers the | ||
| * phone number verified as of the time of the event. An earlier completed | ||
| * verification still counts, even if a newer attempt is pending or failed. | ||
| * Set it to `false` if the phone number is not verified. This includes one | ||
| * whose only verification is pending or failed, and one that you did not try | ||
| * to verify. Omitting this is not equivalent to `false`. If your system does | ||
| * not track phone verification, omit this. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The text does not include "The choice can affect risk scores." The dev-site text for STF-2488 keeps this sentence. It tells the merchant why the choice between The email field ( 🤖 Comment by Claude Opus 5.5. |
||
| */ | ||
| phoneWasVerificationSuccessful?: boolean; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import { Tag } from '../constants.js'; | |
| import { ArgumentError } from '../errors.js'; | ||
| import { snakecaseKeys } from '../utils.js'; | ||
|
|
||
| interface TransactionReportProps { | ||
| export interface TransactionReportProps { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this export makes the 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENG-5885 tracks this, together with the other doc comments that this PR makes visible. It proposes to change 🤖 Comment by Claude Opus 5.5. |
||
| /** | ||
| * A string which is provided by your payment processor indicating the | ||
| * reason for the chargeback. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ | |
| "moduleResolution": "NodeNext", | ||
| "outDir": "dist", | ||
| "pretty": true, | ||
| "removeComments": true, | ||
| "resolveJsonModule": true, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: without
Suggestion: correct the 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENG-5885 tracks this, together with the other doc comments that this PR makes visible. It proposes to correct the 🤖 Comment by Claude Opus 5.5. |
||
| "skipLibCheck": true, | ||
| "strict": true, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "Set them to
falseif it is not verified, for example if its only verification is pending or failed" changes from "them" (the properties) to "it" (the email address or phone number). A reader can take "it" to mean the properties.Suggest: "Set them to
falseif the email address or phone number is not verified, for example if its only verification is pending or failed."The same comment is on the Java, .NET, and PHP PRs.
🤖 Comment by Claude Opus 5.5.