diff --git a/app/Http/Controllers/EventCheckoutController.php b/app/Http/Controllers/EventCheckoutController.php index 3dbd8920..9df58243 100644 --- a/app/Http/Controllers/EventCheckoutController.php +++ b/app/Http/Controllers/EventCheckoutController.php @@ -323,11 +323,18 @@ class EventCheckoutController extends Controller 'testMode' => config('attendize.enable_test_payments'), ]); + $transaction_data = [ + 'amount' => ($ticket_order['order_total'] + $ticket_order['organiser_booking_fee']), + 'currency' => $event->currency->code, + 'description' => 'Order for customer: ' . $request->get('order_email'), + ]; + + switch ($ticket_order['payment_gateway']->id) { case config('attendize.payment_gateway_paypal'): case config('attendize.payment_gateway_coinbase'): - $transaction_data = [ + $transaction_data += [ 'cancelUrl' => route('showEventCheckoutPaymentReturn', [ 'event_id' => $event_id, 'is_payment_cancelled' => 1 @@ -341,12 +348,26 @@ class EventCheckoutController extends Controller : $event->organiser->name ]; break; - break; case config('attendize.payment_gateway_stripe'): $token = $request->get('stripeToken'); - $transaction_data = [ + $transaction_data += [ 'token' => $token, ]; + break; + case config('attendize.payment_gateway_migs'): + + $transaction_data += [ + 'transactionId' => $event_id . date('YmdHis'), // TODO: Where to generate transaction id? + 'returnUrl' => route('showEventCheckoutPaymentReturn', [ + 'event_id' => $event_id, + 'is_payment_successful' => 1 + ]), + + ]; + + // Order description in MIGS is only 34 characters long; so we need a short description + $transaction_data['description'] = "Ticket sales " . $transaction_data['transactionId']; + break; default: Log::error('No payment gateway configured.'); @@ -357,11 +378,6 @@ class EventCheckoutController extends Controller break; } - $transaction_data = [ - 'amount' => ($ticket_order['order_total'] + $ticket_order['organiser_booking_fee']), - 'currency' => $event->currency->code, - 'description' => 'Order for customer: ' . $request->get('order_email'), - ] + $transaction_data; $transaction = $gateway->purchase($transaction_data); @@ -381,13 +397,20 @@ class EventCheckoutController extends Controller * when we return */ session()->push('ticket_order_' . $event_id . '.transaction_data', $transaction_data); + Log::info("Redirect url: " . $response->getRedirectUrl()); - return response()->json([ + $return = [ 'status' => 'success', 'redirectUrl' => $response->getRedirectUrl(), - 'redirectData' => $response->getRedirectData(), 'message' => 'Redirecting to ' . $ticket_order['payment_gateway']->provider_name - ]); + ]; + + // GET method requests should not have redirectData on the JSON return string + if($response->getRedirectMethod() == 'POST') { + $return['redirectData'] = $response->getRedirectData(); + } + + return response()->json($return); } else { // display error to customer diff --git a/app/Http/Controllers/EventViewController.php b/app/Http/Controllers/EventViewController.php index 4681bdfe..0f74d48f 100644 --- a/app/Http/Controllers/EventViewController.php +++ b/app/Http/Controllers/EventViewController.php @@ -124,4 +124,16 @@ class EventViewController extends Controller 'message' => 'Message Successfully Sent', ]); } + + public function showCalendarIcs(Request $request, $event_id) + { + $event = Event::findOrFail($event_id); + + $icsContent = $event->getIcsForEvent(); + + return response()->make($icsContent, 200, [ + 'Content-Type' => 'application/octet-stream', + 'Content-Disposition' => 'attachment; filename="event.ics' + ]); + } } diff --git a/app/Http/Controllers/ManageAccountController.php b/app/Http/Controllers/ManageAccountController.php index 8b63df18..723de830 100644 --- a/app/Http/Controllers/ManageAccountController.php +++ b/app/Http/Controllers/ManageAccountController.php @@ -136,6 +136,9 @@ class ManageAccountController extends MyBaseController case config('attendize.payment_gateway_coinbase') : //BitPay $config = $request->get('coinbase'); break; + case config('attendize.payment_gateway_migs') : //MIGS + $config = $request->get('migs'); + break; } $account_payment_gateway = AccountPaymentGateway::firstOrNew( diff --git a/app/Http/Controllers/OrganiserCustomizeController.php b/app/Http/Controllers/OrganiserCustomizeController.php index b51e8a3b..1a390248 100644 --- a/app/Http/Controllers/OrganiserCustomizeController.php +++ b/app/Http/Controllers/OrganiserCustomizeController.php @@ -4,8 +4,8 @@ namespace App\Http\Controllers; use App\Models\Organiser; use File; -use Illuminate\Http\Request; use Image; +use Illuminate\Http\Request; use Validator; class OrganiserCustomizeController extends MyBaseController @@ -43,12 +43,13 @@ class OrganiserCustomizeController extends MyBaseController ]); } - $organiser->name = $request->get('name'); - $organiser->about = $request->get('about'); - $organiser->email = $request->get('email'); + $organiser->name = $request->get('name'); + $organiser->about = $request->get('about'); + $organiser->google_analytics_code = $request->get('google_analytics_code'); + $organiser->email = $request->get('email'); $organiser->enable_organiser_page = $request->get('enable_organiser_page'); - $organiser->facebook = $request->get('facebook'); - $organiser->twitter = $request->get('twitter'); + $organiser->facebook = $request->get('facebook'); + $organiser->twitter = $request->get('twitter'); if ($request->get('remove_current_image') == '1') { $organiser->logo_path = ''; @@ -56,9 +57,9 @@ class OrganiserCustomizeController extends MyBaseController if ($request->hasFile('organiser_logo')) { $the_file = \File::get($request->file('organiser_logo')->getRealPath()); - $file_name = str_slug($organiser->name) . '-logo-' . $organiser->id . '.' . strtolower($request->file('organiser_logo')->getClientOriginalExtension()); + $file_name = str_slug($organiser->name).'-logo-'.$organiser->id.'.'.strtolower($request->file('organiser_logo')->getClientOriginalExtension()); - $relative_path_to_file = config('attendize.organiser_images_path') . '/' . $file_name; + $relative_path_to_file = config('attendize.organiser_images_path').'/'.$file_name; $full_path_to_file = public_path($relative_path_to_file); $img = Image::make($the_file); @@ -110,14 +111,14 @@ class OrganiserCustomizeController extends MyBaseController if ($validator->fails()) { return response()->json([ - 'status' => 'error', + 'status' => 'error', 'messages' => $validator->messages()->toArray(), ]); } - $event->page_bg_color = $request->get('page_bg_color'); + $event->page_bg_color = $request->get('page_bg_color'); $event->page_header_bg_color = $request->get('page_header_bg_color'); - $event->page_text_color = $request->get('page_text_color'); + $event->page_text_color = $request->get('page_text_color'); $event->save(); diff --git a/app/Http/routes.php b/app/Http/routes.php index 5bfb548a..a364c48f 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -116,6 +116,11 @@ Route::group(['prefix' => 'e'], function () { 'uses' => 'EventViewEmbeddedController@showEmbeddedEvent', ]); + Route::get('/{event_id}/calendar.ics', [ + 'as' => 'downloadCalendarIcs', + 'uses' => 'EventViewController@showCalendarIcs', + ]); + Route::get('/{event_id}/{event_slug?}', [ 'as' => 'showEventPage', 'uses' => 'EventViewController@showEventHome', diff --git a/app/Models/Account.php b/app/Models/Account.php index 32505b2f..302a2903 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -4,17 +4,12 @@ namespace App\Models; use App\Attendize\Utils; use Illuminate\Database\Eloquent\SoftDeletes; +use DB; class Account extends MyBaseModel { use SoftDeletes; - /** - * The attributes that should be mutated to dates. - * - * @var array $dates - */ - public $dates = ['deleted_at']; /** * The validation rules * @@ -25,6 +20,14 @@ class Account extends MyBaseModel 'last_name' => ['required'], 'email' => ['required', 'email'], ]; + + /** + * The attributes that should be mutated to dates. + * + * @var array $dates + */ + public $dates = ['deleted_at']; + /** * The validation error messages. * @@ -72,7 +75,7 @@ class Account extends MyBaseModel */ public function users() { - return $this->hasMany('\App\Models\User'); + return $this->hasMany(\App\Models\User::class); } /** @@ -82,7 +85,7 @@ class Account extends MyBaseModel */ public function orders() { - return $this->hasMany('\App\Models\Order'); + return $this->hasMany(\App\Models\Order::class); } /** @@ -92,17 +95,7 @@ class Account extends MyBaseModel */ public function currency() { - return $this->belongsTo('\App\Models\Currency'); - } - - /** - * Alias for $this->account_payment_gateways() - * - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function gateways() - { - return $this->account_payment_gateways(); + return $this->belongsTo(\App\Models\Currency::class); } /** @@ -112,7 +105,16 @@ class Account extends MyBaseModel */ public function account_payment_gateways() { - return $this->hasMany('\App\Models\AccountPaymentGateway'); + return $this->hasMany(\App\Models\AccountPaymentGateway::class); + } + + /** + * Alias for $this->account_payment_gateways() + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function gateways() { + return $this->account_payment_gateways(); } /** @@ -122,8 +124,18 @@ class Account extends MyBaseModel */ public function active_payment_gateway() { - return $this->hasOne('\App\Models\AccountPaymentGateway', 'payment_gateway_id', - 'payment_gateway_id')->where('account_id', $this->id); + return $this->hasOne(\App\Models\AccountPaymentGateway::class, 'payment_gateway_id', 'payment_gateway_id')->where('account_id', $this->id); + } + + /** + * Get an accounts gateways + * + * @param $gateway_id + * @return mixed + */ + public function getGateway($gateway_id) + { + return $this->gateways->where('payment_gateway_id', $gateway_id)->first(); } /** @@ -137,23 +149,14 @@ class Account extends MyBaseModel { $gateway = $this->getGateway($gateway_id); - if ($gateway && is_array($gateway->config)) { + if($gateway && is_array($gateway->config)) { return isset($gateway->config[$key]) ? $gateway->config[$key] : false; } return false; } - /** - * Get an accounts gateways - * - * @param $gateway_id - * @return mixed - */ - public function getGateway($gateway_id) - { - return $this->gateways->where('payment_gateway_id', $gateway_id)->first(); - } + /** * Get the stripe api key. diff --git a/app/Models/AccountPaymentGateway.php b/app/Models/AccountPaymentGateway.php index 00b29c12..68d26331 100644 --- a/app/Models/AccountPaymentGateway.php +++ b/app/Models/AccountPaymentGateway.php @@ -25,9 +25,8 @@ class AccountPaymentGateway extends MyBaseModel * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function account() - { - return $this->belongsTo('\App\Models\Account'); + public function account() { + return $this->belongsTo(\App\Models\Account::class); } /** @@ -37,7 +36,7 @@ class AccountPaymentGateway extends MyBaseModel */ public function payment_gateway() { - return $this->belongsTo('\App\Models\PaymentGateway', 'payment_gateway_id', 'id'); + return $this->belongsTo(\App\Models\PaymentGateway::class, 'payment_gateway_id', 'id'); } /** @@ -45,13 +44,11 @@ class AccountPaymentGateway extends MyBaseModel * * @return mixed */ - public function getConfigAttribute($value) - { + public function getConfigAttribute($value) { return json_decode($value, true); } - public function setConfigAttribute($value) - { + public function setConfigAttribute($value) { $this->attributes['config'] = json_encode($value); } } diff --git a/app/Models/Attendee.php b/app/Models/Attendee.php index 981b3584..0a2f7168 100644 --- a/app/Models/Attendee.php +++ b/app/Models/Attendee.php @@ -55,7 +55,7 @@ class Attendee extends MyBaseModel */ public function order() { - return $this->belongsTo('\App\Models\Order'); + return $this->belongsTo(\App\Models\Order::class); } /** @@ -65,7 +65,7 @@ class Attendee extends MyBaseModel */ public function ticket() { - return $this->belongsTo('\App\Models\Ticket'); + return $this->belongsTo(\App\Models\Ticket::class); } /** @@ -75,7 +75,7 @@ class Attendee extends MyBaseModel */ public function event() { - return $this->belongsTo('\App\Models\Event'); + return $this->belongsTo(\App\Models\Event::class); } /** diff --git a/app/Models/Currency.php b/app/Models/Currency.php index f4c23878..565d34e8 100644 --- a/app/Models/Currency.php +++ b/app/Models/Currency.php @@ -39,6 +39,6 @@ class Currency extends \Illuminate\Database\Eloquent\Model */ public function event() { - return $this->belongsTo('\App\Models\Event'); + return $this->belongsTo(\App\Models\Event::class); } } diff --git a/app/Models/Event.php b/app/Models/Event.php index 4ca918d6..8ab98f43 100644 --- a/app/Models/Event.php +++ b/app/Models/Event.php @@ -48,7 +48,7 @@ class Event extends MyBaseModel */ public function questions() { - return $this->belongsToMany('\App\Models\Question', 'event_question'); + return $this->belongsToMany(\App\Models\Question::class, 'event_question'); } /** @@ -56,9 +56,9 @@ class Event extends MyBaseModel * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ - public function questions_with_tashed() + public function questions_with_trashed() { - return $this->belongsToMany('\App\Models\Question', 'event_question')->withTrashed(); + return $this->belongsToMany(\App\Models\Question::class, 'event_question')->withTrashed(); } /** @@ -68,7 +68,7 @@ class Event extends MyBaseModel */ public function attendees() { - return $this->hasMany('\App\Models\Attendee'); + return $this->hasMany(\App\Models\Attendee::class); } /** @@ -78,7 +78,7 @@ class Event extends MyBaseModel */ public function images() { - return $this->hasMany('\App\Models\EventImage'); + return $this->hasMany(\App\Models\EventImage::class); } /** @@ -88,7 +88,7 @@ class Event extends MyBaseModel */ public function messages() { - return $this->hasMany('\App\Models\Message')->orderBy('created_at', 'DESC'); + return $this->hasMany(\App\Models\Message::class)->orderBy('created_at', 'DESC'); } /** @@ -98,7 +98,7 @@ class Event extends MyBaseModel */ public function tickets() { - return $this->hasMany('\App\Models\Ticket'); + return $this->hasMany(\App\Models\Ticket::class); } /** @@ -108,7 +108,7 @@ class Event extends MyBaseModel */ public function stats() { - return $this->hasMany('\App\Models\EventStats'); + return $this->hasMany(\App\Models\EventStats::class); } /** @@ -118,7 +118,7 @@ class Event extends MyBaseModel */ public function affiliates() { - return $this->hasMany('\App\Models\Affiliate'); + return $this->hasMany(\App\Models\Affiliate::class); } /** @@ -128,7 +128,7 @@ class Event extends MyBaseModel */ public function orders() { - return $this->hasMany('\App\Models\Order'); + return $this->hasMany(\App\Models\Order::class); } /** @@ -138,7 +138,7 @@ class Event extends MyBaseModel */ public function account() { - return $this->belongsTo('\App\Models\Account'); + return $this->belongsTo(\App\Models\Account::class); } /** @@ -148,7 +148,7 @@ class Event extends MyBaseModel */ public function currency() { - return $this->belongsTo('\App\Models\Currency'); + return $this->belongsTo(\App\Models\Currency::class); } /** @@ -158,7 +158,7 @@ class Event extends MyBaseModel */ public function organiser() { - return $this->belongsTo('\App\Models\Organiser'); + return $this->belongsTo(\App\Models\Organiser::class); } /** @@ -331,4 +331,32 @@ class Event extends MyBaseModel { return ['created_at', 'updated_at', 'start_date', 'end_date']; } + + public function getIcsForEvent() + { + $siteUrl = URL::to('/'); + $eventUrl = $this->getEventUrlAttribute(); + + $start_date = new Carbon($this->start_date); + $end_date = new Carbon($this->end_date); + $timestamp = new Carbon(); + + $icsTemplate = <<format('Ymd\THis\Z')} +DTSTART:{$start_date->format('Ymd\THis\Z')} +DTEND:{$end_date->format('Ymd\THis\Z')} +SUMMARY:$this->title +LOCATION:{$this->venue_name} +DESCRIPTION:{$this->description} +END:VEVENT +END:VCALENDAR +ICSTemplate; + + return $icsTemplate; + } } diff --git a/app/Models/Message.php b/app/Models/Message.php index 6121f64f..d46dc875 100644 --- a/app/Models/Message.php +++ b/app/Models/Message.php @@ -31,7 +31,7 @@ class Message extends MyBaseModel */ public function event() { - return $this->belongsTo('\App\Models\Event'); + return $this->belongsTo(\App\Models\Event::class); } /** diff --git a/app/Models/Order.php b/app/Models/Order.php index 8ec91554..732eb8b5 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -39,7 +39,7 @@ class Order extends MyBaseModel */ public function orderItems() { - return $this->hasMany('\App\Models\OrderItem'); + return $this->hasMany(\App\Models\OrderItem::class); } /** @@ -49,7 +49,7 @@ class Order extends MyBaseModel */ public function attendees() { - return $this->hasMany('\App\Models\Attendee'); + return $this->hasMany(\App\Models\Attendee::class); } /** @@ -59,7 +59,7 @@ class Order extends MyBaseModel */ public function account() { - return $this->belongsTo('\App\Models\Account'); + return $this->belongsTo(\App\Models\Account::class); } /** @@ -69,7 +69,7 @@ class Order extends MyBaseModel */ public function event() { - return $this->belongsTo('\App\Models\Event'); + return $this->belongsTo(\App\Models\Event::class); } /** @@ -79,13 +79,13 @@ class Order extends MyBaseModel */ public function tickets() { - return $this->hasMany('\App\Models\Ticket'); + return $this->hasMany(\App\Models\Ticket::class); } public function payment_gateway() { - return $this->belongsTo('\App\Models\PaymentGateway'); + return $this->belongsTo(\App\Models\PaymentGateway::class); } /** @@ -95,7 +95,7 @@ class Order extends MyBaseModel */ public function orderStatus() { - return $this->belongsTo('\App\Models\OrderStatus'); + return $this->belongsTo('\App\Models\\App\Models\OrderStatus::class'); } diff --git a/app/Models/Organiser.php b/app/Models/Organiser.php index 30ef6a68..61b81d0c 100644 --- a/app/Models/Organiser.php +++ b/app/Models/Organiser.php @@ -36,7 +36,7 @@ class Organiser extends MyBaseModel */ public function account() { - return $this->belongsTo('\App\Models\Account'); + return $this->belongsTo(\App\Models\Account::class); } /** @@ -46,7 +46,7 @@ class Organiser extends MyBaseModel */ public function events() { - return $this->hasMany('\App\Models\Event'); + return $this->hasMany(\App\Models\Event::class); } /** @@ -56,7 +56,7 @@ class Organiser extends MyBaseModel */ public function attendees() { - return $this->hasManyThrough('\App\Models\Attendee', '\App\Models\Event'); + return $this->hasManyThrough(\App\Models\Attendee::class, \App\Models\Event::class); } /** @@ -66,7 +66,7 @@ class Organiser extends MyBaseModel */ public function orders() { - return $this->hasManyThrough('\App\Models\Order', '\App\Models\Event'); + return $this->hasManyThrough(\App\Models\Order::class, \App\Models\Event::class); } /** diff --git a/app/Models/Question.php b/app/Models/Question.php index eed81b0c..28a8fd5d 100644 --- a/app/Models/Question.php +++ b/app/Models/Question.php @@ -21,7 +21,7 @@ class Question extends MyBaseModel */ public function events() { - return $this->belongsToMany('\App\Models\Event'); + return $this->belongsToMany(\App\Models\Event::class); } /** @@ -32,12 +32,12 @@ class Question extends MyBaseModel */ public function question_type() { - return $this->belongsTo('\App\Models\QuestionType'); + return $this->belongsTo(\App\Models\QuestionType::class); } public function answers() { - return $this->hasMany('\App\Models\QuestionAnswer'); + return $this->hasMany(\App\Models\QuestionAnswer::class); } /** @@ -48,12 +48,12 @@ class Question extends MyBaseModel */ public function options() { - return $this->hasMany('\App\Models\QuestionOption'); + return $this->hasMany(\App\Models\QuestionOption::class); } public function tickets() { - return $this->belongsToMany('\App\Models\Ticket'); + return $this->belongsToMany(\App\Models\Ticket::class); } /** diff --git a/app/Models/QuestionAnswer.php b/app/Models/QuestionAnswer.php index 421fc2fb..6f31dd4b 100644 --- a/app/Models/QuestionAnswer.php +++ b/app/Models/QuestionAnswer.php @@ -20,7 +20,7 @@ class QuestionAnswer extends MyBaseModel */ public function event() { - return $this->belongsToMany('\App\Models\Event'); + return $this->belongsToMany(\App\Models\Event::class); } /** @@ -28,7 +28,7 @@ class QuestionAnswer extends MyBaseModel */ public function question() { - return $this->belongsTo('\App\Models\Question')->withTrashed(); + return $this->belongsTo(\App\Models\Question::class)->withTrashed(); } /** @@ -36,7 +36,7 @@ class QuestionAnswer extends MyBaseModel */ public function attendee() { - return $this->belongsTo('\App\Models\Attendee'); + return $this->belongsTo(\App\Models\Attendee::class); } } diff --git a/app/Models/QuestionOption.php b/app/Models/QuestionOption.php index a3e801c4..d1e4d5d6 100644 --- a/app/Models/QuestionOption.php +++ b/app/Models/QuestionOption.php @@ -27,6 +27,6 @@ class QuestionOption extends MyBaseModel */ public function question() { - return $this->belongsTo('\App\Models\Question'); + return $this->belongsTo(\App\Models\Question::class); } } diff --git a/app/Models/Ticket.php b/app/Models/Ticket.php index 7c3d179c..99de477c 100644 --- a/app/Models/Ticket.php +++ b/app/Models/Ticket.php @@ -39,7 +39,7 @@ class Ticket extends MyBaseModel */ public function event() { - return $this->belongsTo('\App\Models\Event'); + return $this->belongsTo(\App\Models\Event::class); } /** @@ -49,7 +49,7 @@ class Ticket extends MyBaseModel */ public function order() { - return $this->belongsToMany('\App\Models\Order'); + return $this->belongsToMany(\App\Models\Order::class); } /** @@ -59,7 +59,7 @@ class Ticket extends MyBaseModel */ public function questions() { - return $this->belongsToMany('\App\Models\Question'); + return $this->belongsToMany(\App\Models\Question::class); } /** diff --git a/app/Models/User.php b/app/Models/User.php index e4274e1d..f0e3196a 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -60,7 +60,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon */ public function account() { - return $this->belongsTo('\App\Models\Account'); + return $this->belongsTo(\App\Models\Account::class); } /** @@ -70,7 +70,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon */ public function activity() { - return $this->hasMany('\App\Models\Activity'); + return $this->hasMany(\App\Models\Activity::class); } /** diff --git a/composer.json b/composer.json index 5356e4e8..f494c718 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,9 @@ "omnipay/bitpay": "dev-master", "omnipay/coinbase": "dev-master", "laracasts/utilities": "^2.1", - "predis/predis": "~1.0" + "predis/predis": "~1.0", + "guzzlehttp/guzzle": "^6.2", + "omnipay/migs": "^2.1" }, "require-dev": { "phpunit/phpunit": "~4.0", diff --git a/config/attendize.php b/config/attendize.php index a571b021..8b54c57e 100644 --- a/config/attendize.php +++ b/config/attendize.php @@ -11,6 +11,7 @@ return [ 'payment_gateway_stripe' => 1, 'payment_gateway_paypal' => 2, 'payment_gateway_coinbase' => 3, + 'payment_gateway_migs' => 4, 'outgoing_email_noreply' => env('MAIL_FROM_ADDRESS'), 'outgoing_email' => env('MAIL_FROM_ADDRESS'), @@ -61,7 +62,7 @@ return [ 'default_datetime_format' => 'F j, Y, g:i a', 'default_query_cache' => 120, #Minutes 'default_locale' => 'en', - 'default_payment_gateway' => 1, #Stripe=1 Paypal=2 BitPay=3 + 'default_payment_gateway' => 1, #Stripe=1 Paypal=2 BitPay=3 MIGS=4 'cdn_url_user_assets' => '', 'cdn_url_static_assets' => '' diff --git a/config/database.php b/config/database.php index 2ae8fe39..2a9b369b 100644 --- a/config/database.php +++ b/config/database.php @@ -66,7 +66,7 @@ return [ 'password' => env('DB_PASSWORD'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'prefix' => '', + 'prefix' => env('DB_PREFIX'), 'strict' => false, ], diff --git a/config/services.php b/config/services.php index cc3097f8..bda1e037 100644 --- a/config/services.php +++ b/config/services.php @@ -15,8 +15,8 @@ return [ */ 'mailgun' => [ - 'domain' => '', - 'secret' => '', + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), ], 'mandrill' => [ diff --git a/database/migrations/2016_09_16_221455_add_google_analytics_code_to_organiser.php b/database/migrations/2016_09_16_221455_add_google_analytics_code_to_organiser.php new file mode 100644 index 00000000..ab3e0599 --- /dev/null +++ b/database/migrations/2016_09_16_221455_add_google_analytics_code_to_organiser.php @@ -0,0 +1,31 @@ +string('google_analytics_code')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('organisers', function (Blueprint $table) { + $table->dropColumn('google_analytics_code'); + }); + } +} diff --git a/database/seeds/PaymentGatewaySeeder.php b/database/seeds/PaymentGatewaySeeder.php index 9b3af096..03f6528d 100644 --- a/database/seeds/PaymentGatewaySeeder.php +++ b/database/seeds/PaymentGatewaySeeder.php @@ -37,6 +37,14 @@ class PaymentGatewaySeeder extends Seeder 'is_on_site' => 0, 'can_refund' => 0, ], + [ + 'id' => 4, + 'name' => 'Migs_ThreeParty', + 'provider_name' => 'MasterCard Internet Gateway Service', + 'provider_url' => 'https://www.mastercard.com/gateway/payment-processing/online-credit-card-and-debit-card-payment-processing.html', + 'is_on_site' => 0, + 'can_refund' => 0, + ], ]; DB::table('payment_gateways')->insert($payment_gateways); diff --git a/public/assets/images/Opera-logo.png b/public/assets/images/Opera-logo.png old mode 100755 new mode 100644 diff --git a/public/assets/images/chrome_logo.gif b/public/assets/images/chrome_logo.gif old mode 100755 new mode 100644 diff --git a/public/assets/images/down.png b/public/assets/images/down.png old mode 100755 new mode 100644 diff --git a/public/assets/images/firefox.png b/public/assets/images/firefox.png old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-backstretch/examples/basic.html b/public/vendor/jquery-backstretch/examples/basic.html old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-backstretch/examples/click.html b/public/vendor/jquery-backstretch/examples/click.html old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-backstretch/examples/coffee.jpg b/public/vendor/jquery-backstretch/examples/coffee.jpg old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-backstretch/examples/pot-holder.jpg b/public/vendor/jquery-backstretch/examples/pot-holder.jpg old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-backstretch/examples/slideshow.html b/public/vendor/jquery-backstretch/examples/slideshow.html old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-backstretch/test/image2.jpg b/public/vendor/jquery-backstretch/test/image2.jpg old mode 100755 new mode 100644 diff --git a/public/vendor/jquery-minicolors/readme.md b/public/vendor/jquery-minicolors/readme.md old mode 100755 new mode 100644 diff --git a/resources/views/Mailers/TicketMailer/SendOrderTickets.blade.php b/resources/views/Mailers/TicketMailer/SendOrderTickets.blade.php index b563d4b8..f825eb46 100644 --- a/resources/views/Mailers/TicketMailer/SendOrderTickets.blade.php +++ b/resources/views/Mailers/TicketMailer/SendOrderTickets.blade.php @@ -17,7 +17,7 @@ Order Reference: {{$order->order_reference}}
Order Name: {{$order->full_name}}
Order Date: {{$order->created_at->toDayDateTimeString()}}
Order Email: {{$order->email}}
- +Add To Calendar

Order Items

diff --git a/resources/views/ManageAccount/Partials/PaymentGatewayOptions.blade.php b/resources/views/ManageAccount/Partials/PaymentGatewayOptions.blade.php index e235ed78..36f2c4a9 100644 --- a/resources/views/ManageAccount/Partials/PaymentGatewayOptions.blade.php +++ b/resources/views/ManageAccount/Partials/PaymentGatewayOptions.blade.php @@ -121,6 +121,36 @@ +{{--BDO MIGS--}} +
+

Mastercard Internet Gateway Service Settings

+ +
+
+
+ {!! Form::label('migs[merchantAccessCode]', 'Merchant Access Code', array('class'=>'control-label ')) !!} + {!! Form::text('migs[merchantAccessCode]', $account->getGatewayConfigVal(config('attendize.payment_gateway_migs'), 'merchantAccessCode'),[ 'class'=>'form-control']) !!} +
+
+
+
+ {!! Form::label('migs[merchantId]', 'Merchant ID', ['class'=>'control-label ']) !!} + {!! Form::text('migs[merchantId]', $account->getGatewayConfigVal(config('attendize.payment_gateway_migs'), 'merchantId'),[ 'class'=>'form-control']) !!} +
+
+
+
+
+
+ {!! Form::label('migs[secureHash]', 'Secure Hash Code', array('class'=>'control-label ')) !!} + {!! Form::text('migs[secureHash]', $account->getGatewayConfigVal(config('attendize.payment_gateway_migs'), 'secureHash'),[ 'class'=>'form-control']) !!} +
+
+
+ + +
+ diff --git a/resources/views/ManageOrganiser/Customize.blade.php b/resources/views/ManageOrganiser/Customize.blade.php index e9916289..2bd7fcec 100644 --- a/resources/views/ManageOrganiser/Customize.blade.php +++ b/resources/views/ManageOrganiser/Customize.blade.php @@ -93,7 +93,13 @@ 'rows' => 4 )) !!} - +
+ {!! Form::label('google_analytics_code', 'Organiser Analytics Code', array('class'=>'control-label')) !!} + {!! Form::text('google_analytics_code', Input::old('google_analytics_code'), + array( + 'class'=>'form-control' + )) !!} +
diff --git a/resources/views/Public/Partials/ga.blade.php b/resources/views/Public/Partials/ga.blade.php new file mode 100644 index 00000000..baf7e9a3 --- /dev/null +++ b/resources/views/Public/Partials/ga.blade.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/resources/views/Public/ViewOrganiser/Layouts/OrganiserPage.blade.php b/resources/views/Public/ViewOrganiser/Layouts/OrganiserPage.blade.php index 29dff25d..434be11b 100644 --- a/resources/views/Public/ViewOrganiser/Layouts/OrganiserPage.blade.php +++ b/resources/views/Public/ViewOrganiser/Layouts/OrganiserPage.blade.php @@ -45,5 +45,6 @@ {!!HTML::script('assets/javascript/frontend.js')!!} @include('Shared.Partials.GlobalFooterJS') + @yield('foot') diff --git a/resources/views/Public/ViewOrganiser/OrganiserPage.blade.php b/resources/views/Public/ViewOrganiser/OrganiserPage.blade.php index 11a5e71c..c4658a5c 100644 --- a/resources/views/Public/ViewOrganiser/OrganiserPage.blade.php +++ b/resources/views/Public/ViewOrganiser/OrganiserPage.blade.php @@ -20,4 +20,10 @@ @include('Public.ViewOrganiser.Partials.OrganiserHeaderSection') @include('Public.ViewOrganiser.Partials.OrganiserEventsSection') @include('Public.ViewOrganiser.Partials.OrganiserFooterSection') -@stop \ No newline at end of file +@stop + +@if($organiser->google_analytics_code) + @section('foot') + @include('Public.Partials.ga', ['analyticsCode' => $organiser->google_analytics_code]) + @stop +@endif \ No newline at end of file