Changeset 2019487
- Timestamp:
- 01/26/2019 09:25:52 AM (7 years ago)
- Location:
- smartaccounts/trunk
- Files:
-
- 4 edited
-
SmartAccountsClass.php (modified) (2 diffs)
-
SmartAccountsClient.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
smartaccounts.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smartaccounts/trunk/SmartAccountsClass.php
r2001667 r2019487 31 31 update_post_meta($order_id, 'smartaccounts_invoice_id', $invoice['invoice']['invoiceNumber']); 32 32 error_log("SmartAccounts sales invoice created for order $order_id - " . $invoice['invoice']['invoiceNumber']); 33 $invoiceIdsString = get_option('sa_failed_orders'); 34 $invoiceIds = json_decode($invoiceIdsString); 35 if (is_array($invoiceIds) && array_key_exists($order_id, $invoiceIds)) { 36 unset($invoiceIds[$order_id]); 37 update_option('sa_failed_orders', json_encode($invoiceIds)); 38 error_log("Removed $order_id from failed orders array"); 39 } 33 40 } catch (Exception $exception) { 34 41 error_log("SmartAccounts error: " . $exception->getMessage() . " " . $exception->getTraceAsString()); … … 38 45 if (is_array($invoiceIds)) { 39 46 error_log("Adding $order_id to failed orders array $invoiceIdsString to be retried later"); 40 $invoiceIds[ ] = $order_id;47 $invoiceIds[$order_id] = $order_id; 41 48 update_option('sa_failed_orders', json_encode($invoiceIds)); 42 49 } else { 43 50 error_log("Adding $order_id to new failed orders array. previously $invoiceIdsString"); 44 $invoiceIds = [$order_id ];51 $invoiceIds = [$order_id => $order_id]; 45 52 update_option('sa_failed_orders', json_encode($invoiceIds)); 46 53 } -
smartaccounts/trunk/SmartAccountsClient.php
r2001667 r2019487 116 116 $postalCode = $this->order->get_billing_postcode() ? $this->order->get_billing_postcode() : 117 117 ($this->order->get_shipping_postcode() ? $this->order->get_shipping_postcode() : ""); 118 $address1 = $this->order->get_billing_address_1() ? $this->order->get_billing_address_1() :119 ($this->order->get_shipping_address_1() ? $this->order->get_shipping_address_1() : "") ;120 $address2 = $this->order->get_billing_address_2() ? $this->order->get_billing_address_2() :121 ($this->order->get_shipping_address_2() ? $this->order->get_shipping_address_2() : "") ;118 $address1 = substr($this->order->get_billing_address_1() ? $this->order->get_billing_address_1() : 119 ($this->order->get_shipping_address_1() ? $this->order->get_shipping_address_1() : ""), 0, 64); 120 $address2 = substr($this->order->get_billing_address_2() ? $this->order->get_billing_address_2() : 121 ($this->order->get_shipping_address_2() ? $this->order->get_shipping_address_2() : ""), 0, 64); 122 122 123 123 $body = new stdClass(); -
smartaccounts/trunk/readme.txt
r2001667 r2019487 47 47 == Changelog == 48 48 49 = 2.2.1 = 50 If address is longer than 64 characters then it is truncated when sending to SmartAccounts as longer addresses are not supported 51 49 52 = 2.2 = 50 53 Import products from SmartAccounts available -
smartaccounts/trunk/smartaccounts.php
r2002900 r2019487 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 * Requires at least: 4.8.0 12 * Tested up to: 5.0. 212 * Tested up to: 5.0.3 13 13 */ 14 15 14 16 15 if ( ! defined('ABSPATH')) {
Note: See TracChangeset
for help on using the changeset viewer.