Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Release version 1.2.9.0 (#209)
Browse files Browse the repository at this point in the history
* [change] (PHPLIB-209) Update CHANGELOG.md

* Merge remote-tracking branch 'remotes/github/develop' into bugfix/PHPLIB-309/renaming-cc-holder-to-cardHolder (#171)

* [bugfix] (PHPLIB-309) Rename Cards holder to cardHolder.

* [change] (PHPLIB-209) Fix tests add update version and CHANGELOG.md

* [change] (PHPLIB-309) Update test.

* [change] (PHPLIB-309) Update unit test.

* [change] (PHPLIB-309) Add unit tests to verify deprecated getter/setter.

* [change] (PHPLIB-309) Add integration test to verify deprecated getter/setter.

Co-authored-by: sixer1182 <[email protected]>

* bugfix/PHPLIB-330/fix-errors-related-to-tls-certs (#182)

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add curl error text to log.

* [bugfix] (PHPLIB-330) Add curl error text to log.

* [change] (PHPLIB-336) Mask auth header in debug log.

* [change] (PHPLIB-336) Switch to composer update for integration test.

* Revert "[change] (PHPLIB-336) Switch to composer update for integration test."

This reverts commit dbe61bf

* [change] (PHPLIB-330) debugging: disable peer and host verification

* [change] (PHPLIB-330) debugging: enable peer verification

* [change] (PHPLIB-330) debugging: disable peer verification and enable host common name is set.

* [change] (PHPLIB-330) debugging: disable peer verification and enable host common name verfication.

* [change] (PHPLIB-330) debugging: enable verify ssl status

* [change] (PHPLIB-330) debugging: enable verify ssl status

* [change] (PHPLIB-330) debugging: enable curl verbos output

* [change] (PHPLIB-330) debugging: add env var for curl verbosity.

* [change] (PHPLIB-330) debugging: add env var for curl verbosity.

* [change] (PHPLIB-330) debugging: add env var for curl verbosity.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: set linux distribution to default

* [change] (PHPLIB-330) remove linux distribution from travis config to enable using the current default.

* [change] (PHPLIB-330) update CHANGELOG.md

* [change] (PHPLIB-330) Update PHP Unit config.

* [change] (PHPLIB-330) Update CHANGELOG.md

* [change] (PHPLIB-330) Fix typo in field id.

Co-authored-by: sixer1182 <[email protected]>

* [change] PHPLIB-297 Set up bancontact integration.

* [change] (PHPLIB-301) add assertions to bancontact test

* [change] PHPLIB-301
- Add payment type constant.

* [change] PHPLIB-301
- Add Bancontact authorize test.

* [change] (PHPLIB-301) add Chrageable Test

* [refactor] (PHPLIB-301) remove exception throw annotation

* [change] (PHPLIB-301) Bancontact: Add header.

* [change] (PHPLIB-301) Bancontact: Add test for holder property.

* [change] (PHPLIB-301) Bancontact: add property and use in getter / setter

* change/PHPLIB-334/remove-default-keypair-from-tests (#185)

* [change] (PHPLIB-326) Enable test output for failed tests even when verbose test logging is disabled.

* [change] (PHPLIB-326) Replace environment variable for test log output and set default to false (no output).

* [change] (PHPLIB-326) Replace environment variable for test log output and set default to false (no output).

* [change] (PHPLIB-326) Update CHANGELOG.md.

* [change] (PHPLIB-326) Fix style issues.

* [change] (PHPLIB-326) Add new line before and after log dump.

* [change] (PHPLIB-326) Fix version in deprecation notice.

* [change] (PHPLIB-333) Remove default key pair from examples.

* [change] (PHPLIB-333) Update version since the changes are quite intence.

* [change] (PHPLIB-333) small change,.

* [change] (PHPLIB-333) small change,.

* [change] (PHPLIB-333) Fix key validation.

* [change] (PHPLIB-333) Move general key-check to index.

* [change] (PHPLIB-334) Remove default keys from tests and refactor tests.

* [change] (PHPLIB-334) Tests: Extend unit test for fetching the keys from env vars.

* [change] (PHPLIB-334) Tests: Changed EnvironmentService call to static method.

* [change] (PHPLIB-334) Tests: Refactor tests due to removal of default keys.

* [change] (PHPLIB-334) Tests: Changed EnvironmentService call to static method.

* [change] (PHPLIB-334) Tests: Update recurring test to comply to latest api changes.

* [change] (PHPLIB-334) Update README.md

* [change] (PHPLIB-334) Update README.md

* [change] (PHPLIB-334) Update CHANGELOG.md

* [refactor] (PHPLIB-334) Fix style issues.

Co-authored-by: sixer1182 <[email protected]>

* change/PHPLIB-317/refactor-due-to-min-php-version (#186)

* [change] (PHPLIB-326) Enable test output for failed tests even when verbose test logging is disabled.

* [change] (PHPLIB-326) Replace environment variable for test log output and set default to false (no output).

* [change] (PHPLIB-326) Replace environment variable for test log output and set default to false (no output).

* [change] (PHPLIB-326) Update CHANGELOG.md.

* [change] (PHPLIB-326) Fix style issues.

* [change] (PHPLIB-326) Add new line before and after log dump.

* [change] (PHPLIB-326) Fix version in deprecation notice.

* [change] (PHPLIB-333) Remove default key pair from examples.

* [change] (PHPLIB-333) Update version since the changes are quite intence.

* [change] (PHPLIB-333) small change,.

* [change] (PHPLIB-333) small change,.

* [change] (PHPLIB-333) Fix key validation.

* [change] (PHPLIB-333) Move general key-check to index.

* [change] (PHPLIB-334) Remove default keys from tests and refactor tests.

* [change] (PHPLIB-334) Tests: Extend unit test for fetching the keys from env vars.

* [change] (PHPLIB-334) Tests: Changed EnvironmentService call to static method.

* [change] (PHPLIB-334) Tests: Refactor tests due to removal of default keys.

* [change] (PHPLIB-334) Tests: Changed EnvironmentService call to static method.

* [change] (PHPLIB-334) Tests: Update recurring test to comply to latest api changes.

* [change] (PHPLIB-334) Update README.md

* [change] (PHPLIB-334) Update README.md

* [change] (PHPLIB-334) Update CHANGELOG.md

* [refactor] (PHPLIB-317) Adapt style and features to PHP version 7.1.

* Add return type hints.
* Fix some minor issues.
* Add missing exception annotations.
* Remove unnecessary comments from tests.

* [refactor] (PHPLIB-317) Update CHANGELOG.md and replace abandoned codacy/coverage package.

* [refactor] (PHPLIB-317) Update CHANGELOG.md and replace abandoned codacy/coverage package.

* [refactor] (PHPLIB-317) Update CHANGELOG.md and replace abandoned codacy/coverage package.

* [refactor] (PHPLIB-317) Refactor code.

* Replace deprecated methods.
* Add some noinspection rules.
* Fixed some minor issues.

* [refactor] (PHPLIB-317) Remove debug code.

* [change] (PHPLIB-317) Tests remove throws annotations.

* [change] (PHPLIB-317) Apply change due to review comment.

Co-authored-by: sixer1182 <[email protected]>

* [change] (PHPLIB-301) Bancontact: change base testing class.

* [change] (PHPLIB-301) Bancontact: fix code style

* [change] (PHPLIB-301) Bancontact: Add it to Payment types constant array.

* [change] (PHPLIB-301) Bancontact: update test.

* Revert "Merge remote-tracking branch 'remotes/github/develop' into PHPLIB-345/change/release-and-merge-external-pr (#191)" (#198)

This reverts commit b070633.

* Revert "Added the possibility to add custom css to the payment page"

* [change] (PHPLIB-301) Bancontact: Add example.

* [change] (PHPLIB-301) Bancontact: Assign correct id for try-button.

* [change] (PHPLIB-301) Bancontact: update changelog.

* [change] (PHPLIB-209) Update CHANGELOG.md

* bugfix/PHPLIB-330/fix-errors-related-to-tls-certs (#182)

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add local certificate to travis config.

* [bugfix] (PHPLIB-330) Add curl error text to log.

* [bugfix] (PHPLIB-330) Add curl error text to log.

* [change] (PHPLIB-336) Mask auth header in debug log.

* [change] (PHPLIB-336) Switch to composer update for integration test.

* Revert "[change] (PHPLIB-336) Switch to composer update for integration test."

This reverts commit dbe61bf

* [change] (PHPLIB-330) debugging: disable peer and host verification

* [change] (PHPLIB-330) debugging: enable peer verification

* [change] (PHPLIB-330) debugging: disable peer verification and enable host common name is set.

* [change] (PHPLIB-330) debugging: disable peer verification and enable host common name verfication.

* [change] (PHPLIB-330) debugging: enable verify ssl status

* [change] (PHPLIB-330) debugging: enable verify ssl status

* [change] (PHPLIB-330) debugging: enable curl verbos output

* [change] (PHPLIB-330) debugging: add env var for curl verbosity.

* [change] (PHPLIB-330) debugging: add env var for curl verbosity.

* [change] (PHPLIB-330) debugging: add env var for curl verbosity.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: add date to output.

* [change] (PHPLIB-330) debugging: set linux distribution to default

* [change] (PHPLIB-330) remove linux distribution from travis config to enable using the current default.

* [change] (PHPLIB-330) update CHANGELOG.md

* [change] (PHPLIB-330) Update PHP Unit config.

* [change] (PHPLIB-330) Update CHANGELOG.md

* [change] (PHPLIB-330) Fix typo in field id.

Co-authored-by: sixer1182 <[email protected]>

* change/PHPLIB-333/remove-default-key-pair-from-examples (#184)

* [change] (PHPLIB-326) Enable test output for failed tests even when verbose test logging is disabled.

* [change] (PHPLIB-326) Replace environment variable for test log output and set default to false (no output).

* [change] (PHPLIB-326) Replace environment variable for test log output and set default to false (no output).

* [change] (PHPLIB-326) Update CHANGELOG.md.

* [change] (PHPLIB-326) Fix style issues.

* [change] (PHPLIB-326) Add new line before and after log dump.

* [change] (PHPLIB-326) Fix version in deprecation notice.

* [change] (PHPLIB-333) Remove default key pair from examples.

* [change] (PHPLIB-333) Update version since the changes are quite intence.

* [change] (PHPLIB-333) small change,.

* [change] (PHPLIB-333) small change,.

* [change] (PHPLIB-333) Fix key validation.

* [change] (PHPLIB-333) Move general key-check to index.

Co-authored-by: sixer1182 <[email protected]>

* Added the possibility to add custom css to the payment page

* Merge remote-tracking branch 'remotes/github/develop' into PHPLIB-345/change/release-and-merge-external-pr (#191)

* [change] (PHPLIB-345) Paypage: Add css property and tests.

* [change] (PHPLIB-345) Paypage: Fix style.

* [change] (PHPLIB-345) Fix CHANGELOG.md

Co-authored-by: sixer1182 <[email protected]>

* Revert "Merge remote-tracking branch 'remotes/github/develop' into PHPLIB-345/change/release-and-merge-external-pr (#191)" (#198)

This reverts commit b070633.

* Revert "Added the possibility to add custom css to the payment page" (#199)

* Revert "Revert "Added the possibility to add custom css to the payment page" (#199)"

This reverts commit de1e807

* Revert "Revert "Merge remote-tracking branch 'remotes/github/develop' into PHPLIB-345/change/release-and-merge-external-pr (#191)" (#198)"

This reverts commit 9cb52ca

* [fix](PHPLIB-347) Test: remove missing element from actual array to match expecting array

* Update test/integration/PaymentTypes/BancontactTest.php

Co-authored-by: Florian Evertz <[email protected]>

* Update src/Resources/PaymentTypes/Bancontact.php

Co-authored-by: Florian Evertz <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Florian Evertz <[email protected]>

* [change] Fix hosted pay page example and update changelog and version. (#206)

* [change] Fix hosted pay page example and update changelog and version.

* [change] Fix embedded pay page example.

* [change] Update CHANGELOG.md

* [change] Fix baskets in examples.

* [change] Update support channels.

Co-authored-by: sixer1182 <[email protected]>

* [change] Fix idString

Co-authored-by: sixer1182 <[email protected]>
Co-authored-by: David.Owusu <[email protected]>
Co-authored-by: Florian Evertz <[email protected]>
Co-authored-by: “Baris <[email protected]>
Co-authored-by: David Owusu <[email protected]>
Co-authored-by: Florian Evertz <[email protected]>
  • Loading branch information
7 people authored Oct 7, 2020
1 parent 1e14bb1 commit 1260b83
Show file tree
Hide file tree
Showing 20 changed files with 477 additions and 21 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.9.0][1.2.9.0]

### Add
* Bancontact payment type and example.

### Fix
* Payment page examples.

## [1.2.8.0][1.2.8.0]

### Add
Expand Down Expand Up @@ -444,3 +452,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[1.2.7.1]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.7.0..1.2.7.1
[1.2.7.2]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.7.1..1.2.7.2
[1.2.8.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.7.2..1.2.8.0
[1.2.9.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.8.0..1.2.9.0
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This SDK provides for an easy way to connect to the heidelpay Rest API.

Please refer to the following documentation for installation instructions and usage information.

* [API Documentation](https://docs.heidelpay.com/docs/introduction)
* [PHP SDK Documentation](https://docs.heidelpay.com/docs/php-sdk)
* [How to use the examples](https://docs.heidelpay.com/docs/example-implementations)
* [Debugging](https://docs.heidelpay.com/docs/logging-and-debugging)
* [API Documentation](https://docs.unzer.com/docs/introduction)
* [PHP SDK Documentation](https://docs.unzer.com/docs/php-sdk)
* [How to use the examples](https://docs.unzer.com/docs/example-implementations)
* [Debugging](https://docs.unzer.com/docs/logging-and-debugging)

## Supported payment types
* Card (credit card and debit card) + Recurring
Expand Down Expand Up @@ -45,13 +45,13 @@ Please refer to the following documentation for installation instructions and us
For any issues or questions please get in touch with our support team.

### Web page
[https://docs.heidelpay.com/](https://docs.heidelpay.com/)
[https://docs.unzer.com/](https://docs.unzer.com/)

### Email
[support@heidelpay.com](mailto:support@heidelpay.com)
[support@unzer.com](mailto:support@unzer.com)

### Phone
[+49 (0)6221/6471-100](tel:+49-62216471-100)
[+49 6221 43101-00](tel:+49-6221 43101 00)

### Twitter
[@devHeidelpay](https://twitter.com/devHeidelpay)
29 changes: 29 additions & 0 deletions examples/Bancontact/Constants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* This file defines the constants needed for the Bancontact example.
*
* Copyright (C) 2020 heidelpay GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://docs.heidelpay.com/
*
* @author David Owusu <[email protected]>
*
* @package heidelpayPHP\examples
*/

require_once __DIR__ . '/../Constants.php';

define('EXAMPLE_URL', EXAMPLE_BASE_FOLDER . 'Bancontact');
define('CONTROLLER_URL', EXAMPLE_URL . '/Controller.php');
84 changes: 84 additions & 0 deletions examples/Bancontact/Controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/**
* This is the controller for the Bancontact example.
* It is called when the pay button on the index page is clicked.
*
* Copyright (C) 2020 heidelpay GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://docs.heidelpay.com/
*
* @author David Owusu <[email protected]>
*
* @package heidelpayPHP\examples
*/

/** Require the constants of this example */
require_once __DIR__ . '/Constants.php';

/** @noinspection PhpIncludeInspection */
/** Require the composer autoloader file */
require_once __DIR__ . '/../../../../autoload.php';

use heidelpayPHP\examples\ExampleDebugHandler;
use heidelpayPHP\Exceptions\HeidelpayApiException;
use heidelpayPHP\Heidelpay;

session_start();
session_unset();

$clientMessage = 'Something went wrong. Please try again later.';
$merchantMessage = 'Something went wrong. Please try again later.';

function redirect($url, $merchantMessage = '', $clientMessage = '')
{
$_SESSION['merchantMessage'] = $merchantMessage;
$_SESSION['clientMessage'] = $clientMessage;
header('Location: ' . $url);
die();
}

// You will need the id of the payment type created in the frontend (index.php)
if (!isset($_POST['resourceId'])) {
redirect(FAILURE_URL, 'Resource id is missing!', $clientMessage);
}
$paymentTypeId = $_POST['resourceId'];

// Catch API errors, write the message to your log and show the ClientMessage to the client.
try {
// Create a heidelpay object using your private key and register a debug handler if you want to.
$heidelpay = new Heidelpay(HEIDELPAY_PHP_PAYMENT_API_PRIVATE_KEY);
$heidelpay->setDebugMode(true)->setDebugHandler(new ExampleDebugHandler());

// Create a charge transaction to get the redirectUrl.
$transaction = $heidelpay->charge(12.32, 'EUR', $paymentTypeId, RETURN_CONTROLLER_URL);

// You'll need to remember the paymentId for later in the ReturnController
$_SESSION['PaymentId'] = $transaction->getPaymentId();
$_SESSION['ShortId'] = $transaction->getShortId();

// Redirect to the Bancontact page
if (!$transaction->isError() && $transaction->getRedirectUrl() !== null) {
redirect($transaction->getRedirectUrl());
}

// Check the result message of the charge to find out what went wrong.
$merchantMessage = $transaction->getMessage()->getCustomer();
} catch (HeidelpayApiException $e) {
$merchantMessage = $e->getMerchantMessage();
$clientMessage = $e->getClientMessage();
} catch (RuntimeException $e) {
$merchantMessage = $e->getMessage();
}
redirect(FAILURE_URL, $merchantMessage, $clientMessage);
95 changes: 95 additions & 0 deletions examples/Bancontact/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
/**
* This file provides an example implementation of the Bancontact payment type.
*
* Copyright (C) 2020 heidelpay GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://docs.heidelpay.com/
*
* @author David Owusu <[email protected]>
*
* @package heidelpayPHP\examples
*/

/** Require the constants of this example */
require_once __DIR__ . '/Constants.php';

/** @noinspection PhpIncludeInspection */
/** Require the composer autoloader file */
require_once __DIR__ . '/../../../../autoload.php';
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
Heidelpay UI Examples
</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>

<link rel="stylesheet" href="https://static.heidelpay.com/v1/heidelpay.css" />
<script type="text/javascript" src="https://static.heidelpay.com/v1/heidelpay.js"></script>
</head>

<body style="margin: 70px 70px 0;">

<p><a href="https://docs.heidelpay.com/docs/testdata" target="_blank">Click here to open our test data in new tab.</a></p>

<form id="payment-form" class="heidelpayUI form" novalidate>
<div id="bancontact-holder" class="field">
<!-- The Holder field UI Element will be inserted here -->
</div>
<div class="field" id="error-holder" style="color: #9f3a38"> </div>
<button class="heidelpayUI primary button fluid" id="submit-button" type="submit">Pay</button>
</form>

<script>
// Create a heidelpay instance with your public key
let heidelpayInstance = new heidelpay('<?php echo HEIDELPAY_PHP_PAYMENT_API_PUBLIC_KEY; ?>');

// Create an Bancontact instance
let Bancontact = heidelpayInstance.Bancontact();

Bancontact.create('holder', {
containerId: 'bancontact-holder',
});

// Handle payment form submission
let form = document.getElementById('payment-form');
form.addEventListener('submit', function(event) {
event.preventDefault();
// Creating a Bancontact resource
Bancontact.createResource()
.then(function(result) {
let hiddenInput = document.createElement('input');
hiddenInput.setAttribute('type', 'hidden');
hiddenInput.setAttribute('name', 'resourceId');
hiddenInput.setAttribute('value', result.id);
form.appendChild(hiddenInput);
form.setAttribute('method', 'POST');
form.setAttribute('action', '<?php echo CONTROLLER_URL; ?>');

// Submitting the form
form.submit();
})
.catch(function(error) {
$('#error-holder').html(error.message)
})
});
</script>
</body>
</html>
4 changes: 3 additions & 1 deletion examples/EmbeddedPayPage/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@

// ... a Basket is mandatory for HirePurchase
$orderId = 'o' . str_replace(['0.', ' '], '', microtime(false));
$basketItem = new BasketItem('Hat', 100.0, 119.0, 1);
$basketItem = (new BasketItem('Hat', 100.00, 119.00, 1))
->setAmountGross(119.0)
->setAmountVat(19.0);
$basket = new Basket($orderId, 119.0, 'EUR', [$basketItem]);

if ($transactionType === 'charge') {
Expand Down
3 changes: 1 addition & 2 deletions examples/HirePurchaseDirectDebit/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
->setEmail('[email protected]');

// A Basket is mandatory for SEPA direct debit guaranteed payment type
$basketItem = (new BasketItem('Hat', 100.00, 100.00, 1))
->setAmountNet(100.0)
$basketItem = (new BasketItem('Hat', 100.00, 119.00, 1))
->setAmountGross(119.0)
->setAmountVat(19.0);
$basket = (new Basket($orderId, 119.0, 'EUR', [$basketItem]))->setAmountTotalVat(19.0);
Expand Down
4 changes: 3 additions & 1 deletion examples/HostedPayPage/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$paypage->setEffectiveInterestRate(4.99);

// ... a Basket is mandatory for HirePurchase
$basketItem = new BasketItem('Hat', 100.0, 119.0, 1);
$basketItem = (new BasketItem('Hat', 100.00, 119.00, 1))
->setAmountGross(119.0)
->setAmountVat(19.0);
$basket = new Basket($orderId, 119.0, 'EUR', [$basketItem]);

if ($transactionType === 'charge') {
Expand Down
4 changes: 3 additions & 1 deletion examples/InvoiceFactoring/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$orderId = 'o' . str_replace(['0.', ' '], '', microtime(false));

// A Basket is mandatory for Invoice Factoring payment type
$basketItem = new BasketItem('Hat', 100.0, 119.0, 1);
$basketItem = (new BasketItem('Hat', 100.00, 119.00, 1))
->setAmountGross(119.0)
->setAmountVat(19.0);
$basket = new Basket($orderId, 119.0, 'EUR', [$basketItem]);

$transaction = $invoiceFactoring->charge(119.0, 'EUR', CONTROLLER_URL, $customer, $orderId, null, $basket);
Expand Down
4 changes: 3 additions & 1 deletion examples/InvoiceGuaranteed/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$orderId = 'o' . str_replace(['0.', ' '], '', microtime(false));

// A Basket is mandatory for Invoice Factoring payment type
$basketItem = new BasketItem('Hat', 100.0, 119.0, 1);
$basketItem = (new BasketItem('Hat', 100.00, 119.00, 1))
->setAmountGross(119.0)
->setAmountVat(19.0);
$basket = new Basket($orderId, 119.0, 'EUR', [$basketItem]);

$transaction = $heidelpay->charge(119.0, 'EUR', $paymentTypeId, CONTROLLER_URL, $customerId, $orderId, null, $basket);
Expand Down
4 changes: 3 additions & 1 deletion examples/SepaDirectDebitGuaranteed/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$orderId = 'o' . str_replace(['0.', ' '], '', microtime(false));

// A Basket is mandatory for SEPA direct debit guaranteed payment type
$basketItem = new BasketItem('Hat', 100.0, 119.0, 1);
$basketItem = (new BasketItem('Hat', 100.00, 119.00, 1))
->setAmountGross(119.0)
->setAmountVat(19.0);
$basket = new Basket($orderId, 119.0, 'EUR', [$basketItem]);

$transaction = $heidelpay->charge(119.0, 'EUR', $paymentTypeId, CONTROLLER_URL, $customerId, $orderId, null, $basket);
Expand Down
12 changes: 12 additions & 0 deletions examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ function printMessage($type, $title, $text)
Try
</div>
</div>
<div class="card olive">
<div class="content">
<div class="header">
Bancontact
</div>
<div class="description">
</div>
</div>
<div id="tryBancontactExample" class="ui bottom attached green button" onclick="location.href='Bancontact/';">
Try
</div>
</div>
</div>
</div>

Expand Down
4 changes: 3 additions & 1 deletion src/Constants/IdStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class IdStrings
public const INVOICE_FACTORING = 'ivf';
public const HIRE_PURCHASE_DIRECT_DEBIT = 'hdd';
public const PAYMENT_PAGE = 'ppg';
public const BANCONTACT = 'bct';

// Resources
public const BASKET = 'bsk';
Expand All @@ -78,6 +79,7 @@ class IdStrings
self::WECHATPAY,
self::INVOICE_FACTORING,
self::PAYMENT_PAGE,
self::HIRE_PURCHASE_DIRECT_DEBIT
self::HIRE_PURCHASE_DIRECT_DEBIT,
self::BANCONTACT
];
}
2 changes: 1 addition & 1 deletion src/Heidelpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Heidelpay implements HeidelpayParentInterface, PaymentServiceInterface, Re
public const BASE_URL = 'api.heidelpay.com';
public const API_VERSION = 'v1';
public const SDK_TYPE = 'heidelpayPHP';
public const SDK_VERSION = '1.2.8.0';
public const SDK_VERSION = '1.2.9.0';

/** @var string $key */
private $key;
Expand Down
Loading

0 comments on commit 1260b83

Please sign in to comment.