From 4f84eb2b09bf51eabdc29b5eeec101e0260b1cb7 Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Thu, 28 Jul 2016 09:37:48 +0200
Subject: Braintree integration: first version
---
include/pay.php | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
(limited to 'include/pay.php')
diff --git a/include/pay.php b/include/pay.php
index 596251c..37dd1cc 100644
--- a/include/pay.php
+++ b/include/pay.php
@@ -42,10 +42,10 @@ require('./header.php');
$notFound = true;
}
}
- if ($notFound || $offerKey != $_offer->key) {
- ?>
-
The invoice could not be found.
- payment_key) {
+ echo "The invoice could not be found.
";
+ } elseif ($_offer->payment_key == '') {
+ echo "This invoice is not eligible for online payment.
";
} elseif (isset($_POST['payment_method_nonce'])) {
$nonce = $_POST['payment_method_nonce'];
$trans = Braintree_Transaction::sale([
@@ -91,23 +91,21 @@ require('./header.php');
foreach ($_offer->getItems() as $item) {
$i++;
echo '';
- echo "
+ echo " |
{$item->title}
{$item->getHTMLDescription()}
| ";
- echo "".Constants::invoice_valuta."{$item->calculate(Calculatable::SUBTOTAL)} | ";
- echo "{$item->VAT_percentage}% | ";
- echo "".Constants::invoice_valuta."{$item->calculate(Calculatable::TOTAL)} | ";
+ echo "".Constants::invoice_valuta."{$item->calculate(Calculatable::SUBTOTAL)} | ";
+ echo "{$item->VAT_percentage}% | ";
+ echo "".Constants::invoice_valuta."{$item->calculate(Calculatable::TOTAL)} | ";
echo '
';
}
?>
- Subtotal |
+ Totals |
=$subtotal?> |
-
-
- Total |
- =$total?> |
+ |
+ =$total?> |
--
cgit v1.2.3