Example implementations
Unzer API PHP SDK is provided with example payment integrations
Activate the examples
To enable the examples:
- Navigate to the
examples
folder, open the_enableExamples.php
file, and change the constantUNZER_PAPI_EXAMPLES
fromfalse
totrue
. You should disable it again as soon as you launch your application. - You may need to adapt the constant
UNZER_PAPI_FOLDER
to match your folder structure. For example,define('UNZER_PAPI_FOLDER', '/sdk-test/vendor/unzerdev/php-sdk/examples/');
- Set the keypair constants
UNZER_PAPI_PRIVATE_KEY
andUNZER_PAPI_PUBLIC_KEY
to 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.