From 635afce2dafacf83808e7a5a2480190dbc027041 Mon Sep 17 00:00:00 2001 From: Fatih Aktas Date: Fri, 4 Aug 2023 16:00:28 -0400 Subject: [PATCH] Make summary smaller, extend host in API docs --- README.md | 22 ++++++---------------- src/MinFraud.php | 6 +++++- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d6c2395..2a037c3 100644 --- a/README.md +++ b/README.md @@ -83,27 +83,17 @@ and [Report Transaction](https://dev.maxmind.com/minfraud/report-transaction/) A ### minFraud API ### -To use the MinFraud API, you'll need to create a new `MaxMind\MinFraud` object. The constructor -requires your MaxMind account ID, license key, and an optional [`options`](https://maxmind.github.io/minfraud-api-php/doc/v1.23.0/classes/MaxMind-MinFraud.html#method___construct) array as arguments. The `options` array can be used to set additional parameters such as `host` and `timeout`. Remember that this object is immutable. +To use the minFraud API, create a new `\MaxMind\MinFraud` object. The constructor +takes your MaxMind account ID, license key, and an optional `options` array as +arguments. This object is immutable. See the API documentation for the possible options. -Here's an example of creating a `MinFraud` object and calling the Sandbox endpoint: +For instance, to call the Sandbox environment instead of the minFraud 2 web service: ```php - 'sandbox.maxmind.com' -]; - -// Create a MinFraud object with your account ID, license key, and options -$mf = new MaxMind\MinFraud(1, 'ABCD567890', $options); - -// Now you can use the $mf object to interact with the MinFraud API -?> +$mf = new MinFraud(1, 'ABCD567890', [ 'host' => 'sandbox.maxmind.com' ]); ``` -Build up the request using the `->with*` methods as shown below. Each method call returns a new object. The -previous object is not modified. +Build up the request using the `->with*` methods as shown below. Each method call returns a new object. The previous object is not modified. If there is a validation error in the data passed to a `->with*` method, a `\MaxMind\Exception` will be thrown. This validation can be disabled by diff --git a/src/MinFraud.php b/src/MinFraud.php index 8c5bba6..9c9976e 100644 --- a/src/MinFraud.php +++ b/src/MinFraud.php @@ -61,7 +61,11 @@ class MinFraud extends MinFraud\ServiceClient * @param string $licenseKey Your MaxMind license key * @param array $options An array of options. Possible keys: * - * * `host` - The host to use when connecting to the web service. + * * `host` - The host to use when connecting to the web service. + * By default, the client connects to the production host. However, + * during testing and development, you can set this option to + * 'sandbox.maxmind.com' to use the sandbox host. The sandbox host + * allows you to experiment with the API without affecting your production data. * * `userAgent` - The prefix for the User-Agent header to use in the * request. * * `caBundle` - The bundle of CA root certificates to use in the request.