From a9c5778232079a09000c519a414563a1e04e112d Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 28 Jul 2016 09:05:20 +0200 Subject: Split Calculatable in trait and interface --- include/pay.php | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 include/pay.php (limited to 'include/pay.php') diff --git a/include/pay.php b/include/pay.php new file mode 100644 index 0000000..596251c --- /dev/null +++ b/include/pay.php @@ -0,0 +1,135 @@ +. + */ + +require_once('./index.php'); +require('./header.php'); +?> + +
+
+
+
+
+

Pay

+
+
+ key) { + ?> +
The invoice could not be found.
+ (string) $_offer->calculate(Calculatable::TOTAL), + 'paymentMethodNonce' => $nonce, + 'options' => [ + 'submitForSettlement' => true + ] + ]); + + if (!$trans->success) { + echo '
'; + echo '

Your transaction could not be completed:

'; + foreach ($trans->errors->deepAll() as $error) { + echo "{$error->attribute}: {$error->code} {$error->message}
"; + } + echo 'Please try again, or contact us.'; + echo '
'; + } else { + try { + $payment = $_offer->createPayment(); + $payment->braintree_id = $trans->transaction->id; + echo '
Thank you for your payment.
'; + } catch (Exception $e) { + echo '
Your payment has been received, but could not be stored in our database. Please contact us.
'; + } + } + } else { + $subtotal = Constants::invoice_valuta . $_offer->calculate(Calculatable::SUBTOTAL); + $total = Constants::invoice_valuta . $_offer->calculate(Calculatable::TOTAL); + ?> +
+
Welcome to the checkout environment. Please review the invoice carefully.
+ + + + + + + + getItems() as $item) { + $i++; + echo ''; + echo ""; + echo ""; + echo ""; + echo ""; + echo ''; + } + ?> + + + + + + + + +
DescriptionPrice excl.VATPrice incl.
+ {$item->title} +
{$item->getHTMLDescription()}
+
".Constants::invoice_valuta."{$item->calculate(Calculatable::SUBTOTAL)}{$item->VAT_percentage}%".Constants::invoice_valuta."{$item->calculate(Calculatable::TOTAL)}
Subtotal
Total
+
+
+
+ +
+ +
+
+
+
+
+ + + + + -- cgit v1.2.3