Skip to content

Commit

Permalink
Merge pull request #115 from AshleyRedman/dev
Browse files Browse the repository at this point in the history
1.0.8 - Updated API request hook
  • Loading branch information
AshleyRedman authored Jan 20, 2023
2 parents 14fd8f9 + 05a8db4 commit 40e04b2
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
attributes:
label: Plugin version
description: |
e.g `1.0.8`
e.g `1.0.9`
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: Help & support - FAQ
url: https://github.com/AshleyRedman/WPClothes2Order/discussions/new?category=q-a&body=%23%23%23%20Your%20question%20here%0A%0A-%20What%20version%20of%20the%20plugin%20are%20you%20using%3F%20e.g%20%601.0.8%60%0A-%20What%20PHP%20version%20are%20you%20using%3F%20e.g%20%607.4%60%0A-%20Where%20did%20you%20install%20the%20plugin%20from%3F%20e.g%20%60WordPress%20org%60%0A%0A---
url: https://github.com/AshleyRedman/WPClothes2Order/discussions/new?category=q-a&body=%23%23%23%20Your%20question%20here%0A%0A-%20What%20version%20of%20the%20plugin%20are%20you%20using%3F%20e.g%20%601.0.9%60%0A-%20What%20PHP%20version%20are%20you%20using%3F%20e.g%20%607.4%60%0A-%20Where%20did%20you%20install%20the%20plugin%20from%3F%20e.g%20%60WordPress%20org%60%0A%0A---
about: "If you can't get something to work the way you expect, check out our FAQ's."
- name: Feature Request
url: https://github.com/AshleyRedman/WPClothes2Order/discussions/new?category=ideas
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Requires at least: 5.8
- Tested up to: 6.1
- Requires PHP: 7.4
- Stable tag: 1.0.8
- Stable tag: 1.0.9
- License: GPLv3
- License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
2 changes: 1 addition & 1 deletion includes/wpc2o-constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/** Our plugin version, used to asset cache busting & more. */
define('WP_C2O_VERSION', '1.0.8');
define('WP_C2O_VERSION', '1.0.9');

/** API option values. */
define('WPC2O_API_KEY', '_wpc2o_api_key');
Expand Down
17 changes: 10 additions & 7 deletions includes/wpc2o-options-orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,26 @@ function wpc2o_view_order_payload($order)
$record = get_post_meta($order->ID, '_wpc2o_order_api_payload', true);
$response = get_post_meta($order->ID, '_wpc2o_order_api_response', true);

$endpoint = is_array($record) ? $record['endpoint'] : '';
$headers = is_array($record) ? $record['headers'] : '';
$code = is_array($response) ? $response['code'] : '';
$message = is_array($response) ? $response['message'] : '';
$body = is_array($response) ? htmlspecialchars($response['body']) : '';
$endpoint = is_array($record) ? $record['endpoint'] : '';
$headers = is_array($record) ? $record['headers'] : '';
$formated_headers = is_array($headers) ? implode($headers) : $headers;
$record_body = is_array($record) ? $record['body'] : '';

$code = is_array($response) ? $response['code'] : '';
$message = is_array($response) ? $response['message'] : '';
$body = is_array($response) ? htmlspecialchars($response['body']) : '';

$content = '<div class="wpc2o-view-payload-modal-inner">';
$content .= '<button class="wpc2o-view-payload-modal-copy button">Copy to clipboard</button>';
$content .= '<button class="wpc2o-view-payload-modal-close button button-primary">Close</button>';
$content .= '<div>Endpoint: ' . $endpoint . '</div>';
$content .= '<div>Headers: ' . $headers . '<div>';
$content .= '<div>Headers: ' . $formated_headers . '<div>';
$content .= '<div>Response code: ' . $code . '<div>';
$content .= '<div>Response message: ' . $message . '<div>';
$content .= '<div>Response body: ' . $body . '<div>';
$content .= '<div>Payload sent:<div>';
$content .= '<pre class="wpc2o-view-payload-modal-content"><code>';
$content .= $record['body'];
$content .= $record_body;
$content .= '</code></pre>';
$content .= '</div>';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wpclothes2order",
"version": "1.0.8",
"version": "1.0.9",
"description": "",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: woocommerce, clothes2order
Requires at least: 5.8
Tested up to: 6.1
Requires PHP: 7.4
Stable tag: 1.0.8
Stable tag: 1.0.9
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
4 changes: 2 additions & 2 deletions wpclothes2order.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: WPClothes2Order
* Plugin URI: https://wpclothes2order.com/download
* Description: Unofficial WooCommerce Plugin for <a href="https://www.clothes2order.com/">Clothes2Order</a>
* Version: 1.0.8
* Version: 1.0.9
* Plugin URI: https://www.wpclothes2order.com
* Author: Ashley Redman
* Author URI: https://github.com/AshleyRedman
Expand Down Expand Up @@ -80,7 +80,7 @@ function wpc2o_start()
add_action('carbon_fields_register_fields', 'wpc2o_wc_theme_options');

// register on place order
add_action('woocommerce_thankyou', 'wpc2o_process_completed_order', 10, 1);
add_action('woocommerce_checkout_order_processed', 'wpc2o_process_completed_order', 10, 1);

// register rest fields
add_action('rest_api_init', 'wpc2o_register_rest_fields');
Expand Down

0 comments on commit 40e04b2

Please sign in to comment.