Skip to content
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

Enhance MinFraud Documentation: Add Detailed Information on Available Options #152

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ and [Report Transaction](https://dev.maxmind.com/minfraud/report-transaction/) A
### minFraud API ###

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. You then build up the request using the
`->with*` methods as shown below. Each method call returns a new object. The
previous object is not modified.
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.

For instance, to call the Sandbox environment instead of the minFraud 2 web service:
Copy link
Contributor

Choose a reason for hiding this comment

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

How about:

"For instance, to use the Sandbox web service instead of the production web service, you can provide the host option:"

I realize I suggested the original but it reads funny to me today 😿

I'm not sold on "production" as a widely recognizable term, but I see we use it in the support site docs too, so I guess it's fine.


```php
$mf = new MinFraud(1, 'ABCD567890', [ 'host' => 'sandbox.maxmind.com' ]);
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this more succinct? This is a big block in the summary section of the docs. I think it would be good to keep this section as clear and simple as possible.

e.g.

For instance, to call the Sandbox environment instead of the minFraud 2 web service:

$client = 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.

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
Expand Down
4 changes: 4 additions & 0 deletions src/MinFraud.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class MinFraud extends MinFraud\ServiceClient
* @param array $options An array of options. Possible keys:
*
* * `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
Copy link
Contributor

Choose a reason for hiding this comment

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

How about:

"to use the Sandbox environment's host. The Sandbox allows you"

* 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.
Expand Down