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 define('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES', FALSE); to TRUE Please make sure to switch it off again, after you launch your application.

  2. You may need to adapt the constant HEIDELPAY_PHP_PAYMENT_API_FOLDER to match the your folder structure. E.g. define('HEIDELPAY_PHP_PAYMENT_API_FOLDER', '/heidelpayPHP/vendor/heidelpay/heidelpay-php/examples/');

  3. The last step is to set the keypair constants HEIDELPAY_PHP_PAYMENT_API_PRIVATE_KEY and HEIDELPAY_PHP_PAYMENT_API_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/heidelpayPHP/vendor/heidelpay/heidelpay-php/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 all payment types in one place.