diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 6a0d2e3..2453cbb 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,15 +2,11 @@
-
-
-
-
+
-
-
+
@@ -26,16 +22,16 @@
-
+
-
+
-
+
@@ -47,7 +43,7 @@
-
+
@@ -55,13 +51,13 @@
-
+
-
+
@@ -69,11 +65,11 @@
-
+
-
+
@@ -81,12 +77,12 @@
-
+
-
-
+
+
@@ -111,8 +107,8 @@
-
-
+
+
@@ -120,8 +116,8 @@
-
-
+
+
@@ -141,8 +137,8 @@
-
-
+
+
@@ -150,6 +146,15 @@
+
+
+
+
+
+
+
+
+
@@ -162,7 +167,7 @@
-
+
@@ -172,51 +177,88 @@
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -227,7 +269,6 @@
- form>
date
birthdatepicker
data
@@ -257,6 +298,7 @@
setShippingCountry
Util
use Util
+ hidde
$PROJECT_DIR$/app
@@ -297,11 +339,6 @@
@@ -482,8 +524,8 @@
-
-
+
+
@@ -493,6 +535,7 @@
+
@@ -547,12 +590,13 @@
-
+
+
@@ -565,6 +609,13 @@
+
+
+
+
+
+
+
@@ -597,16 +648,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -616,7 +657,6 @@
-
@@ -698,11 +738,12 @@
+
-
+
@@ -714,10 +755,10 @@
-
+
-
+
@@ -747,119 +788,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -867,20 +795,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -895,13 +809,6 @@
-
-
-
-
-
-
-
@@ -978,34 +885,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1017,22 +896,141 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1040,57 +1038,109 @@
-
+
-
-
-
-
-
+
+
-
+
-
-
-
-
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Http/Controllers/Pay/PayoneController.php b/app/Http/Controllers/Pay/PayoneController.php
index 5062397..22f554f 100644
--- a/app/Http/Controllers/Pay/PayoneController.php
+++ b/app/Http/Controllers/Pay/PayoneController.php
@@ -24,6 +24,12 @@ fnc Financing
class PayoneController extends Controller
{
+ const PREAUTHORIZATION = 'preauthorization';
+ const AUTHORIZATION = 'authorization';
+ const CAPTURE = 'capture';
+ const REFUND = 'refund';
+ const DEBIT = 'debit';
+
private $default = [];
@@ -38,6 +44,7 @@ class PayoneController extends Controller
private $url = [];
+
public function __construct($payment_method = null) {
if($payment_method){
@@ -182,7 +189,8 @@ class PayoneController extends Controller
//cc
-
+ var_dump($response);
+ die();
if ($response["status"] == "REDIRECT") { // this happens when the card needs a 3d secure verification
header("Location: " . $response["redirecturl"]); // or other redirect method
} elseif ($response["status"] == "APPROVED") { // no 3d secure verification required, transaction went through
diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php
index 41538e4..9136099 100755
--- a/app/Http/Controllers/Web/CheckoutController.php
+++ b/app/Http/Controllers/Web/CheckoutController.php
@@ -50,6 +50,7 @@ class CheckoutController extends Controller
'billing.zipcode'=>'required',
'billing.city' => 'required',
'accepted_data_checkbox' => 'accepted',
+ 'billing.salutation => 'required'
);
if(!Input::get('shipping.same_as_billing')){
@@ -59,6 +60,8 @@ class CheckoutController extends Controller
'shipping.address'=>'required',
'shipping.zipcode'=>'required',
'shipping.city' => 'required',
+ 'shipping.salutation => 'required'
+
]);
}
$validator = Validator::make(Input::all(), $rules);
@@ -83,17 +86,19 @@ class CheckoutController extends Controller
public function transactionStatus($check){
- if($check == "cancel"){
- \Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
- return $this->checkout();
- }
- $pay = new PayoneController([]);
- $pay->checkStatus();
$data = \Request::all();
var_dump($data);
$data = \Input::all();
var_dump($data);
die();
+ if($check == "cancel"){
+
+ \Session::flash('checkout-error', 'Der Zahlungsvorgang wurde abgebrochen, die Bestellung konnte nicht ausgeführt werden.');
+ return $this->checkout();
+ }
+ $pay = new PayoneController([]);
+ $pay->checkStatus();
+
}
public function removeCard($rowId){
diff --git a/app/Models/PaymentTransaction.php b/app/Models/PaymentTransaction.php
new file mode 100644
index 0000000..fa9e9f7
--- /dev/null
+++ b/app/Models/PaymentTransaction.php
@@ -0,0 +1,10 @@
+increments('id');
+
+ $table->char('billing_salutation', 2)->nullable();
+ $table->string('billing_company')->nullable();
+ $table->string('billing_firstname')->nullable();
+ $table->string('billing_lastname')->nullable();
+ $table->string('billing_address')->nullable();
+ $table->string('billing_address_2')->nullable();
+ $table->string('billing_zipcode')->nullable();
+ $table->string('billing_city')->nullable();
+ $table->unsignedInteger('billing_country_id');
+ $table->string('billing_phone')->nullable();
+ $table->string('billing_email')->nullable();
+
+ $table->boolean('same_as_billing')->default(true);
+
+ $table->char('shipping_salutation', 2)->nullable();
+ $table->string('shipping_company')->nullable();
+ $table->string('shipping_firstname')->nullable();
+ $table->string('shipping_lastname')->nullable();
+ $table->string('shipping_address')->nullable();
+ $table->string('shipping_address_2')->nullable();
+ $table->string('shipping_zipcode')->nullable();
+ $table->string('shipping_city')->nullable();
+ $table->unsignedInteger('shipping_country_id');
+ $table->string('shipping_phone')->nullable();
+
+ $table->timestamps();
+
+ $table->foreign('billing_country_id')
+ ->references('id')
+ ->on('countries');
+
+ $table->foreign('shipping_country_id')
+ ->references('id')
+ ->on('countries');
+
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('shopping_users');
+ }
+}
diff --git a/database/migrations/2019_02_23_163527_create_shopping_orders_table.php b/database/migrations/2019_02_23_163527_create_shopping_orders_table.php
new file mode 100644
index 0000000..2ec8cbd
--- /dev/null
+++ b/database/migrations/2019_02_23_163527_create_shopping_orders_table.php
@@ -0,0 +1,58 @@
+increments('id');
+
+ $table->unsignedInteger('shopping_user_id');
+ $table->unsignedInteger('country_id');
+ $table->unsignedInteger('user_shop_id');
+
+ $table->decimal('total', 13, 2)->nullable();
+ $table->decimal('shipping', 8, 2)->nullable();
+ $table->decimal('subtotal', 13, 2)->nullable();
+ $table->decimal('tax_rate', 5, 2)->nullable();
+ $table->decimal('tax', 8, 2)->nullable();
+ $table->decimal('total_shipping', 13, 2)->nullable();
+
+ $table->unsignedInteger('weight')->nullable();
+
+ $table->timestamps();
+
+ $table->foreign('shopping_user_id')
+ ->references('id')
+ ->on('shopping_users');
+
+
+ $table->foreign('country_id')
+ ->references('id')
+ ->on('countries');
+
+ $table->foreign('user_shop_id')
+ ->references('id')
+ ->on('user_shops');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('shopping_orders');
+ }
+}
diff --git a/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php b/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php
new file mode 100644
index 0000000..bea89c7
--- /dev/null
+++ b/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php
@@ -0,0 +1,47 @@
+increments('id');
+
+ $table->unsignedInteger('shopping_order_id');
+ $table->unsignedInteger('product_id');
+ $table->decimal('price', 8, 2)->nullable();
+ $table->string('slug')->nullable();
+
+ $table->boolean('paid')->default(false);
+
+ $table->timestamps();
+
+ $table->foreign('shopping_order_id')
+ ->references('id')
+ ->on('shopping_orders');
+
+ $table->foreign('product_id')
+ ->references('id')
+ ->on('products');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('shopping_order_items');
+ }
+}
diff --git a/database/migrations/2019_02_23_163832_create_shopping_payments_table.php b/database/migrations/2019_02_23_163832_create_shopping_payments_table.php
new file mode 100644
index 0000000..646b7d0
--- /dev/null
+++ b/database/migrations/2019_02_23_163832_create_shopping_payments_table.php
@@ -0,0 +1,48 @@
+increments('id');
+
+ $table->unsignedInteger('shopping_order_id');
+
+ $table->string('clearingtype',3);
+ $table->string('wallettype', 3)->nullable();
+ $table->string('onlinebanktransfertype',3)->nullable();
+
+ $table->string('reference', 20);
+ $table->unsignedInteger('amount');
+ $table->string('currency', 6);
+
+
+ $table->timestamps();
+
+ $table->foreign('shopping_order_id')
+ ->references('id')
+ ->on('shopping_orders');
+
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('shopping_payments');
+ }
+}
diff --git a/database/migrations/2019_02_25_090014_create_payment_transactions_table.php b/database/migrations/2019_02_25_090014_create_payment_transactions_table.php
new file mode 100644
index 0000000..3a01103
--- /dev/null
+++ b/database/migrations/2019_02_25_090014_create_payment_transactions_table.php
@@ -0,0 +1,56 @@
+increments('id');
+
+ $table->unsignedInteger('shopping_payment_id');
+
+ $table->string('request',20);
+ $table->unsignedInteger('txid');
+ $table->unsignedInteger('userid');
+
+ $table->string('status',20)->nullable();;
+
+
+ $table->string('key',40)->nullable();;
+ $table->string('txaction',20)->nullable();;
+
+ $table->text('transmitted_data')->nullable();;
+
+ $table->unsignedInteger('errorcode')->nullable();;
+ $table->string('errormessage')->nullable();;
+ $table->string('customermessage')->nullable();;
+
+
+ $table->timestamps();
+
+ $table->foreign('shopping_payment_id')
+ ->references('id')
+ ->on('shopping_payments');
+
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('payment_transactions');
+ }
+}
diff --git a/resources/views/web/templates/checkout.blade.php b/resources/views/web/templates/checkout.blade.php
index 27c4472..ed352dd 100644
--- a/resources/views/web/templates/checkout.blade.php
+++ b/resources/views/web/templates/checkout.blade.php
@@ -85,6 +85,12 @@
}
}
+
+
+ .error .select2-selection {
+ border: #bf6464 2px dashed;
+ }
+
@@ -151,6 +157,19 @@
+
+
+
+
+
+ @if ($errors->has('billing.salutation'))
+
+ @endif
+
+
+
@@ -208,15 +227,14 @@
@endif
-
-
+
@@ -284,6 +302,18 @@
+
+
+
+
+ @if ($errors->has('shipping.firstname'))
+
+ @endif
+
+
+
@@ -350,6 +380,7 @@
+
@@ -396,24 +427,26 @@
Visa oder MasterCard (inkl. Maestro)
-