payment Card first 4 payments inc. mails

This commit is contained in:
Kevin Adametz 2019-02-28 18:09:54 +01:00
parent c20deac3fe
commit 6e3adac4d7
38 changed files with 3063 additions and 921 deletions

View file

@ -6,5 +6,30 @@ use Illuminate\Database\Eloquent\Model;
class PaymentTransaction extends Model
{
//
protected $table = 'payment_transactions';
protected $casts = [
'transmitted_data' => 'array'
];
protected $fillable = [
'shopping_payment_id',
'request',
'txid',
'userid',
'status',
'key',
'txaction',
'transmitted_data',
'errorcode',
'errormessage',
'customermessage',
];
public function shopping_payment()
{
return $this->belongsTo('App\Models\ShoppingPayment','shopping_payment_id');
}
}

View file

@ -6,5 +6,77 @@ use Illuminate\Database\Eloquent\Model;
class ShoppingOrder extends Model
{
//
protected $table = 'shopping_orders';
protected $fillable = [
'shopping_user_id',
'country_id',
'user_shop_id',
'total',
'shipping',
'subtotal',
'tax_rate',
'tax',
'total_shipping',
'weight',
];
public function shopping_user()
{
return $this->belongsTo('App\Models\ShoppingUser','shopping_user_id');
}
public function country()
{
return $this->belongsTo('App\Models\Country','country_id');
}
public function user_shop()
{
return $this->belongsTo('App\Models\UserShop','user_shop_id');
}
public function shopping_order_items(){
return $this->hasMany('App\Models\ShoppingOrderItem', 'shopping_order_id');
}
public function shopping_payments(){
return $this->hasMany('App\Models\ShoppingPayment', 'shopping_order_id');
}
public function _format_number($value)
{
return preg_replace("/[^0-9,]/", "", $value);
}
public function getFormattedShipping()
{
if (\App::getLocale() == "en") {
return number_format($this->attributes['shipping'], 2, '.', ',');
}
return number_format($this->attributes['shipping'], 2, ',', '.');
}
public function getFormattedTotalShipping()
{
if (\App::getLocale() == "en") {
return number_format($this->attributes['total_shipping'], 2, '.', ',');
}
return number_format($this->attributes['total_shipping'], 2, ',', '.');
}
public function getFormattedPrice()
{
if (\App::getLocale() == "en") {
return number_format($this->attributes['price'], 2, '.', ',');
}
return number_format($this->attributes['price'], 2, ',', '.');
}
}

View file

@ -6,5 +6,34 @@ use Illuminate\Database\Eloquent\Model;
class ShoppingOrderItem extends Model
{
//
}
protected $table = 'shopping_order_items';
protected $fillable = [
'shopping_order_id',
'row_id',
'product_id',
'qty',
'price',
'slug',
];
public function shopping_order()
{
return $this->belongsTo('App\Models\ShoppingOrder','shopping_order_id');
}
public function product()
{
return $this->belongsTo('App\Models\Product','product_id');
}
public function getFormattedPrice()
{
if (\App::getLocale() == "en") {
return number_format($this->attributes['price'], 2, '.', ',');
}
return number_format($this->attributes['price'], 2, ',', '.');
}
}

View file

@ -6,5 +6,47 @@ use Illuminate\Database\Eloquent\Model;
class ShoppingPayment extends Model
{
//
}
protected $table = 'shopping_payments';
protected $fillable = [
'shopping_order_id',
'clearingtype',
'wallettype',
'onlinebanktransfertype',
'reference',
'amount',
'currency',
];
public function shopping_order()
{
return $this->belongsTo('App\Models\ShoppingOrder','shopping_order_id');
}
public function payment_transactions()
{
return $this->hasMany('App\Models\PaymentTransaction','shopping_payment_id');
}
public function getPaymentType(){
if($this->clearingtype == 'wlt') {
if ($this->wallettype == 'PPE') {
return 'PayPal';
}
}
if($this->clearingtype == 'cc') {
return 'Kreditkarte';
}
if($this->clearingtype == 'vor') {
return 'Vorkasse';
}
if($this->clearingtype == 'sb') {
if ($this->onlinebanktransfertype == 'PNT') {
return 'Sofort Überweisung';
}
}
}
}

View file

@ -6,5 +6,49 @@ use Illuminate\Database\Eloquent\Model;
class ShoppingUser extends Model
{
//
}
protected $table = 'shopping_users';
protected $fillable = [
'billing_salutation',
'billing_company',
'billing_firstname',
'billing_lastname',
'billing_address',
'billing_address_2',
'billing_zipcode',
'billing_city',
'billing_country_id',
'billing_phone',
'billing_email',
'accepted_data_checkbox',
'same_as_billing',
'shipping_salutation',
'shipping_company',
'shipping_firstname',
'shipping_lastname',
'shipping_address',
'shipping_address_2',
'shipping_zipcode',
'shipping_city',
'shipping_country_id',
'shipping_phone',
];
public function billing_country()
{
return $this->belongsTo('App\Models\Country','billing_country_id');
}
public function shipping_country()
{
return $this->belongsTo('App\Models\Country','shipping_country_id');
}
public function Shopping_orders()
{
return $this->hasMany('App\Models\ShoppingOrder','shopping_user_id');
}
}