Changeset 2351951
- Timestamp:
- 08/03/2020 07:50:06 PM (6 years ago)
- Location:
- beyondconnect/trunk
- Files:
-
- 8 added
- 15 edited
-
beyondConnect.php (modified) (1 diff)
-
inc/Api/Callbacks/SettingsCallbacks.php (modified) (1 diff)
-
inc/Base/AuthenticationController.php (modified) (2 diffs)
-
inc/Base/BaseController.php (modified) (1 diff)
-
inc/Base/NinjaFormsController.php (modified) (3 diffs)
-
inc/Base/NinjaFormsFields_List.php (modified) (1 diff)
-
inc/Base/PaymentController.php (added)
-
inc/Base/SaferpayAssertRequest.php (added)
-
inc/Base/SaferpayCaptureRequest.php (added)
-
inc/Base/SaferpayInitRequest.php (added)
-
inc/Base/SaferpayRequestHeader.php (added)
-
inc/Base/ShortcodesBaseController.php (modified) (13 diffs)
-
inc/Base/ShortcodesCoursesController.php (modified) (4 diffs)
-
inc/Base/ShortcodesHelpersController.php (modified) (4 diffs)
-
inc/Base/ShortcodesOpenItemsController.php (added)
-
inc/Base/ShortcodesPaymentsController.php (added)
-
inc/Base/ShortcodesRegistrationsController.php (modified) (2 diffs)
-
inc/Base/ShortcodesSubscriptionsController.php (modified) (6 diffs)
-
inc/Beyond.php (modified) (7 diffs)
-
inc/Init.php (modified) (1 diff)
-
inc/Pages/Settings.php (modified) (1 diff)
-
inc/bc_functions.php (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
beyondconnect/trunk/beyondConnect.php
r2339795 r2351951 7 7 Plugin URI: https://support.beyond-sw.com/hc/de/categories/360002442180 8 8 Description: beyondConnect connects WordPress with the beyond software services. 9 Version: 2. 1.249 Version: 2.2.0 10 10 Author: Felix Stadelmann, beyond software 11 11 Author URI: https://beyond-sw.com -
beyondconnect/trunk/inc/Api/Callbacks/SettingsCallbacks.php
r2339795 r2351951 64 64 $output['PG_Username'] = isset($input['PG_Username']) ? $input['PG_Username'] : ''; 65 65 $output['PG_Password'] = isset($input['PG_Password']) ? $input['PG_Password'] : ''; 66 $output['PG_CustomerId'] = isset($input['PG_CustomerId']) ? $input['PG_CustomerId'] : ''; 67 $output['PG_TerminalId'] = isset($input['PG_TerminalId']) ? $input['PG_TerminalId'] : ''; 68 $output['PG_InitSuccess'] = isset($input['PG_InitSuccess']) ? $input['PG_InitSuccess'] : ''; 69 $output['PG_InitFail'] = isset($input['PG_InitFail']) ? $input['PG_InitFail'] : ''; 70 $output['PG_PaymentSuccess'] = isset($input['PG_PaymentSuccess']) ? $input['PG_PaymentSuccess'] : ''; 71 $output['PG_PaymentFail'] = isset($input['PG_PaymentFail']) ? $input['PG_PaymentFail'] : ''; 72 $output['PG_PaymentAbort'] = isset($input['PG_PaymentAbort']) ? $input['PG_PaymentAbort'] : ''; 73 $output['PG_PaymentNotify'] = isset($input['PG_PaymentNotify']) ? $input['PG_PaymentNotify'] : ''; 66 74 67 75 // Options Setting Fields -
beyondconnect/trunk/inc/Base/AuthenticationController.php
r2339795 r2351951 10 10 use Inc\Base\BaseController; 11 11 12 //use Inc\Api\Widgets\TeachersWidget;13 12 14 13 /** … … 43 42 public function addActions() 44 43 { 44 //Actions for admin-post.php 45 //Actions for logged users 46 add_action('admin_post_bc_logout', array($this, 'logout')); 47 48 //Actions for not logged users 49 add_action('admin_post_nopriv_bc_logout', array($this, 'logout')); 50 51 //other Actions 45 52 add_action('admin_init', array($this, 'checkRoles'), 10, 0); 46 53 add_action('bc_assignRoles', array($this, 'assignRoles'), 10, 1); 54 } 55 56 public function logout() 57 { 58 if (is_user_logged_in()) { 59 wp_logout(); 60 wp_redirect('/'); 61 } 47 62 } 48 63 -
beyondconnect/trunk/inc/Base/BaseController.php
r2339795 r2351951 31 31 'shortcodes_addresses' => __('Activate Shortcodes Addresses', 'beyondconnect'), 32 32 'shortcodes_courses' => __('Activate Shortcodes Courses', 'beyondconnect'), 33 'shortcodes_openitems' => __('Activate Shortcodes Open Items', 'beyondconnect'), 34 'shortcodes_payments' => __('Activate Shortcodes Payments', 'beyondconnect'), 33 35 'shortcodes_registrations' => __('Activate Shortcodes Registrations', 'beyondconnect'), 34 36 'shortcodes_subscriptions' => __('Activate Shortcodes Subscriptions', 'beyondconnect'), -
beyondconnect/trunk/inc/Base/NinjaFormsController.php
r2339795 r2351951 52 52 { 53 53 //Assign global variables to form fields 54 global $ wp_session;54 global $bc_global; 55 55 56 56 $default_value = $this->render_shortcodes_default_values($default_value, $field_type, $field_settings); … … 62 62 protected function render_shortcodes_default_values($default_value, $field_type, $field_settings) 63 63 { 64 global $ wp_session;64 global $bc_global; 65 65 66 66 $field_key = $field_settings['key']; … … 70 70 return $default_value; 71 71 72 if (empty($ wp_session['bc_shortcode']))72 if (empty($bc_global['bc_shortcode'])) 73 73 return $default_value; 74 74 75 foreach ($ wp_session['bc_shortcode'] as $key => $value) {75 foreach ($bc_global['bc_shortcode'] as $key => $value) { 76 76 if ($key === $field_strip && $count === 1) 77 77 $default_value = $value; 78 78 } 79 79 80 if (!empty($ wp_session['bc_shortcode'][$field_strip]) && $count === 1)81 $default_value = $ wp_session['bc_shortcode'][$field_strip];80 if (!empty($bc_global['bc_shortcode'][$field_strip]) && $count === 1) 81 $default_value = $bc_global['bc_shortcode'][$field_strip]; 82 82 83 83 return $default_value; -
beyondconnect/trunk/inc/Base/NinjaFormsFields_List.php
r2339795 r2351951 104 104 switch ($fieldset) { 105 105 case 'CoursesIDTitleDate': 106 $querystring = Beyond::getODataQueryString('Kurse', ('kursId,kursIdTitelDatumVonDatumBis'), '', 'istAnmeldungMoeglich eq true', '', '', 'kursIdTitelDatumVonDatumBis');106 $querystring = Beyond::getODataQueryString('Kurse', '', ('kursId,kursIdTitelDatumVonDatumBis'), '', 'istAnmeldungMoeglich eq true', '', '', 'kursIdTitelDatumVonDatumBis'); 107 107 $labelfields = array('kursIdTitelDatumVonDatumBis'); 108 108 $valuefield = 'kursId'; 109 109 break; 110 110 case 'TeacherFirstname': 111 $querystring = Beyond::getODataQueryString('Lehrer', ('lehrerId,vorname'), '', '', '', '', 'vorname');111 $querystring = Beyond::getODataQueryString('Lehrer', '', ('lehrerId,vorname'), '', '', '', '', 'vorname'); 112 112 $labelfields = array('vorname'); 113 113 $valuefield = 'lehrerId'; 114 114 break; 115 115 case 'TeacherFirstnameLastname': 116 $querystring = Beyond::getODataQueryString('Lehrer', ('lehrerId,vorname,nachname'), '', '', '', '', 'vorname, nachname');116 $querystring = Beyond::getODataQueryString('Lehrer', '', ('lehrerId,vorname,nachname'), '', '', '', '', 'vorname, nachname'); 117 117 $labelfields = array('vorname', 'nachname'); 118 118 $valuefield = 'lehrerId'; 119 119 break; 120 120 case 'TeacherLastnameFirstname': 121 $querystring = Beyond::getODataQueryString('Lehrer', ('lehrerId,nachname,vorname'), '', '', '', '', 'nachname, vorname');121 $querystring = Beyond::getODataQueryString('Lehrer', '', ('lehrerId,nachname,vorname'), '', '', '', '', 'nachname, vorname'); 122 122 $labelfields = array('nachname', 'vorname'); 123 123 $valuefield = 'lehrerId'; -
beyondconnect/trunk/inc/Base/ShortcodesBaseController.php
r2339795 r2351951 101 101 protected function replaceGlobalVariableValues($source) 102 102 { 103 global $ wp_session;104 105 if (empty($ wp_session['bc_shortcode']))103 global $bc_global; 104 105 if (empty($bc_global['bc_shortcode'])) 106 106 return $source; 107 107 108 foreach ($ wp_session['bc_shortcode'] as $key => $value) {108 foreach ($bc_global['bc_shortcode'] as $key => $value) { 109 109 $source = str_ireplace('{' . $key . '}', urldecode($value), $source); 110 110 $source = str_ireplace('{global_' . $key . '}', urldecode($value), $source); … … 209 209 210 210 211 global $ wp_session;211 global $bc_global; 212 212 213 213 if (!empty($wporg_atts['expandedfrom'])) { 214 foreach ($ wp_session['bc_tbl' . $wporg_atts['expandedfrom']] as $from) {214 foreach ($bc_global['bc_tbl' . $wporg_atts['expandedfrom']] as $from) { 215 215 $from = array_change_key_case((array)$from, CASE_LOWER); 216 216 … … 219 219 220 220 if (strcasecmp($from[$expandedLinkFieldName], $wporg_atts['expandedlinkfieldvalue']) === 0) { 221 $ wp_session['bc_tbl' . $tablename] = $from[$entityname];221 $bc_global['bc_tbl' . $tablename] = $from[$entityname]; 222 222 } 223 223 } … … 226 226 if (!empty($values)) { 227 227 $values = array_change_key_case((array)$values, CASE_LOWER); 228 $ wp_session['bc_tbl' . $tablename] = $values;229 } 230 } 231 232 if (empty($ wp_session['bc_tbl' . $tablename]))228 $bc_global['bc_tbl' . $tablename] = $values; 229 } 230 } 231 232 if (empty($bc_global['bc_tbl' . $tablename])) 233 233 return ''; 234 234 235 235 $o = ''; 236 236 237 foreach ($ wp_session['bc_tbl' . $tablename] as $record) {237 foreach ($bc_global['bc_tbl' . $tablename] as $record) { 238 238 $record = array_change_key_case((array)$record); 239 239 … … 254 254 $content = $this->replaceQueryStringValues($content); 255 255 $content = $this->replaceGlobalVariableValues($content); 256 256 257 $content = trim(do_shortcode($content)); 257 258 … … 300 301 $content = $this->replaceGlobalVariableValues($content); 301 302 302 global $ wp_session;303 $ wp_session['bc_' . $elementname . '_list_element_array'] = array(); // clear the element array303 global $bc_global; 304 $bc_global['bc_' . $elementname . '_list_element_array'] = array(); // clear the element array 304 305 305 306 // execute beyondconnect_courses_list_element shortcode first to get the title and content - acts on global $single_tab_array … … 307 308 $repl_content = preg_replace('/\[beyondconnect_' . $elementname . '_list_popupable(.*?)\[\/beyondconnect_' . $elementname . '_list_popupable\]/s', '', $repl_content); 308 309 309 if (!empty($wporg_atts['expandedfrom'])) { 310 foreach ($wp_session['bc_tbl' . $wporg_atts['expandedfrom']] as $from) { 310 if ($tablename === 'warenkorb' && get_transient('bc_cart' . Beyond::getVisitorID()) !== false) { 311 $values = get_transient('bc_cart' . Beyond::getVisitorID()); 312 $values = array_change_key_case($values, CASE_LOWER); 313 $bc_global['bc_tbl' . $tablename] = $values; 314 } else if (!empty($wporg_atts['expandedfrom'])) { 315 foreach ($bc_global['bc_tbl' . $wporg_atts['expandedfrom']] as $from) { 311 316 $from = array_change_key_case((array)$from, CASE_LOWER); 312 317 … … 315 320 316 321 if (strcasecmp($from[$expandedLinkFieldName], $wporg_atts['expandedlinkfieldvalue']) === 0) { 317 $ wp_session['bc_tbl' . $tablename] = $from[$tablename];322 $bc_global['bc_tbl' . $tablename] = $from[$tablename]; 318 323 } 319 324 } 320 325 } else { 321 326 $values = Beyond::getValues(Beyond::getODataString($tablename, $wporg_atts), 'value'); 322 if (!empty($values)) { 327 if (empty($values)) { 328 $bc_global['bc_tbl' . $tablename] = array(); 329 } else { 323 330 $values = array_change_key_case((array)$values, CASE_LOWER); 324 $ wp_session['bc_tbl' . $tablename] = $values;325 } 326 } 327 328 if (empty($ wp_session['bc_tbl' . $tablename])) {331 $bc_global['bc_tbl' . $tablename] = $values; 332 } 333 } 334 335 if (empty($bc_global['bc_tbl' . $tablename])) { 329 336 if (empty($wporg_atts['emptytext'])) 330 337 return ''; … … 332 339 return '<div class="bc_list_empty ' . $elementname . '">' . $wporg_atts['emptytext'] . '</div>'; 333 340 } 341 else { 342 if (empty($wporg_atts['filledtext'])) 343 $o = ''; 344 else 345 $o = '<div class="bc_list_filled ' . $elementname . '">' . $wporg_atts['filledtext'] . '</div>'; 346 } 334 347 335 348 do_shortcode($repl_content); 336 349 337 $o = '';338 350 $o .= '<' . ($rendermode === 'div' ? 'div' : "table") . ' class="bc_list_table ' . $elementname . '">'; 339 351 $o .= '<' . ($rendermode === 'div' ? 'div' : "thead") . ' class="bc_list_head ' . $elementname . '">'; 340 352 $o .= '<' . ($rendermode === 'div' ? 'div' : 'tr') . ' class="bc_list_head_row ' . $elementname . '">'; 341 353 342 foreach ($ wp_session['bc_' . $elementname . '_list_element_array'] as $element_attr_array) {354 foreach ($bc_global['bc_' . $elementname . '_list_element_array'] as $element_attr_array) { 343 355 $headtitle = $element_attr_array['title']; 344 356 $headcustomclass = empty($element_attr_array['customclass']) ? '' : $element_attr_array['customclass']; … … 354 366 $hasPopupable = false; 355 367 356 foreach ($ wp_session['bc_tbl' . $tablename] as $record) {368 foreach ($bc_global['bc_tbl' . $tablename] as $record) { 357 369 $record = array_change_key_case((array)$record, CASE_LOWER); 358 370 … … 364 376 $o .= '<' . ($rendermode === 'div' ? 'div' : 'tr') . ' class="bc_list_body_row ' . $elementname . '">'; 365 377 366 foreach ($ wp_session['bc_' . $elementname . '_list_element_array'] as $element_attr_array) {378 foreach ($bc_global['bc_' . $elementname . '_list_element_array'] as $element_attr_array) { 367 379 $fieldcontent = !empty($element_attr_array['content']) ? $element_attr_array['content'] : ''; 368 380 $fieldlink = !empty($element_attr_array['link']) ? $element_attr_array['link'] : ''; … … 433 445 //Collapsible 434 446 if ($hasCollapsible) { 435 $cols = sizeof($ wp_session['bc_' . $elementname . '_list_element_array']);447 $cols = sizeof($bc_global['bc_' . $elementname . '_list_element_array']); 436 448 437 449 $o .= '<' . ($rendermode === 'div' ? "div id=\"bc_list_collapsible_row_" . $rowprimary . "\" style=\"display:none;\"" : "tr id=\"bc_list_collapsible_row_" . $rowprimary . "\" style=\"display:none;\"") . ' class="bc_list_collapsible_row ' . $elementname . '">'; … … 455 467 //Popupable 456 468 if ($hasPopupable) { 457 foreach ($ wp_session['bc_tbl' . $tablename] as $record) {469 foreach ($bc_global['bc_tbl' . $tablename] as $record) { 458 470 $record = array_change_key_case($record); 459 471 -
beyondconnect/trunk/inc/Base/ShortcodesCoursesController.php
r2339795 r2351951 128 128 $o = $this->execListShortcode($atts, $content, $tag, 'courses', 'kurse', 'kursid'); 129 129 $o = $this->replaceFormula($o); 130 $o = do_shortcode($o); 130 131 return $o; 131 132 } … … 135 136 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 136 137 137 global $wp_session; 138 139 $wp_session['bc_courses_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content)))); 138 global $bc_global; 139 140 //$bc_global['bc_courses_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content)))); 141 $bc_global['bc_courses_list_element_array'][] = array_merge($wporg_atts, array('content' => trim($content))); 140 142 141 143 return ''; … … 174 176 $o = $this->execListShortcode($atts, $content, $tag, 'coursdates', 'kursDaten', 'kursdatenrowguid'); 175 177 $o = $this->replaceFormula($o); 178 $o = do_shortcode($o); 176 179 return $o; 177 180 } … … 181 184 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 182 185 183 global $ wp_session;184 $ wp_session['bc_coursdates_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content))));186 global $bc_global; 187 $bc_global['bc_coursdates_list_element_array'][] = array_merge($wporg_atts, array('content' => trim($content))); 185 188 return ''; 186 189 } -
beyondconnect/trunk/inc/Base/ShortcodesHelpersController.php
r2339795 r2351951 28 28 public function beyondconnect_setglobals($atts = [], $content = null, $tag = '') 29 29 { 30 global $ wp_session;30 global $bc_global; 31 31 32 32 $atts = array_change_key_case((array)$atts, CASE_LOWER); … … 36 36 } 37 37 38 if (empty($ wp_session['bc_shortcode']))39 $ wp_session['bc_shortcode'] = $atts;38 if (empty($bc_global['bc_shortcode'])) 39 $bc_global['bc_shortcode'] = $atts; 40 40 else 41 $ wp_session['bc_shortcode'] = array_replace($wp_session['bc_shortcode'], $atts);41 $bc_global['bc_shortcode'] = array_replace($bc_global['bc_shortcode'], $atts); 42 42 43 43 $content = do_shortcode($content, false); … … 48 48 public function beyondconnect_getglobals($atts = [], $content = null, $tag = '') 49 49 { 50 global $ wp_session;50 global $bc_global; 51 51 52 52 $p = $atts[0]; … … 55 55 return "please define param"; 56 56 57 if (empty($ wp_session['bc_shortcode']))57 if (empty($bc_global['bc_shortcode'])) 58 58 return "param " . $p . " not found"; 59 59 60 foreach ($ wp_session['bc_shortcode'] as $key => $value) {60 foreach ($bc_global['bc_shortcode'] as $key => $value) { 61 61 if (strcasecmp($key, $p) === 0) 62 62 $c = $value; -
beyondconnect/trunk/inc/Base/ShortcodesRegistrationsController.php
r2339795 r2351951 31 31 $o = $this->execListShortcode($atts, $content, $tag, 'registrations', 'anmeldungen', 'person1Rowguid'); 32 32 $o = $this->replaceFormula($o); 33 $o = do_shortcode($o); 33 34 return $o; 34 35 } … … 38 39 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 39 40 40 global $ wp_session;41 global $bc_global; 41 42 42 $wp_session['bc_registrations_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content)))); 43 //$bc_global['bc_registrations_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content)))); 44 $bc_global['bc_registrations_list_element_array'][] = array_merge($wporg_atts, array('content' => trim($content))); 43 45 44 46 return ''; -
beyondconnect/trunk/inc/Base/ShortcodesSubscriptionsController.php
r2339795 r2351951 31 31 'beyondconnect_subscriptions_list_collapsible', 32 32 'beyondconnect_subscriptions_list_popupable', 33 'beyondconnect_subscriptiontypes_list', 34 'beyondconnect_subscriptiontypes_list_element', 35 'beyondconnect_subscriptiontypes_list_button_addtocart', 33 36 ); 34 37 } … … 74 77 $o = $this->execListShortcode($atts, $content, $tag, 'subscriptions', 'abonnemente', 'abonnementeRowguid'); 75 78 $o = $this->replaceFormula($o); 79 $o = do_shortcode($o); 76 80 return $o; 77 81 } … … 81 85 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 82 86 83 global $ wp_session;87 global $bc_global; 84 88 85 $ wp_session['bc_subscriptions_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content))));89 $bc_global['bc_subscriptions_list_element_array'][] = array_merge($wporg_atts, array('content' => trim($content))); 86 90 87 91 return ''; 88 92 } 93 public function beyondconnect_subscriptiontypes_list($atts = [], $content = null, $tag = '') 94 { 95 $o = $this->execListShortcode($atts, $content, $tag, 'subscriptiontypes', 'abonnementetypen', 'abonnementeTypenId'); 96 $o = $this->replaceFormula($o); 97 $o = do_shortcode($o); 98 return $o; 99 } 89 100 101 public function beyondconnect_subscriptiontypes_list_element($atts = [], $content = null, $tag = '') 102 { 103 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 104 105 global $bc_global; 106 107 $bc_global['bc_subscriptiontypes_list_element_array'][] = array_merge($wporg_atts, array('content' => trim($content))); 108 109 return ''; 110 } 90 111 public function beyondconnect_subscriptions_list_collapsible($atts = [], $content = null, $tag = '') 91 112 { … … 101 122 return $o; 102 123 } 124 public function beyondconnect_subscriptiontypes_list_button_addtocart($atts = [], $content = null, $tag = '') 125 { 126 // normalize attribute keys, lowercase 127 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 103 128 129 $o = ''; 130 131 $o .= '<form action="/wp-admin/admin-post.php/" method="post">'; 132 $o .= '<input type="hidden" name="action" value="bc_buyaddSubscriptionToCart">'; 133 $o .= '<input type="hidden" name="abonnementeTypenId" value="' . $wporg_atts['abonnementetypenid'] . '">'; 134 $o .= '<input type="hidden" name="redirect" value="' . $wporg_atts['redirect'] . '">'; 135 $o .= '<button type="submit" id="submit" class="bc_button buyaddtocart" >' . (empty($wporg_atts['text']) ? 'kaufen' : $wporg_atts['text']) . '</button>'; 136 $o .= '</form>'; 137 138 return $o; 139 } 104 140 public function beyondconnect_subscriptions_list_popupable($atts = [], $content = null, $tag = '') 105 141 { … … 120 156 $o = $this->execListShortcode($atts, $content, $tag, 'subscriptionsattendances', 'abonnementeanwesenheiten', 'abonnementeAnwesenheitenRowguid'); 121 157 $o = $this->replaceFormula($o); 158 $o = do_shortcode($o); 122 159 return $o; 123 160 } … … 127 164 $wporg_atts = $this->getShortcodeAtts($atts, $tag); 128 165 129 global $ wp_session;166 global $bc_global; 130 167 131 $ wp_session['bc_subscriptionsattendances_list_element_array'][] = array_merge($wporg_atts, array('content' => trim(do_shortcode($content))));168 $bc_global['bc_subscriptionsattendances_list_element_array'][] = array_merge($wporg_atts, array('content' => trim($content))); 132 169 133 170 return ''; -
beyondconnect/trunk/inc/Beyond.php
r2339795 r2351951 15 15 } 16 16 17 public static function getODataQueryString(string $entity, string $select, string $expand, string $filter, string $top, string $skip, string $orderby): string 17 public static function createGUID(): string 18 { 19 20 // Create a token 21 $token = $_SERVER['HTTP_HOST']; 22 $token .= $_SERVER['REQUEST_URI']; 23 $token .= uniqid(rand(), true); 24 25 // GUID is 128-bit hex 26 $hash = strtoupper(md5($token)); 27 28 // Create formatted GUID 29 $guid = ''; 30 31 // GUID format is XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX for readability 32 $guid .= substr($hash, 0, 8) . 33 '-' . 34 substr($hash, 8, 4) . 35 '-' . 36 substr($hash, 12, 4) . 37 '-' . 38 substr($hash, 16, 4) . 39 '-' . 40 substr($hash, 20, 12); 41 42 return $guid; 43 } 44 45 public static function getODataQueryString(string $entity, string $function, string $select, string $expand, string $filter, string $top, string $skip, string $orderby): string 18 46 { 19 47 $querystring = ''; … … 37 65 $querystring .= (empty($querystring) ? '' : '&') . '$orderby=' . $orderby; 38 66 39 return $entity . (empty($ querystring) ? '' : '?' . $querystring);67 return $entity . (empty($function) ? '' : '/' . $function) . (empty($querystring) ? '' : '?' . $querystring); 40 68 } 41 69 … … 65 93 } 66 94 95 public static function getVisitorID(): string 96 { 97 if (!empty($_COOKIE['bc_session'])) { 98 return $_COOKIE['bc_session']; 99 } 100 101 $visitorID = Beyond::createGUID(); 102 $hashed = hash('sha1', $visitorID); 103 104 setcookie('bc_session', $hashed, 0, '/'); 105 return $hashed; 106 } 107 67 108 public static function getODataString($entity, $wporg_atts): string 68 109 { 69 $expandstring = '';70 110 $expandstring = self::getODataSubString($entity, $wporg_atts, 1, 9); 71 111 72 112 $querystring = self::getODataQueryString($entity, 113 empty($wporg_atts['function']) ? '' : $wporg_atts['function'], 73 114 empty($wporg_atts['select']) ? '' : $wporg_atts['select'], 74 115 $expandstring, … … 123 164 public static function getToken(): string 124 165 { 125 if (get_transient(' token') === false) {166 if (get_transient('bc_token') === false) { 126 167 if (!self::refreshToken()) 127 168 echo "Error receiving token<br />"; 128 169 } 129 170 130 return get_transient(' token');171 return get_transient('bc_token'); 131 172 } 132 173 … … 138 179 return false; 139 180 140 set_transient(' token', $value, HOUR_IN_SECONDS);181 set_transient('bc_token', $value, HOUR_IN_SECONDS); 141 182 return true; 142 183 } 143 184 144 public static function requestToken(): string185 public static function requestToken(): ?string 145 186 { 146 187 $option = get_option('beyondconnect_option'); … … 173 214 public static function getValues(string $path, string $returnField, bool $onlyStatus = false) 174 215 { 175 error_log('BC OData Abfrage: ' . $path);216 //error_log('BC OData Abfrage: ' . $path); 176 217 $values = self::requestValues($path, $returnField, $onlyStatus); 177 218 … … 223 264 public static function setValues(string $path, string $method, array $body, string $returnField, bool $onlyStatus) 224 265 { 225 error_log('BC OData Abfrage: ' . $path);266 //error_log('BC OData Abfrage: ' . $path); 226 267 227 268 $option = get_option('beyondconnect_option'); -
beyondconnect/trunk/inc/Init.php
r2339795 r2351951 22 22 Base\AuthenticationController::class, 23 23 Base\NinjaFormsController::class, 24 Base\PaymentController::class, 24 25 Base\TeachersWidgetController::class, 25 26 Base\ShortcodesHelpersController::class, 26 27 Base\ShortcodesAddressesController::class, 27 28 Base\ShortcodesCoursesController::class, 29 Base\ShortcodesOpenItemsController::class, 30 Base\ShortcodesPaymentsController::class, 28 31 Base\ShortcodesRegistrationsController::class, 29 32 Base\ShortcodesSubscriptionsController::class, -
beyondconnect/trunk/inc/Pages/Settings.php
r2339795 r2351951 211 211 ) 212 212 ); 213 $args[] = array( 214 'id' => 'PG_CustomerId', 215 'title' => __('Customer ID', 'beyondconnect'), 216 'callback' => array($this->callbacks, 'textField'), 217 'page' => 'beyondconnect_paymentgateways_page', 218 'section' => 'beyondconnect_paymentgateways_section', 219 'args' => array( 220 'option_name' => 'beyondconnect_option', 221 'label_for' => 'PG_CustomerId', 222 'required' => false 223 ) 224 ); 225 $args[] = array( 226 'id' => 'PG_TerminalId', 227 'title' => __('Terminal ID', 'beyondconnect'), 228 'callback' => array($this->callbacks, 'textField'), 229 'page' => 'beyondconnect_paymentgateways_page', 230 'section' => 'beyondconnect_paymentgateways_section', 231 'args' => array( 232 'option_name' => 'beyondconnect_option', 233 'label_for' => 'PG_TerminalId', 234 'required' => false 235 ) 236 ); 237 $args[] = array( 238 'id' => 'PG_InitSuccess', 239 'title' => __('Url Init Success', 'beyondconnect'), 240 'callback' => array($this->callbacks, 'textField'), 241 'page' => 'beyondconnect_paymentgateways_page', 242 'section' => 'beyondconnect_paymentgateways_section', 243 'args' => array( 244 'option_name' => 'beyondconnect_option', 245 'label_for' => 'PG_InitSuccess', 246 'required' => false 247 ) 248 ); 249 $args[] = array( 250 'id' => 'PG_InitFail', 251 'title' => __('Url Init Fail', 'beyondconnect'), 252 'callback' => array($this->callbacks, 'textField'), 253 'page' => 'beyondconnect_paymentgateways_page', 254 'section' => 'beyondconnect_paymentgateways_section', 255 'args' => array( 256 'option_name' => 'beyondconnect_option', 257 'label_for' => 'PG_InitFail', 258 'required' => false 259 ) 260 ); 261 $args[] = array( 262 'id' => 'PG_PaymentSuccess', 263 'title' => __('Url Payment Success', 'beyondconnect'), 264 'callback' => array($this->callbacks, 'textField'), 265 'page' => 'beyondconnect_paymentgateways_page', 266 'section' => 'beyondconnect_paymentgateways_section', 267 'args' => array( 268 'option_name' => 'beyondconnect_option', 269 'label_for' => 'PG_PaymentSuccess', 270 'required' => false 271 ) 272 ); 273 $args[] = array( 274 'id' => 'PG_PaymentFail', 275 'title' => __('Url Payment Fail', 'beyondconnect'), 276 'callback' => array($this->callbacks, 'textField'), 277 'page' => 'beyondconnect_paymentgateways_page', 278 'section' => 'beyondconnect_paymentgateways_section', 279 'args' => array( 280 'option_name' => 'beyondconnect_option', 281 'label_for' => 'PG_PaymentFail', 282 'required' => false 283 ) 284 ); 285 $args[] = array( 286 'id' => 'PG_PaymentAbort', 287 'title' => __('Url Payment Abort', 'beyondconnect'), 288 'callback' => array($this->callbacks, 'textField'), 289 'page' => 'beyondconnect_paymentgateways_page', 290 'section' => 'beyondconnect_paymentgateways_section', 291 'args' => array( 292 'option_name' => 'beyondconnect_option', 293 'label_for' => 'PG_PaymentAbort', 294 'required' => false 295 ) 296 ); 297 $args[] = array( 298 'id' => 'PG_PaymentNotify', 299 'title' => __('Url Payment Notify', 'beyondconnect'), 300 'callback' => array($this->callbacks, 'textField'), 301 'page' => 'beyondconnect_paymentgateways_page', 302 'section' => 'beyondconnect_paymentgateways_section', 303 'args' => array( 304 'option_name' => 'beyondconnect_option', 305 'label_for' => 'PG_PaymentNotify', 306 'required' => false 307 ) 308 ); 309 213 310 214 311 //Options Setting Fields -
beyondconnect/trunk/readme.txt
r2339795 r2351951 5 5 Requires at least: 5.0 6 6 Tested up to: 5.4.2 7 Requires PHP: 7. 08 Stable tag: 2. 1.247 Requires PHP: 7.1 8 Stable tag: 2.2.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 30 30 == Changelog == 31 = 2.2.0 = 32 * Support for SIX Saferpay payment added 33 * New shortcodes added: 34 * beyondconnect_openitems_list 35 * beyondconnect_openitems_list_element 36 * beyondconnect_openitems_list_button_addtocart 37 * beyondconnect_cart_button_emptycart 38 * beyondconnect_cart_button_paycart 39 * beyondconnect_cart_list 40 * beyondconnect_cart_element 41 * beyondconnect_cart_button_removefromcart 42 * beyondconnect_saferpay_iframe 43 * beyondconnect_subscriptiontypes_list 44 * beyondconnect_subscriptiontypes_list_element 45 * beyondconnect_subscriptiontypes_list_button_addtocart 46 * Function added: 47 * bc_getValue 48 * Actions added: 49 * admin_post_bc_logout 50 * admin_post_bc_addToCart 51 * admin_post_bc_buyaddSubscriptionToCart 52 * admin_post_bc_removeFromCart 53 * admin_post_bc_emptyCart 54 * admin_post_bc_saferpayInitialize 55 * admin_post_nopriv_bc_logout 56 * admin_post_nopriv_bc_addToCart 57 * admin_post_nopriv_bc_buyaddSubscriptionToCart 58 * admin_post_nopriv_bc_removeFromCart 59 * admin_post_nopriv_bc_emptyCart 60 * admin_post_nopriv_bc_saferpayInitialize 61 * bc_assignRoles 62 * bc_processPayment 63 * bc_saferpayAssert 64 * bc_saferpayCapture 65 * Bug fixes 31 66 = 2.1.24 = 32 67 * New shortcodes added:
Note: See TracChangeset
for help on using the changeset viewer.