Skip to content

Commit

Permalink
Merge pull request #51 from andypieters/master
Browse files Browse the repository at this point in the history
Renamed Void class
  • Loading branch information
Andy Pieters authored Aug 15, 2018
2 parents bef740c + 7302985 commit fd4fd39
Show file tree
Hide file tree
Showing 128 changed files with 867 additions and 726 deletions.
2 changes: 1 addition & 1 deletion samples/DynamicUUID/decode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
try {
$decoded = \Paynl\DynamicUUID::decode($uuid, $secret);
var_dump($decoded);
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
2 changes: 1 addition & 1 deletion samples/DynamicUUID/encode.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
'INV001'
);

echo $UUID;
echo $UUID;
2 changes: 1 addition & 1 deletion samples/DynamicUUID/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

$isValid = \Paynl\DynamicUUID::validate($uuid, $secret);

echo $isValid?'The uuid is valid': 'The uuid is NOT valid';
echo $isValid?'The uuid is valid': 'The uuid is NOT valid';
4 changes: 2 additions & 2 deletions samples/directDebit/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
'currency' => 'EUR',
));
echo $result->getMandateId();
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
}
2 changes: 1 addition & 1 deletion samples/directDebit/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
try {
$result = \Paynl\DirectDebit::get('IO-9350-3111-3010');
var_dump($result->getData());
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
4 changes: 2 additions & 2 deletions samples/directDebit/mandate/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
'currency' => 'EUR',
));
echo $result->getMandateId();
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/directDebit/mandate/addTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
'processDate' => new \DateTime('tomorrow'),
));
var_dump($result->getData());
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/directDebit/mandate/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
$result = \Paynl\DirectDebit\Mandate::get('IO-6604-2112-1710');
$data = $result->getData();
var_dump($data['result']);
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/directDebit/recurring/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
'currency' => 'EUR',
));
echo $result->getMandateId();
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/directDebit/recurring/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
$result = \Paynl\DirectDebit\Recurring::get('IO-3674-2126-0710');
$data = $result->getData();
var_dump($data['result']);
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ".$e->getMessage();
}
}
12 changes: 6 additions & 6 deletions samples/exchange.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -21,16 +21,16 @@

try {
$transaction = \Paynl\Transaction::getForExchange();
if($transaction->isBeingVerified()){
if ($transaction->isBeingVerified()) {
// here you can do your own checks and approve or decline the order yourself
// the script is stopped after approving or declining, after which a new exchange call will follow.
// the status of this new exchange call will be paid (approved) or canceled (declined)
$approved = false; // use your own function to determine if this should be true or false.
$declined = false; // use your own function to determine if this should be true or false.
if($approved){
if ($approved) {
$transaction->approve();
die("TRUE| Transaction approved");
} elseif($declined) {
} elseif ($declined) {
$transaction->decline();
die("TRUE| Transaction declined");
}
Expand All @@ -42,9 +42,9 @@
// payment canceled, restock items
}

// always start your response with TRUE|
// always start your response with TRUE|
echo "TRUE| ";
// Optionally you can send a message after TRUE|, you can view these messages in the logs. https://admin.pay.nl/logs/payment_state
// Optionally you can send a message after TRUE|, you can view these messages in the logs. https://admin.pay.nl/logs/payment_state
echo $transaction->isPaid() ? 'Paid' : 'Not paid';
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
Expand Down
4 changes: 2 additions & 2 deletions samples/instore/confirmPayment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -33,4 +33,4 @@
var_dump($result->getData());
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/instore/getAllTerminals.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -25,4 +25,4 @@
var_dump($result->getData());
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/instore/getReceipt.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -26,4 +26,4 @@
echo nl2br($result->getReceipt());
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
}
3 changes: 1 addition & 2 deletions samples/instore/payment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -35,7 +35,6 @@
echo "<a href='status.php?hash=".$hash."'>Status</a><br />";

echo "<br /><a href='".$result->getRedirectUrl()."'>Status - Paynl</a><br />";

} catch (\Paynl\Error\Error $e) {
echo 'Fout: ' . $e->getMessage();
}
4 changes: 2 additions & 2 deletions samples/instore/status.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -27,4 +27,4 @@
var_dump($result->getData());
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
}
2 changes: 1 addition & 1 deletion samples/merchant/addTradeName.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require_once '../../vendor/autoload.php';
require_once '../config.php';

\Paynl\Merchant::addTradeName('pay.be');
\Paynl\Merchant::addTradeName('pay.be');
2 changes: 1 addition & 1 deletion samples/merchant/deleteTradeName.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

$result = \Paynl\Merchant::deleteTradeName('TM-3311-7380');

var_dump($result);
var_dump($result);
2 changes: 1 addition & 1 deletion samples/merchant/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
require_once '../../vendor/autoload.php';
require_once '../config.php';

$result = \Paynl\Merchant::info('M-1234-5678');
$result = \Paynl\Merchant::info('M-1234-5678');
4 changes: 2 additions & 2 deletions samples/return.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -41,4 +41,4 @@
}
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
}
2 changes: 1 addition & 1 deletion samples/service/getAll.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion samples/service/getPaylinkUrl.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down
4 changes: 2 additions & 2 deletions samples/transaction/addRecurring.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -32,4 +32,4 @@
echo $result->getTransactionId();
} catch (\Paynl\Error\Error $e) {
echo $e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/transaction/capture.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -24,4 +24,4 @@
$result = \Paynl\Transaction::capture($transactionId);
} catch (\Paynl\Error\Error $e) {
echo $e->getMessage();
}
}
2 changes: 1 addition & 1 deletion samples/transaction/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/** @var \Paynl\Result\Transaction\Transaction $transaction */
$transaction = \Paynl\Transaction::get($transactionId);

var_dump($transaction->getData());
var_dump($transaction->getData());
3 changes: 1 addition & 2 deletions samples/transaction/paymentMethods.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -25,4 +25,3 @@
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}

4 changes: 2 additions & 2 deletions samples/transaction/refund.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -24,4 +24,4 @@
$result = \Paynl\Transaction::refund($transactionId, 5);
} catch (\Paynl\Error\Error $e) {
echo $e->getMessage();
}
}
9 changes: 4 additions & 5 deletions samples/transaction/start-minimum.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,23 @@

try {
$result = \Paynl\Transaction::start(array(
// Required
// Required
'amount' => 12.5,
'returnUrl' => dirname(\Paynl\Helper::getBaseUrl()) . '/return.php',
'ipaddress' => \Paynl\Helper::getIp(),

// Optional
// Optional
'exchangeUrl' => dirname(\Paynl\Helper::getBaseUrl()) . '/exchange.php',
'paymentMethod' => 10,// iDEAL use \Paynl\PaymentMethods::getList() to get all available paymentmethods
'description' => '123456', // the transaction description, usually the orderId
));

// Save this transactionId and link it to your order
// Save this transactionId and link it to your order
$transactionId = $result->getTransactionId();

// redirect user to payment page
header('location: '.$result->getRedirectUrl());

} catch (\Paynl\Error\Error $e) {
// An error has occurred
// An error has occurred
echo "Fout: " . $e->getMessage();
}
3 changes: 1 addition & 2 deletions samples/transaction/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,11 @@
// 'transferValue' => '12345678X260bc5', // The transactionId
));

// Save this transactionid and link it to your order
// Save this transactionid and link it to your order
$transactionId = $result->getTransactionId();

echo '<a href="' . $result->getRedirectUrl() . '">' . $result->getRedirectUrl() . '</a>';
echo "<br />" . $transactionId;

} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
4 changes: 2 additions & 2 deletions samples/transaction/void.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -24,4 +24,4 @@
$result = \Paynl\Transaction::void($transactionId);
} catch (\Paynl\Error\Error $e) {
echo $e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/validate/isPayServerIp.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/*
/*
* Copyright (C) 2015 Andy Pieters <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -28,4 +28,4 @@
var_dump($results);
} catch (\Paynl\Error\Error $e) {
echo "Fout: " . $e->getMessage();
}
}
2 changes: 1 addition & 1 deletion samples/voucher/activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
));
} catch (\Paynl\Error\Error $e) {
echo "Error: " . $e->getMessage();
}
}
4 changes: 2 additions & 2 deletions samples/voucher/balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
'cardNumber' => '012345678912345678',
'pincode' => '1234' // Optional, only needed if the card type needs a pincode
));
} catch (\Paynl\Error\Error $e){
} catch (\Paynl\Error\Error $e) {
echo "Error: ". $e->getMessage();
}
}
Loading

0 comments on commit fd4fd39

Please sign in to comment.