Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v:2.0:fighting-fraud [2017/07/20 12:13] – [Handling the request] adam | v:2.0:fighting-fraud [2021/06/09 08:47] (current) – [Extra Setup if you're using a Custom Subdomain] adam | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Fraud Prevention in FoxyCart ====== | ====== Fraud Prevention in FoxyCart ====== | ||
| + | |||
| + | ===== Foxy's Internal Abuse Prevention ===== | ||
| + | |||
| + | In addition to the options below, we have some systems in place to block more " | ||
| ===== minFraud in Foxy ===== | ===== minFraud in Foxy ===== | ||
| Line 5: | Line 9: | ||
| ==== What to do with it? ==== | ==== What to do with it? ==== | ||
| - | You can enable minFraud in the " | + | You can enable minFraud in the " |
| Though every store and customer base will have different riskScore averages, MaxMind' | Though every store and customer base will have different riskScore averages, MaxMind' | ||
| Line 37: | Line 41: | ||
| Foxy's [[https:// | Foxy's [[https:// | ||
| - | Foxy defaults to reCAPTCHA being off, but has 2 different options: | + | The setting is shown within the “Anti-Fraud Integrations” section, displayed within the “Let customers pay with a Credit or Debit Card” payment option when enabled. |
| - | - **Enabled, Always.** As it sounds, this will include reCAPTCHA on every checkout. | + | <WRAP center round info 95%> |
| - | - **Enabled, Automatically as Needed.** This will require reCAPTCHA for checkouts loaded by IP addresses that have triggered multiple errors in a preceding window of time. We attempt to set this so it would //very// rarely be shown to a legitimate customer, but would effectively make bot-based bulk fraud impossible. We don't publicize the exact thresholds, and may change them as needed. | + | If you're using a payment |
| - | + | ||
| - | Note that reCAPTCHA isn't required for API-based or [[v: | + | |
| - | + | ||
| - | ===== Pre-Checkout Hooks ===== | + | |
| - | + | ||
| - | The Pre-Checkout Hook functionality allows for stores to apply custom validations for transactions prior to the request being set to the chosen | + | |
| - | + | ||
| - | Common use cases for the pre-checkout hook include: | + | |
| - | + | ||
| - | * Final inventory checks for low-stock | + | |
| - | * Custom validations | + | |
| - | * Integrations with custom validation or fraud-check services | + | |
| - | + | ||
| - | ==== Enabling the Pre-Checkout Hook ==== | + | |
| - | + | ||
| - | To enable | + | |
| - | + | ||
| - | ; pre-checkout hook url | + | |
| - | : The URL for the endpoint script, which needs to be HTTPS, which will receive the JSON payload. | + | |
| - | ; failure handling | + | |
| - | : If your endpoint script fails to load or respond correctly, use this setting to set whether the transaction should be automatically approved or rejected. If set to reject, a generic error message will be returned, which you can edit the error from the " | + | |
| - | + | ||
| - | + | ||
| - | ==== Handling the request ==== | + | |
| - | + | ||
| - | When the customer attempts to complete their purchase, after the Google | + | |
| - | + | ||
| - | The following is an example of the JSON payload, showing two products (with one having live rates) and having | + | |
| - | + | ||
| - | <code javascript> | + | |
| - | { | + | |
| - | | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | { | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | ], | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | { | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | ], | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | ], | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }], | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | ], | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | }, | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | === Notes === | + | |
| - | + | ||
| - | * The payload includes several _links arrays. These contain helpful URI's that could be used through the Hypermedia API if you're also making use of that. If not, these can be safely ignored. | + | |
| - | + | ||
| - | <WRAP center round important 90%> | + | |
| - | FoxyCart expects a response from your endpoint within 20 seconds of the request being sent - so you will need to ensure that any logic that your endpoint undertakes is completed quickly. Remember that as this request happens after the customer clicks to complete their transaction, | + | |
| </ | </ | ||
| + | Foxy defaults to reCAPTCHA being '' | ||
| + | - **Disabled**: | ||
| + | - **Enabled, Always**: As it sounds, this will include reCAPTCHA on every checkout. | ||
| + | - **Enabled, Automatically as Needed**: This will require reCAPTCHA only in specific situations when our systems have cause to believe your store needs extra protection. We do not reveal specific behavior here, but broadly: If we detect behavior that makes us think a bot (or botnet) is pushing transactions through without a real human behind it, we will enable reCAPTCHA either for specific IPs or for //all checkout attempts//. We attempt to set this so it would //very// rarely be shown to a legitimate customer, but would effectively make bot-based bulk fraud impossible. | ||
| + | Note that reCAPTCHA isn't required for API-based or [[.: | ||
| - | ==== Sending | + | ==== Extra Setup if you're using a Custom Subdomain |
| - | In response, FoxyCart expects | + | If you're using a [[.: |
| - | === Approve === | + | - Go to the [[https:// |
| - | + | | |
| - | <code javascript> | + | |
| - | { | + | |
| - | "ok": true, | + | - It should be successful, and take you to a page with your Site Key and Secret Key. |
| - | "details": "" | + | - Copy those two keys into the " |
| - | } | + | - Save the payment settings in the FoxyCart admin. |
| - | </ | + | - Do some test transactions, if you'd like. (You can set the reCAPTCHA setting in your Foxy settings |
| - | + | ||
| - | === Reject === | + | |
| - | + | ||
| - | <code javascript> | + | |
| - | { | + | |
| - | | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | <WRAP center round important 90%> | + | |
| - | Only a valid JSON object | + | |
| - | </ | + | |
| - | ==== Example Endpoint | + | ===== FraudLabs Pro ===== |
| - | The following is an example PHP endpoint that could be used to handle the pre-checkout hook: | + | [[https:// |
| + | * [[https:// | ||
| - | <code php> | + | ===== Pre-Payment Webhook ===== |
| - | <?php | + | |
| - | $rawPost | + | |
| - | $cart_details | + | |
| - | $response = array( | + | The [[pre_payment_webhook|pre-payment web hook]] can be used for custom anti-fraud integrations. |
| - | ' | + | |
| - | ' | + | |
| - | ); | + | |
| - | foreach($cart_details[' | + | * [[https:// |
| - | | + | |
| - | $response[' | + | |
| - | $response[' | + | |
| - | } | + | |
| - | } | + | |
| - | header(' | ||
| - | print json_encode($response); | ||
| - | </ | ||