Example implementations
Unzer API PHP SDK is provided with example payment integrations
Activate the examples
To enable the examples:
- Navigate to the
examplesfolder, open the_enableExamples.phpfile, and change the constantUNZER_PAPI_EXAMPLESfromfalsetotrue. You should disable it again as soon as you launch your application. - You may need to adapt the constant
UNZER_PAPI_FOLDERto match your folder structure. For example,define('UNZER_PAPI_FOLDER', '/sdk-test/vendor/unzerdev/php-sdk/examples/'); - Set the keypair constants
UNZER_PAPI_PRIVATE_KEYandUNZER_PAPI_PUBLIC_KEYto valid values. To learn more how you can get a valid keypair or use your own sandbox keys, go to the Getting started section.
Use the examples
To use the examples go to the examples folder, for example https://my-server.de/sdk-test/vendor/unzerdev/php-sdk/examples/ and choose the payment method you want to try out.
The examples provide a generic handler examples\\ReturnController.php that shows the handling of the initial transactions of most payment types in one place.
