Example Implementations

Activate the examples

In order to enable the examples do the following:

  1. Navigate to the examples-folder and open the file: _enableExamples.php and change the constant UNZER_PAPI_EXAMPLES from false to true Please make sure to switch it off again, when you launch your application.

  2. You may need to adapt the constant UNZER_PAPI_FOLDER to match the your folder structure. E.g. define('UNZER_PAPI_FOLDER', '/sdk-test/vendor/unzerdev/php-sdk/examples/');

  3. The last step is to set the keypair constants UNZER_PAPI_PRIVATE_KEY and UNZER_PAPI_PUBLIC_KEY to valid values. Please refer to section Keypair in order to find out how you can get a valid keypair or use your own sandbox keys if you already have those.

Use the examples

In order to use the examples please surf to the examples-folder e. g. 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’ which shows the handling of the initial transactions of most payment types in one place.