Skip to content

Commit

Permalink
Make host a parameter, add instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
faktas2 committed Aug 10, 2023
1 parent 94f2611 commit ee731b9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

5.1.0 (2023-08-10)
------------------

* Add `host` parameter to `Client` constructor to allow for use of the
Sandbox environment.

5.0.0 (2023-05-16)
------------------

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ takes your MaxMind account ID and license key. For example:
const client = new minFraud.Client("1234", "LICENSEKEY");
```

If you would like to use the Sandbox environment, you can
set the `host` parameter to `sandbox.minfraud.com`:

```js
const client = new minFraud.Client("1234", "LICENSEKEY", 3000, 'sandbox.minfraud.com');
```

Then create a new `Transaction` object. This represents the transaction that
you are sending to minFraud. Each transaction property is instantiated by creating
a new instance of each property's class. For example:
Expand Down
9 changes: 7 additions & 2 deletions src/webServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ export default class WebServiceClient {
private licenseKey: string;
private timeout: number;

public constructor(accountID: string, licenseKey: string, timeout = 3000) {
public constructor(
accountID: string,
licenseKey: string,
timeout = 3000,
host = 'minfraud.maxmind.com'
) {
this.accountID = accountID;
this.licenseKey = licenseKey;
this.timeout = timeout;
this.host = 'minfraud.maxmind.com';
this.host = host;
}

public factors(transaction: Transaction): Promise<models.Factors> {
Expand Down

0 comments on commit ee731b9

Please sign in to comment.