Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "Set them to false if 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 false if 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.

example if its only verification is pending or failed. If your system does

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 wasVerificationSuccessful and phoneWasVerificationSuccessful. Now a caller that tracks verification must send false for a contact that it did not try to verify.

This entry gives only "pending or failed" as examples of false. A caller that leaves the value unset for contacts with no attempt gets no signal to change its code.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this entry does not say that verificationTime changed meaning. The 9.2.x documentation described it as "The date and time of the most recent attempt to verify the email address". Now it is the time that the user completed the verification, and only for a true value. A caller that sends the time of the latest attempt, for example the time it sent the link, gets no signal to change.

Suggest one more sentence, for example: "The verification time is now the time of the verification behind a true value, not the time of the most recent attempt."

The Java PR has the same comment.

🤖 Comment by Claude Opus 5.5.

the value is `true`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this entry does not mention the new phoneVerificationMethod guidance. The method is now for the most recent completed verification. If the phone number is not verified, it can be the method of the most recent attempt. If there was no attempt, it is not set. A user who reads only the changelog does not learn this.

🤖 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: without removeComments, the .d.ts files now also keep the @deprecated tags. Examples: CreditCardProps.last4digits, CreditCard.last4digits, Factors.subscores, GeoIPCountry.isHighRisk, Subscores.emailTenure, and Subscores.ipTenure. Editors now show these members struck through. Projects that use @typescript-eslint/no-deprecated get new lint errors after a minor upgrade. Suggestion: add to this entry that deprecation markers are now visible to editors and type-aware linters.

🤖 Comment by Claude Opus 5.5.


9.2.1 (2026-11-18)
------------------

Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export enum DeliverySpeed {
export enum PhoneVerificationMethod {
/**
* A one-time code delivered to the phone number by SMS, an automated voice
* call, or a messaging app, and entered by the user.
* call, or a messaging app, for the user to enter.
*/
DeliveredCode = 'delivered_code',
/**
Expand Down
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ export {
WebServiceError,
};

export type { AccountProps } from './request/account.js';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: no test uses the new type exports. e2e/ts type-checks the published package, but it uses only minFraud.Transaction and minFraud.Device. If a later change removes one of these exports, CI still passes. Suggestion: add type-only imports of the *Props types to e2e/ts/index.spec.ts.

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 e2e/ts/index.spec.ts, so that the e2e test fails if a change removes an export.

🤖 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';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this export makes TransactionProps.billing resolve, so its comment now shows on the docs site for Transaction.billing. The comment at src/request/transaction.ts:21 says "Information about the account used in the transaction." That describes the account, not the billing address. Suggestion: "Information about the billing address used in the transaction."

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 TransactionProps.billing as the billing address used in the transaction.

🤖 Comment by Claude Opus 5.5.

export type { TransactionReportProps } from './request/transaction-report.js';
export type {
ClientErrorCode,
WebServiceClientError,
Expand Down
2 changes: 1 addition & 1 deletion src/request/account.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto from 'node:crypto';

interface AccountProps {
export interface AccountProps {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account, Transaction, TransactionReport, and Shipping do not implement their props interfaces. TypeScript resolves @inheritDoc only from a base type, so for these four classes the editor hover shows only the tag text, such as AccountProps.userId, and no description. I confirmed this with the TypeScript language service on the built dist files:

new Account({}).userId                   => "AccountProps.userId"
new Transaction({...}).billing           => "TransactionProps.billing"
new Email({}).wasVerificationSuccessful  => the full description

The CHANGELOG says that editors now show the comments. That is not true for these classes, and Transaction is the main entry point. The TypeDoc site is not affected, because TypeDoc resolves the explicit reference.

Suggested fix: class Account implements AccountProps, class Transaction implements TransactionProps, class TransactionReport implements TransactionReportProps, and class Shipping extends Location implements ShippingProps. With these changes, the build passes and the hovers show the descriptions.

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 implements clauses: Account implements AccountProps, Transaction implements TransactionProps, TransactionReport implements TransactionReportProps, and Shipping extends Location implements ShippingProps. The issue is done when an editor hover shows the full description for each request class member.

🤖 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
Expand Down
2 changes: 1 addition & 1 deletion src/request/device.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isIP } from 'node:net';
import { ArgumentError } from '../errors.js';

interface DeviceProps {
export interface DeviceProps {
/**
* The IP address associated with the device used by the customer in the
* transaction.
Expand Down
36 changes: 17 additions & 19 deletions src/request/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the specs still send a verification time with false, and this text now says not to do that:

  • src/request/email.spec.ts:11-12
  • src/request/location.spec.ts:30-31
  • src/request/transaction.spec.ts:259-260 and :295-296

Readers copy request shapes from tests. Suggestion: use true where a time is set, or remove the time from the false cases. A method with false, as in transaction.spec.ts:294, agrees with the new text.

🤖 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 true or false for every request that includes this email address." Without that sentence, a merchant that tracks verification can send true after a verification and leave the field out on other requests. "Omitting this is not equivalent to false" does not tell the merchant to always send a value.

The phone field (src/request/location.ts:73) has the same gap. Its sentence is "for every request that includes this phone number".

🤖 Comment by Claude Opus 5.5.

* email verification, omit this.
*/
wasVerificationSuccessful?: boolean;
}
Expand All @@ -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 */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: in editor hovers, TypeScript adds the @inheritDoc reference as a tag line. Each member that uses /** @inheritDoc XProps.y */ now ends with a line such as EmailProps.verificationTime. You can see this now because the .d.ts files keep comments. Hovering email.domain, for example, shows:

The domain of the email address.
EmailProps.domain

For a class that implements the props interface, TypeDoc and TypeScript both inherit the description from a member that has no comment. You can remove these @inheritDoc comments to remove the extra line. This applies to about 90 members in src/request/.

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 src/request/account.ts implement their props interfaces, each request class member inherits its description without a tag. The issue proposes to remove the 74 @inheritDoc tags in src/request/ at that time, so that hovers show no reference line.

🤖 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 } = {
Expand Down
2 changes: 1 addition & 1 deletion src/request/event.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EventParty, EventType } from '../constants.js';
import { assertValidDate } from '../utils.js';

interface EventProps {
export interface EventProps {
/**
* The party submitting the transaction.
*/
Expand Down
24 changes: 17 additions & 7 deletions src/request/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 false and no value is important.

The email field (src/request/email.ts:72) has the same gap.

🤖 Comment by Claude Opus 5.5.

*/
phoneWasVerificationSuccessful?: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion src/request/order.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isIP } from 'node:net';
import { ArgumentError } from '../errors.js';

interface OrderProps {
export interface OrderProps {
/**
* The total order amount for the transaction.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/request/payment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PaymentMethod, Processor } from '../constants.js';

interface PaymentProps {
export interface PaymentProps {
/**
* The payment method associated with the transaction.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/request/shipping.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DeliverySpeed } from '../constants.js';
import Location, { LocationProps } from './location.js';

interface ShippingProps extends LocationProps {
export interface ShippingProps extends LocationProps {
/**
* The shipping delivery speed for the order.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/request/shopping-cart-item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ArgumentError } from '../errors.js';

interface ShoppingCartItemProps {
export interface ShoppingCartItemProps {
/**
* The category of the item.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/request/transaction-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Tag } from '../constants.js';
import { ArgumentError } from '../errors.js';
import { snakecaseKeys } from '../utils.js';

interface TransactionReportProps {
export interface TransactionReportProps {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this export makes the TransactionReportProps comments show on the docs site. The minfraudId comment (line 30) says the field is not required "if you provide at least one of the transaction's ipAddress, minfraudId, or transactionId". The list includes minfraudId itself. It should be maxmindId.

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 minfraudId to maxmindId in the list of fields.

🤖 Comment by Claude Opus 5.5.

/**
* A string which is provided by your payment processor indicating the
* reason for the chargeback.
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"moduleResolution": "NodeNext",
"outDir": "dist",
"pretty": true,
"removeComments": true,
"resolveJsonModule": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: without removeComments, editors now also show the response-model comments, and some of them are wrong:

  • Factors.subscores (src/response/models/factors.ts:14) says "An object containing GeoIP and minFraud Insights information about the IP address."
  • Subscores.emailTenure and Subscores.ipTenure (src/response/records.ts:638 and :650) use the old TypeDoc [[...]] link syntax. It shows as literal text.

Suggestion: correct the subscores description and change [[...]] to {@link ...}.

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 Factors.subscores description and to change the [[...]] links in Subscores.emailTenure and Subscores.ipTenure to {@link ...}.

🤖 Comment by Claude Opus 5.5.

"skipLibCheck": true,
"strict": true,
Expand Down