Skip to content

Commit 40eb452

Browse files
authored
Merge pull request thephpleague#426 from eileenmcnaughton/patch-2
Document how to implement test mode
2 parents e01aa58 + 15cd59a commit 40eb452

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,25 @@ try {
437437
}
438438
```
439439

440+
## Test mode and developer mode
441+
Most gateways allow you to set up a sandbox or developer account which uses a different url
442+
and credentials. Some also allow you to do test transactions against the live site, which does
443+
not result in a live transaction.
444+
445+
Gateways that implement only the developer account (most of them) call it testMode. Authorize.net,
446+
however, implements both and refers to this mode as developerMode.
447+
448+
When implementing with multiple gateways you should use a construct along the lines of the following:
449+
450+
if ($is_developer_mode)
451+
{
452+
if (method_exists($gateway, 'setDeveloperMode')) {
453+
$gateway->setDeveloperMode(TRUE);
454+
} else {
455+
$gateway->setTestMode(TRUE);
456+
}
457+
}
458+
440459
## Token Billing
441460

442461
Token billing allows you to store a credit card with your gateway, and charge it at a later date.

0 commit comments

Comments
 (0)