From 24ee1d352d5ec0f1455e92cdacbbe194fac18286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Gonz=C3=A1lez?= Date: Sun, 7 Aug 2022 18:57:29 +0200 Subject: [PATCH] Adding Stripe link payments --- README.md | 1 + application/config/config.php | 12 + application/controllers/Booking.php | 4 + .../controllers/Booking_confirmation.php | 20 ++ application/controllers/Calendar.php | 14 +- application/controllers/Payment.php | 245 ++++++++++++++++++ application/controllers/Services.php | 2 + .../language/arabic/translations_lang.php | 11 + .../language/bulgarian/translations_lang.php | 11 + .../language/catalan/translations_lang.php | 11 + .../language/chinese/translations_lang.php | 11 + .../language/croatian/translations_lang.php | 11 + .../language/czech/translations_lang.php | 11 + .../language/danish/translations_lang.php | 11 + .../language/dutch/translations_lang.php | 11 + .../language/english/translations_lang.php | 11 + .../language/estonian/translations_lang.php | 11 + .../language/finnish/translations_lang.php | 12 + .../language/french/translations_lang.php | 13 + .../language/german/translations_lang.php | 11 + .../language/greek/translations_lang.php | 11 + .../language/hebrew/translations_lang.php | 11 + .../language/hindi/translations_lang.php | 11 + .../language/hungarian/translations_lang.php | 11 + .../language/italian/translations_lang.php | 11 + .../language/japanese/translations_lang.php | 11 + .../luxembourgish/translations_lang.php | 11 + .../language/marathi/translations_lang.php | 11 + .../language/persian/translations_lang.php | 11 + .../language/polish/translations_lang.php | 11 + .../portuguese-br/translations_lang.php | 11 + .../language/portuguese/translations_lang.php | 11 + .../language/romanian/translations_lang.php | 11 + .../language/russian/translations_lang.php | 12 + .../language/serbian/translations_lang.php | 11 + .../language/slovak/translations_lang.php | 18 ++ .../language/spanish/translations_lang.php | 11 + .../language/swedish/translations_lang.php | 11 + .../language/turkish/translations_lang.php | 11 + application/libraries/Email_messages.php | 15 ++ ...nt_intent_column_to_appointments_table.php | 48 ++++ ...d_is_paid_column_to_appointments_table.php | 49 ++++ ..._payment_link_column_to_services_table.php | 48 ++++ application/models/Appointments_model.php | 13 + application/models/Services_model.php | 10 +- .../views/components/appointments_modal.php | 16 ++ .../views/components/booking_type_step.php | 18 +- .../emails/appointment_deleted_email.php | 10 + .../views/emails/appointment_saved_email.php | 13 + application/views/pages/booking.php | 7 +- .../views/pages/booking_confirmation.php | 7 + application/views/pages/payment.php | 40 +++ application/views/pages/services.php | 10 + assets/js/components/appointments_modal.js | 13 + assets/js/pages/services.js | 3 + assets/js/utils/calendar_default_view.js | 21 ++ assets/js/utils/calendar_event_popover.js | 25 ++ assets/js/utils/calendar_table_view.js | 16 ++ composer.json | 3 +- composer.lock | 63 ++++- config-sample.php | 8 + docs/stripe-payment-links.md | 60 +++++ 62 files changed, 1164 insertions(+), 13 deletions(-) create mode 100755 application/controllers/Payment.php create mode 100644 application/migrations/045_add_payment_intent_column_to_appointments_table.php create mode 100644 application/migrations/046_add_is_paid_column_to_appointments_table.php create mode 100644 application/migrations/047_add_payment_link_column_to_services_table.php create mode 100755 application/views/pages/payment.php create mode 100644 docs/stripe-payment-links.md diff --git a/README.md b/README.md index 8dee30a878..3294810212 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ The application is designed to be flexible enough so that it can handle any ente * Self hosted installation. * Translated user interface. * User community support. +* Service payment by [Stripe Payment links](https://stripe.com/en-gb-es/payments/payment-links) ## Setup diff --git a/application/config/config.php b/application/config/config.php index 4ca2c8022d..4fbd60fa3a 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -457,5 +457,17 @@ */ $config['rate_limiting'] = true; +/* +|-------------------------------------------------------------------------- +| Stripe Payment Configuration +|-------------------------------------------------------------------------- +| +| Declare some of the global config values of the Stripe Payments +| +*/ + +$config['stripe_payment_feature'] = Config::STRIPE_PAYMENT_FEATURE; +$config['stripe_api_key'] = Config::STRIPE_API_KEY; + /* End of file config.php */ /* Location: ./application/config/config.php */ diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 45f1a34575..7babb6efda 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -209,6 +209,7 @@ public function index(): void $provider = $this->providers_model->find($appointment['id_users_provider']); $customer = $this->customers_model->find($appointment['id_users_customer']); $customer_token = md5(uniqid(mt_rand(), true)); + $is_paid = $appointment['is_paid']; // Cache the token for 10 minutes. $this->cache->save('customer-token-' . $customer_token, $customer['id'], 600); @@ -218,6 +219,7 @@ public function index(): void $appointment = null; $provider = null; $customer = null; + $is_paid = 0; } script_vars([ @@ -276,9 +278,11 @@ public function index(): void 'grouped_timezones' => $grouped_timezones, 'manage_mode' => $manage_mode, 'customer_token' => $customer_token, + 'is_paid' => $is_paid, 'appointment_data' => $appointment, 'provider_data' => $provider, 'customer_data' => $customer, + 'company_email' => setting('company_email'), ]); $this->load->view('pages/booking'); diff --git a/application/controllers/Booking_confirmation.php b/application/controllers/Booking_confirmation.php index d743678f7d..900edde2f1 100755 --- a/application/controllers/Booking_confirmation.php +++ b/application/controllers/Booking_confirmation.php @@ -56,12 +56,32 @@ public function of(): void $add_to_google_url = $this->google_sync->get_add_to_google_url($appointment['id']); + $service = $this->services_model->find($appointment['id_services']); + + $customer = $this->customers_model->find($appointment['id_users_customer']); + + $payment_link = null; + if( isset($service['payment_link']) && !empty(trim($service['payment_link']))){ + $payment_link_vars = array( + '{$appointment_hash}' => $appointment['hash'], + '{$customer_email}' => $customer['email'], + ); + $payment_link_template = $service['payment_link'] + . (str_contains($service['payment_link'], '?') + ? '' : '?') + . 'client_reference_id={$appointment_hash}&prefilled_email={$customer_email}'; + + $payment_link = strtr($payment_link_template, $payment_link_vars); + } + html_vars([ 'page_title' => lang('success'), 'company_color' => setting('company_color'), 'google_analytics_code' => setting('google_analytics_code'), 'matomo_analytics_url' => setting('matomo_analytics_url'), 'add_to_google_url' => $add_to_google_url, + 'is_paid' => $appointment['is_paid'], + 'payment_link' => $payment_link, ]); $this->load->view('pages/booking_confirmation'); diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index f915e82567..c7af9d4d15 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -145,6 +145,7 @@ public function index(string $appointment_hash = ''): void 'secretary_providers' => $secretary_providers, 'edit_appointment' => $edit_appointment, 'customers' => $this->customers_model->get(null, 50, null, 'update_datetime DESC'), + 'stripe_payment_feature' => config('stripe_payment_feature'), ]); html_vars([ @@ -255,6 +256,7 @@ public function save_appointment(): void 'id_users_provider', 'id_users_customer', 'id_services', + 'is_paid', ]); $appointment['id'] = $this->appointments_model->save($appointment); @@ -654,17 +656,17 @@ public function get_calendar_appointments(): void $start_date . ' AND start_datetime < ' . $end_date . - ') + ') or (end_datetime > ' . $start_date . ' AND end_datetime < ' . $end_date . - ') + ') or (start_datetime <= ' . $start_date . ' AND end_datetime >= ' . $end_date . - ')) + ')) AND is_unavailability = 0 '; @@ -691,17 +693,17 @@ public function get_calendar_appointments(): void $start_date . ' AND start_datetime < ' . $end_date . - ') + ') or (end_datetime > ' . $start_date . ' AND end_datetime < ' . $end_date . - ') + ') or (start_datetime <= ' . $start_date . ' AND end_datetime >= ' . $end_date . - ')) + ')) AND is_unavailability = 1 '; diff --git a/application/controllers/Payment.php b/application/controllers/Payment.php new file mode 100755 index 0000000000..7ee4ea9d28 --- /dev/null +++ b/application/controllers/Payment.php @@ -0,0 +1,245 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.0.0 + * ---------------------------------------------------------------------------- */ + +/** + * Payment confirmation controller. + * + * Handles the confirmation of a payment. + * + * + * @package Controllers + */ +class Payment extends EA_Controller { + /** + * Booking constructor. + */ + public function __construct() + { + parent::__construct(); + + $this->load->model('appointments_model'); + $this->load->model('providers_model'); + $this->load->model('admins_model'); + $this->load->model('secretaries_model'); + $this->load->model('categories_model'); + $this->load->model('services_model'); + $this->load->model('customers_model'); + $this->load->model('settings_model'); + $this->load->model('consents_model'); + + $this->load->library('timezones'); + $this->load->library('synchronization'); + $this->load->library('notifications'); + $this->load->library('availability'); + $this->load->library('webhooks_client'); + + $this->load->driver('cache', ['adapter' => 'file']); + } + + /** + * Render the payment confirmation page. + */ + public function index() + { + if ( ! is_app_installed()) + { + redirect('installation'); + + return; + } + + $appointment = html_vars('appointment'); + + if (empty($appointment)) { + abort(404, "Forbidden"); + } else { + $manage_mode = TRUE; + $company_name = setting('company_name'); + $company_logo = setting('company_logo'); + $company_color = setting('company_color'); + $google_analytics_code = setting('google_analytics_code'); + $matomo_analytics_url = setting('matomo_analytics_url'); + $date_format = setting('date_format'); + $time_format = setting('time_format'); + + $display_first_name = setting('display_first_name'); + $require_first_name = setting('require_first_name'); + $display_last_name = setting('display_last_name'); + $require_last_name = setting('require_last_name'); + $display_email = setting('display_email'); + $require_email = setting('require_email'); + $display_phone_number = setting('display_phone_number'); + $require_phone_number = setting('require_phone_number'); + $display_address = setting('display_address'); + $require_address = setting('require_address'); + $display_city = setting('display_city'); + $require_city = setting('require_city'); + $display_zip_code = setting('display_zip_code'); + $require_zip_code = setting('require_zip_code'); + $display_notes = setting('display_notes'); + $require_notes = setting('require_notes'); + $display_cookie_notice = setting('display_cookie_notice'); + $cookie_notice_content = setting('cookie_notice_content'); + $display_terms_and_conditions = setting('display_terms_and_conditions'); + $terms_and_conditions_content = setting('terms_and_conditions_content'); + $display_privacy_policy = setting('display_privacy_policy'); + $privacy_policy_content = setting('privacy_policy_content'); + + $theme = request('theme', setting('theme', 'default')); + if (empty($theme) || ! file_exists(__DIR__ . '/../../assets/css/themes/' . $theme . '.min.css')) + { + $theme = 'default'; + } + + $timezones = $this->timezones->to_array(); + $grouped_timezones = $this->timezones->to_grouped_array(); + $provider = $this->providers_model->find($appointment['id_users_provider']); + $customer = $this->customers_model->find($appointment['id_users_customer']); + + script_vars([ + 'date_format' => $date_format, + 'time_format' => $time_format, + 'display_cookie_notice' => $display_cookie_notice, + 'display_any_provider' => setting('display_any_provider'), + ]); + + html_vars([ + 'theme' => $theme, + 'company_name' => $company_name, + 'company_logo' => $company_logo, + 'company_color' => $company_color === '#ffffff' ? '' : $company_color, + 'date_format' => $date_format, + 'time_format' => $time_format, + 'display_first_name' => $display_first_name, + 'display_last_name' => $display_last_name, + 'display_email' => $display_email, + 'display_phone_number' => $display_phone_number, + 'display_address' => $display_address, + 'display_city' => $display_city, + 'display_zip_code' => $display_zip_code, + 'display_notes' => $display_notes, + 'google_analytics_code' => $google_analytics_code, + 'matomo_analytics_url' => $matomo_analytics_url, + 'timezones' => $timezones, + 'grouped_timezones' => $grouped_timezones, + 'appointment' => $appointment, + 'provider' => $provider, + 'customer' => $customer, + ]); + + $this->load->view('pages/payment'); + } + } + + /** + * Validates Stripe payment and render confirmation screen for the appointment. + * + * This method sets a flag as paid for an appointment and call the "index" callback + * to handle the page rendering. + * + * @param string $checkout_session_id Stripe session id. + */ + public function confirm(string $checkout_session_id) + { + try + { + $stripe_api_key = config('stripe_api_key'); + + $stripe = new \Stripe\StripeClient($stripe_api_key); + + $session = $stripe->checkout->sessions->retrieve($checkout_session_id); + + $appointment_hash = $session->client_reference_id; + $payment_intent = $session->payment_intent; + + $appointment = $this->set_paid($appointment_hash, $payment_intent); + + html_vars(['appointment' => $appointment]); + + $this->index(); + } + catch (Throwable $e) + { + error_log( $e ); + abort(500, 'Internal server error'); + } + } + + /** + * Sets a paid flag and paid intent for an appointment to track paid bookings. + */ + private function set_paid($appointment_hash, $payment_intent) + { + try + { + $manage_mode = TRUE; + + $occurrences = $this->appointments_model->get(['hash' => $appointment_hash]); + + if (empty($occurrences)) + { + abort(404, 'Not Found'); + } + + $appointment = $occurrences[0]; + + $provider = $this->providers_model->find($appointment['id_users_provider']); + + $customer = $this->customers_model->find($appointment['id_users_customer']); + + $service = $this->services_model->find($appointment['id_services']); + + + $appointment['is_paid'] = 1; + $appointment['payment_intent'] = $payment_intent; + $this->appointments_model->only($appointment, [ + 'id', + 'start_datetime', + 'end_datetime', + 'location', + 'notes', + 'color', + 'is_unavailability', + 'id_users_provider', + 'id_users_customer', + 'id_services', + 'is_paid', + 'payment_intent', + ]); + $appointment_id = $this->appointments_model->save($appointment); + $appointment = $this->appointments_model->find($appointment_id); + + $settings = [ + 'company_name' => setting('company_name'), + 'company_link' => setting('company_link'), + 'company_email' => setting('company_email'), + 'date_format' => setting('date_format'), + 'time_format' => setting('time_format') + ]; + + $this->synchronization->sync_appointment_saved($appointment, $service, $provider, $customer, $settings, $manage_mode); + + $this->notifications->notify_appointment_saved($appointment, $service, $provider, $customer, $settings, $manage_mode); + + $this->webhooks_client->trigger(WEBHOOK_APPOINTMENT_SAVE, $appointment); + + return $appointment; + } + catch (Throwable $e) + { + error_log( $e ); + abort(500, 'Internal server error'); + } + } + +} diff --git a/application/controllers/Services.php b/application/controllers/Services.php index aff2aa968d..bc2ea183dd 100644 --- a/application/controllers/Services.php +++ b/application/controllers/Services.php @@ -126,6 +126,7 @@ public function store(): void 'attendants_number', 'is_private', 'id_service_categories', + 'payment_link', ]); $this->services_model->optional($service, [ @@ -192,6 +193,7 @@ public function update(): void 'attendants_number', 'is_private', 'id_service_categories', + 'payment_link', ]); $this->services_model->optional($service, [ diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 5934f0fbfd..3aabc59f25 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 6b0a2479ab..556302ef4f 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index a89f6f2edd..058be376cc 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 839141f50e..a7190eef70 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/croatian/translations_lang.php b/application/language/croatian/translations_lang.php index 31516e314e..2eae84225d 100644 --- a/application/language/croatian/translations_lang.php +++ b/application/language/croatian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index bd10ad87ec..93bff4ff47 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index 2746ec2f47..84e5ae69bf 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index ebbf789916..533ab763e9 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index a4a00080ff..9b6177b42d 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/estonian/translations_lang.php b/application/language/estonian/translations_lang.php index 84663eedfa..c1277cb674 100644 --- a/application/language/estonian/translations_lang.php +++ b/application/language/estonian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index d0602c2222..34bb529a26 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -453,4 +453,16 @@ $lang['webhook_deleted'] = 'Webhook poistettu onnistuneesti.'; $lang['delete_webhook'] = 'Poista Webhook'; $lang['contact_info'] = 'Yhteystiedot'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; + // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 71f39e3b22..02df710b3b 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -453,4 +453,17 @@ $lang['webhook_deleted'] = 'Webhook supprimé avec succès.'; $lang['delete_webhook'] = 'Supprimer le webhook'; $lang['contact_info'] = 'Coordonnées'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index 50c658c04d..08b11316eb 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index bd62092bf5..84661d2b47 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 9b9d5d830b..466a5f5bca 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index 5149418da7..453eed6f18 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index 7360603b08..10d383804a 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index ef994d10d7..7b366bcd04 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index 6dc3ba3561..40b775c786 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 297358c828..a5806c42bc 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 97667b30f2..f56fff69f9 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/persian/translations_lang.php b/application/language/persian/translations_lang.php index 3fa289c21d..8d3846b925 100644 --- a/application/language/persian/translations_lang.php +++ b/application/language/persian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 6496071f14..9c720b381e 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 6b898d68a7..f7103cfd73 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index a47a537ac1..2f36218394 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index c624e92f07..89c65cb8da 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index 0a86abb476..015e3cc2ad 100644 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -453,4 +453,16 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End + diff --git a/application/language/serbian/translations_lang.php b/application/language/serbian/translations_lang.php index 0e44470faf..99a00e87f5 100644 --- a/application/language/serbian/translations_lang.php +++ b/application/language/serbian/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 3c155bf36e..396588bd04 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -453,4 +453,22 @@ $lang['webhook_deleted'] = 'Webhook bol úspešne odstránený.'; $lang['delete_webhook'] = 'Odstrániť webhook'; $lang['contact_info'] = 'Kontaktné informácie'; +$lang['to'] = 'to'; +$lang['click_to_toggle'] = 'Click To Toggle'; +$lang['week_short'] = 'Wk'; +$lang['scroll_to_increment'] = 'Scroll To Increment'; +$lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 33dcb0a043..c23137d369 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Enlace para el pago'; +$lang['service_payment_link_description'] = 'Puedes incluir las siguientes variables: {$appointment_hash}, {$customer_email}. Para procesar la confirmación del pago puedes usar la url https://YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} como pagina de confirmación en Stripe.'; +$lang['appointment_payment_title'] = 'Detalles del pago'; +$lang['appointment_payment_text'] = 'Pulse en el siguiente enlace para proceder con el pago'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'ID del pago de Stripe'; +$lang['service_paid_warning'] = 'No es posible cambiar un servicio ya pagado. Pongase en contacto en el correo {$mail_link} para más información.'; +$lang['is_paid'] = 'Pagado'; +$lang['open_payment_process'] = 'Continuar con el pago'; +$lang['go_to_payment_hint'] = 'Abre una nueva ventana con los datos del pago en Stripe'; +$lang['go_to_payment'] = 'Detalles del Pago'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index aade454561..dbc5d71d98 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index 940cce9f8c..d2e915243c 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -453,4 +453,15 @@ $lang['webhook_deleted'] = 'Webhook deleted successfully.'; $lang['delete_webhook'] = 'Delete Webhook'; $lang['contact_info'] = 'Contact Info'; +$lang['service_payment_link'] = 'Stripe Payment link'; +$lang['service_payment_link_description'] = 'By default, the generated payment link will send the appointment hash and customer email to Stripe. In order to confirm the payment use https://CHANGE_WITH_YOUR_SERVER/payment/confirm/{CHECKOUT_SESSION_ID} url as confirmation page in Stripe'; +$lang['appointment_payment_title'] = 'Payment details'; +$lang['appointment_payment_text'] = 'Click on the following link to proceed with payment'; +$lang['appointment_paymentPaid_text'] = 'Payment has been successfully completed'; +$lang['payment_intent'] = 'Stripe Payment Intent'; +$lang['service_paid_warning'] = 'It is not possible to change an already paid service. Please contact us at {$mail_link} for more information.'; +$lang['is_paid'] = 'Paid'; +$lang['open_payment_process'] = 'Proceed with payment'; +$lang['go_to_payment_hint'] = 'Open Payment details in Stripe Dashboard'; +$lang['go_to_payment'] = 'View Payment'; // End diff --git a/application/libraries/Email_messages.php b/application/libraries/Email_messages.php index 6a005ee156..6a2dec24eb 100644 --- a/application/libraries/Email_messages.php +++ b/application/libraries/Email_messages.php @@ -90,6 +90,20 @@ public function send_appointment_saved( $appointment['end_datetime'] = $appointment_end->format('Y-m-d H:i:s'); } + $payment_link = null; + if( isset($service['payment_link']) && !empty(trim($service['payment_link']))){ + $payment_link_vars = array( + '{$appointment_hash}' => $appointment['hash'], + '{$customer_email}' => $customer['email'], + ); + $payment_link_template = $service['payment_link'] + . (str_contains($service['payment_link'], '?') + ? '' : '?') + . 'client_reference_id={$appointment_hash}&prefilled_email={$customer_email}'; + + $payment_link = strtr($payment_link_template, $payment_link_vars); + } + $html = $this->CI->load->view( 'emails/appointment_saved_email', [ @@ -102,6 +116,7 @@ public function send_appointment_saved( 'settings' => $settings, 'timezone' => $timezone, 'appointment_link' => $appointment_link, + 'payment_link' => $payment_link, ], true, ); diff --git a/application/migrations/045_add_payment_intent_column_to_appointments_table.php b/application/migrations/045_add_payment_intent_column_to_appointments_table.php new file mode 100644 index 0000000000..1fc66a080c --- /dev/null +++ b/application/migrations/045_add_payment_intent_column_to_appointments_table.php @@ -0,0 +1,48 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.5.0 + * ---------------------------------------------------------------------------- */ + +/** + * @property CI_DB_query_builder $db + * @property CI_DB_forge $dbforge + */ +class Migration_Add_payment_intent_column_to_appointments_table extends CI_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->field_exists('payment_intent', 'appointments')) + { + $fields = [ + 'payment_intent' => [ + 'type' => 'TEXT', + 'null' => TRUE + ] + ]; + + $this->dbforge->add_column('appointments', $fields); + + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ($this->db->field_exists('payment_intent', 'appointments')) + { + $this->dbforge->drop_column('appointments', 'payment_intent'); + } + } +} diff --git a/application/migrations/046_add_is_paid_column_to_appointments_table.php b/application/migrations/046_add_is_paid_column_to_appointments_table.php new file mode 100644 index 0000000000..9a03a961cc --- /dev/null +++ b/application/migrations/046_add_is_paid_column_to_appointments_table.php @@ -0,0 +1,49 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.5.0 + * ---------------------------------------------------------------------------- */ + +/** + * @property CI_DB_query_builder $db + * @property CI_DB_forge $dbforge + */ +class Migration_Add_is_paid_column_to_appointments_table extends CI_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->field_exists('is_paid', 'appointments')) + { + $fields = [ + 'is_paid' => [ + 'type' => 'TINYINT', + 'constraint' => '4', + 'default' => '0' + ] + ]; + + $this->dbforge->add_column('appointments', $fields); + + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ($this->db->field_exists('is_paid', 'appointments')) + { + $this->dbforge->drop_column('appointments', 'is_paid'); + } + } +} diff --git a/application/migrations/047_add_payment_link_column_to_services_table.php b/application/migrations/047_add_payment_link_column_to_services_table.php new file mode 100644 index 0000000000..66ca6f14b5 --- /dev/null +++ b/application/migrations/047_add_payment_link_column_to_services_table.php @@ -0,0 +1,48 @@ + + * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.5.0 + * ---------------------------------------------------------------------------- */ + +/** + * @property CI_DB_query_builder $db + * @property CI_DB_forge $dbforge + */ +class Migration_Add_payment_link_column_to_services_table extends CI_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->field_exists('payment_link', 'services')) + { + $fields = [ + 'payment_link' => [ + 'type' => 'TEXT', + 'null' => TRUE, + ] + ]; + + $this->dbforge->add_column('services', $fields); + + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ($this->db->field_exists('payment_link', 'services')) + { + $this->dbforge->drop_column('services', 'payment_link'); + } + } +} diff --git a/application/models/Appointments_model.php b/application/models/Appointments_model.php index 314ea21921..bfd502d7e8 100644 --- a/application/models/Appointments_model.php +++ b/application/models/Appointments_model.php @@ -27,6 +27,7 @@ class Appointments_model extends EA_Model 'id_users_provider' => 'integer', 'id_users_customer' => 'integer', 'id_services' => 'integer', + 'is_paid' => 'boolean', ]; /** @@ -46,6 +47,8 @@ class Appointments_model extends EA_Model 'providerId' => 'id_users_provider', 'customerId' => 'id_users_customer', 'googleCalendarId' => 'id_google_calendar', + 'isPaid' => 'is_paid', + 'paymentIntent' => 'payment_intent', ]; /** @@ -544,6 +547,8 @@ public function api_encode(array &$appointment): void 'serviceId' => $appointment['id_services'] !== null ? (int) $appointment['id_services'] : null, 'googleCalendarId' => $appointment['id_google_calendar'] !== null ? $appointment['id_google_calendar'] : null, + 'isPaid' => $appointment['is_paid'], + 'paymentIntent' => $appointment['payment_intent'], ]; $appointment = $encoded_resource; @@ -607,6 +612,14 @@ public function api_decode(array &$appointment, array $base = null): void $decoded_request['id_google_calendar'] = $appointment['googleCalendarId']; } + if (array_key_exists('isPaid', $appointment)){ + $decoded_request['is_paid'] = $appointment['isPaid']; + } + + if (array_key_exists('paymentIntent', $appointment)){ + $decoded_request['payment_intent'] = $appointment['paymentIntent']; + } + $decoded_request['is_unavailability'] = false; $appointment = $decoded_request; diff --git a/application/models/Services_model.php b/application/models/Services_model.php index f117f83b0c..bddbce5d39 100644 --- a/application/models/Services_model.php +++ b/application/models/Services_model.php @@ -47,6 +47,7 @@ class Services_model extends EA_Model 'attendantsNumber' => 'attendants_number', 'isPrivate' => 'is_private', 'serviceCategoryId' => 'id_service_categories', + 'paymentLink' => 'payment_link', ]; /** @@ -419,6 +420,7 @@ public function api_encode(array &$service): void 'attendantsNumber' => (int) $service['attendants_number'], 'serviceCategoryId' => $service['id_service_categories'] !== null ? (int) $service['id_service_categories'] : null, + 'paymentLink' => $service['payment_link'], ]; $service = $encoded_resource; @@ -462,7 +464,13 @@ public function api_decode(array &$service, array $base = null): void $decoded_resource['location'] = $service['location']; } - if (array_key_exists('availabilitiesType', $service)) { + if (array_key_exists('paymentLink', $service)) + { + $decoded_resource['payment_link'] = $service['paymentLink']; + } + + if (array_key_exists('availabilitiesType', $service)) + { $decoded_resource['availabilities_type'] = $service['availabilitiesType']; } diff --git a/application/views/components/appointments_modal.php b/application/views/components/appointments_modal.php index 93e55282ab..edb5b9efc3 100644 --- a/application/views/components/appointments_modal.php +++ b/application/views/components/appointments_modal.php @@ -183,6 +183,22 @@ class="border rounded d-flex justify-content-between align-items-center bg-light + + +
+ + +
+
+ +
+ diff --git a/application/views/components/booking_type_step.php b/application/views/components/booking_type_step.php index e4d6a1d0fe..7d6dd5bc94 100644 --- a/application/views/components/booking_type_step.php +++ b/application/views/components/booking_type_step.php @@ -17,7 +17,11 @@ - + + + +

+ strtr('{$company_email}', [ + '{$company_email}' => $company_email + ]) + ]) + ?> + +

+
diff --git a/application/views/emails/appointment_deleted_email.php b/application/views/emails/appointment_deleted_email.php index 35d55a3d9e..6123659085 100644 --- a/application/views/emails/appointment_deleted_email.php +++ b/application/views/emails/appointment_deleted_email.php @@ -161,6 +161,16 @@ + + + + + + + + + +

diff --git a/application/views/emails/appointment_saved_email.php b/application/views/emails/appointment_saved_email.php index cbfb85be77..1eede08ecc 100644 --- a/application/views/emails/appointment_saved_email.php +++ b/application/views/emails/appointment_saved_email.php @@ -11,6 +11,7 @@ * @var array $settings * @var array $timezone * @var string $appointment_link + * @var string $payment_link */ ?> @@ -38,6 +39,18 @@

+ +

+ +

+ +

+ +

+ + + +

diff --git a/application/views/pages/booking.php b/application/views/pages/booking.php index 1ca82814a1..dc9842d7ad 100755 --- a/application/views/pages/booking.php +++ b/application/views/pages/booking.php @@ -12,8 +12,11 @@ - vars('available_services')]); ?> - + vars('available_services'), + 'is_paid' => vars('is_paid'), + 'company_email' => vars('company_email') +]); ?> vars('grouped_timezones')]); ?> diff --git a/application/views/pages/booking_confirmation.php b/application/views/pages/booking_confirmation.php index 107ed435ce..831bb0136d 100755 --- a/application/views/pages/booking_confirmation.php +++ b/application/views/pages/booking_confirmation.php @@ -28,6 +28,13 @@ + + + + + + +
diff --git a/application/views/pages/payment.php b/application/views/pages/payment.php new file mode 100755 index 0000000000..5b35665c1d --- /dev/null +++ b/application/views/pages/payment.php @@ -0,0 +1,40 @@ + + + + +
+ success +
+ +
+

+ +

+ +

+ +

+ + + +

+ + + + + + + + + + +
+ + + + + + vars('google_analytics_code')]) ?> + vars('matomo_analytics_url')]) ?> + + diff --git a/application/views/pages/services.php b/application/views/pages/services.php index b5f12e4825..162b784c43 100755 --- a/application/views/pages/services.php +++ b/application/views/pages/services.php @@ -156,6 +156,16 @@ + +
+ + + +
+ +