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

Commit

Permalink
[change] (PHPLIB-187) Fix examples: Fix ids due to api changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sixer1182 committed May 11, 2020
1 parent bf8b581 commit 3ab255a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions examples/EmbeddedPayPage/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
$paypage->setLogoImage('https://dev.heidelpay.com/devHeidelpay_400_180.jpg')
->setShopName('My Test Shop')
->setTagline('Try and stop us from being awesome!')
->setOrderId('OrderNr' . microtime(true))
->setInvoiceId('InvoiceNr' . microtime(true));
->setOrderId('o' . microtime(true))
->setInvoiceId('i' . microtime(true));

// ... in order to enable FlexiPay Rate (Hire Purchase) you will need to set the effectiveInterestRate as well.
$paypage->setEffectiveInterestRate(4.99);

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

Expand Down
4 changes: 2 additions & 2 deletions examples/HostedPayPage/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
// These are the mandatory parameters for the payment page ...
$paypage = new Paypage(119.0, 'EUR', RETURN_CONTROLLER_URL);

$orderId = str_replace(['0.', ' '], '', microtime(false));
$orderId = 'o' . str_replace(['0.', ' '], '', microtime(false));

// ... however you can customize the Payment Page using additional parameters.
$paypage->setLogoImage('https://dev.heidelpay.com/devHeidelpay_400_180.jpg')
Expand All @@ -82,7 +82,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
->setImprintUrl('https://www.heidelpay.com/it/')
->setHelpUrl('https://www.heidelpay.com/at/')
->setContactUrl('https://www.heidelpay.com/en/about-us/about-heidelpay/')
->setInvoiceId('InvoiceNr' . microtime(true));
->setInvoiceId('i' . microtime(true));

// ... in order to enable FlexiPay Rate (Hire Purchase) you will need to set the effectiveInterestRate as well.
$paypage->setEffectiveInterestRate(4.99);
Expand Down
2 changes: 1 addition & 1 deletion examples/Invoice/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$invoice = $heidelpay->createPaymentType(new Invoice());

$customer = CustomerFactory::createCustomer('Max', 'Mustermann');
$orderId = str_replace(['0.', ' '], '', microtime(false));
$orderId = 'c'. str_replace(['0.', ' '], '', microtime(false));

$transaction = $invoice->charge(12.99, 'EUR', CONTROLLER_URL, $customer, $orderId);

Expand Down
2 changes: 1 addition & 1 deletion examples/InvoiceFactoring/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
->setCountry('DE');
$customer->setBirthDate('2000-02-12')->setBillingAddress($address)->setShippingAddress($address);

$orderId = str_replace(['0.', ' '], '', microtime(false));
$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);
Expand Down
2 changes: 1 addition & 1 deletion examples/InvoiceGuaranteed/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$heidelpay = new Heidelpay(HEIDELPAY_PHP_PAYMENT_API_PRIVATE_KEY);
$heidelpay->setDebugMode(true)->setDebugHandler(new ExampleDebugHandler());

$orderId = str_replace(['0.', ' '], '', microtime(false));
$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);
Expand Down
2 changes: 1 addition & 1 deletion examples/Prepayment/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$prepayment = $heidelpay->createPaymentType(new Prepayment());

$customer = CustomerFactory::createCustomer('Max', 'Mustermann');
$orderId = str_replace(['0.', ' '], '', microtime(false));
$orderId = 'o' . str_replace(['0.', ' '], '', microtime(false));

$transaction = $prepayment->charge(12.99, 'EUR', CONTROLLER_URL, $customer, $orderId);

Expand Down
2 changes: 1 addition & 1 deletion examples/SepaDirectDebitGuaranteed/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '')
$heidelpay = new Heidelpay(HEIDELPAY_PHP_PAYMENT_API_PRIVATE_KEY);
$heidelpay->setDebugMode(true)->setDebugHandler(new ExampleDebugHandler());

$orderId = str_replace(['0.', ' '], '', microtime(false));
$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);
Expand Down

0 comments on commit 3ab255a

Please sign in to comment.