WP eCommerce - Version 3.11.1

Version Description

  • Fix: Amazon Payments caused fatal errors on PHP 5.2. See #2026.
  • Fix: Our translation update was too fast, too furious. We accidentally replaced a string we didn't intend to replace. This broke pagination for products. We feel pretty bad about that.
Download this release

Release Info

Developer JustinSainton
Plugin Icon 128x128 WP eCommerce
Version 3.11.1
Comparing to
See all releases

Code changes from version 3.11.0 to 3.11.1

CONTRIBUTING.md ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to WP eCommerce
2
+
3
+ Howdy! We're glad you're interested in contributing to WP eCommerce. Read on to make sure you follow all the steps required to successfully submit an issue or patch to the repository.
4
+
5
+ *This is not a place to submit support requests, this is a code repository to submit code bugs and code patches. Support tickets can be created here: https://wordpress.org/support/plugin/wp-e-commerce*
6
+
7
+ Before you submit an issue
8
+ ---
9
+ 1. Check for duplicate issues in the repo
10
+ 2. Make sure you have the latest version of WP eCommerce running in your local enviroment
11
+ 3. Fork the WP eCommerce repo in order to create Pull Requests.
12
+
13
+ Reporting a bug
14
+ ---
15
+ 1. Specify the version number for both WordPress and WP eCommerce
16
+ 2. Describe the issue with great detail, be specific about the problem you see.
17
+ 3. If this is a browser issue, make sure to mention which browser you have trouble on.
18
+ 4. If this is a visual bug, please make sure to add a screenshot.
19
+ 5. if you create a Pull Request for this issue, make sure to attach the Pull Request created to the issue.
20
+
21
+ Resources
22
+ ---
23
+ [Labels and Workflow](https://github.com/wp-e-commerce/WP-e-Commerce/wiki/Issue-Labels-and-Workflow)
24
+
bin/install-wp-tests.sh ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ if [ $# -lt 3 ]; then
4
+ echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
5
+ exit 1
6
+ fi
7
+
8
+ DB_NAME=$1
9
+ DB_USER=$2
10
+ DB_PASS=$3
11
+ DB_HOST=${4-localhost}
12
+ WP_VERSION=${5-latest}
13
+
14
+ WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
15
+ WP_CORE_DIR=/tmp/wordpress/
16
+
17
+ set -ex
18
+
19
+ install_wp() {
20
+ mkdir -p $WP_CORE_DIR
21
+
22
+ if [ $WP_VERSION == 'latest' ]; then
23
+ local ARCHIVE_NAME='latest'
24
+ else
25
+ local ARCHIVE_NAME="wordpress-$WP_VERSION"
26
+ fi
27
+
28
+ wget -nv -O /tmp/wordpress.tar.gz http://wordpress.org/${ARCHIVE_NAME}.tar.gz
29
+ tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
30
+
31
+ wget -nv -O $WP_CORE_DIR/wp-content/db.php https://raw.github.com/markoheijnen/wp-mysqli/master/db.php
32
+ }
33
+
34
+ install_test_suite() {
35
+ # portable in-place argument for both GNU sed and Mac OSX sed
36
+ if [[ $(uname -s) == 'Darwin' ]]; then
37
+ local ioption='-i .bak'
38
+ else
39
+ local ioption='-i'
40
+ fi
41
+
42
+ # set up testing suite
43
+ mkdir -p $WP_TESTS_DIR
44
+ cd $WP_TESTS_DIR
45
+ svn co --quiet http://develop.svn.wordpress.org/trunk/tests/phpunit/includes/
46
+
47
+ wget -nv -O wp-tests-config.php http://develop.svn.wordpress.org/trunk/wp-tests-config-sample.php
48
+ sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" wp-tests-config.php
49
+ sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" wp-tests-config.php
50
+ sed $ioption "s/yourusernamehere/$DB_USER/" wp-tests-config.php
51
+ sed $ioption "s/yourpasswordhere/$DB_PASS/" wp-tests-config.php
52
+ sed $ioption "s|localhost|${DB_HOST}|" wp-tests-config.php
53
+ }
54
+
55
+ install_db() {
56
+ # parse DB_HOST for port or socket references
57
+ local PARTS=(${DB_HOST//\:/ })
58
+ local DB_HOSTNAME=${PARTS[0]};
59
+ local DB_SOCK_OR_PORT=${PARTS[1]};
60
+ local EXTRA=""
61
+
62
+ if ! [ -z $DB_HOSTNAME ] ; then
63
+ if [[ "$DB_SOCK_OR_PORT" =~ ^[0-9]+$ ]] ; then
64
+ EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
65
+ elif ! [ -z $DB_SOCK_OR_PORT ] ; then
66
+ EXTRA=" --socket=$DB_SOCK_OR_PORT"
67
+ elif ! [ -z $DB_HOSTNAME ] ; then
68
+ EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
69
+ fi
70
+ fi
71
+
72
+ # create database
73
+ mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
74
+ }
75
+
76
+ install_wp
77
+ install_test_suite
78
+ install_db
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: JustinSainton
3
  Donate link: https://wpecommerce.org
4
  Tags: e-commerce, woocommerce, digital downloads, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
5
  Requires at least: 4.1
6
- Tested up to: 4.3
7
- Stable tag: 3.11.0
8
 
9
  WP eCommerce is a free, powerful plugin that empowers you to sell anything online, quickly and easily.
10
 
@@ -36,6 +36,11 @@ After upgrading from earlier versions look for link "Update Store". This will up
36
 
37
  == Changelog ==
38
 
 
 
 
 
 
39
  = 3.11.0 =
40
 
41
  * _Potentially breaking change_: wpsc_add_to_cart() now checks the `$_REQUEST` super global, rather than `$_POST`. This allows for future features, such as populating carts from a URL token, etc. Anywhere you may have code that checks for $_POST, in this context, it should now check $_REQUEST. See [#1852](https://github.com/wp-e-commerce/WP-e-Commerce/issues/1852).
3
  Donate link: https://wpecommerce.org
4
  Tags: e-commerce, woocommerce, digital downloads, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
5
  Requires at least: 4.1
6
+ Tested up to: 4.4
7
+ Stable tag: 3.11.1
8
 
9
  WP eCommerce is a free, powerful plugin that empowers you to sell anything online, quickly and easily.
10
 
36
 
37
  == Changelog ==
38
 
39
+ = 3.11.1 =
40
+
41
+ * Fix: Amazon Payments caused fatal errors on PHP 5.2. See [#2026](https://github.com/wp-e-commerce/WP-e-Commerce/issues/2026).
42
+ * Fix: Our translation update was too fast, too furious. We accidentally replaced a string we didn't intend to replace. This broke pagination for products. We feel pretty bad about that.
43
+
44
  = 3.11.0 =
45
 
46
  * _Potentially breaking change_: wpsc_add_to_cart() now checks the `$_REQUEST` super global, rather than `$_POST`. This allows for future features, such as populating carts from a URL token, etc. Anywhere you may have code that checks for $_POST, in this context, it should now check $_REQUEST. See [#1852](https://github.com/wp-e-commerce/WP-e-Commerce/issues/1852).
wp-shopping-cart.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP eCommerce
4
  * Plugin URI: http://wpecommerce.org/
5
  * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://wpecommerce.org" target="_blank">WPeCommerce.org</a> | <a href="https://wordpress.org/support/plugin/wp-e-commerce/" target="_blank">Support Forum</a> | <a href="http://docs.wpecommerce.org/" target="_blank">Documentation</a>
6
- * Version: 3.11.0
7
  * Author: WP eCommerce
8
  * Author URI: http://wpecommerce.org/
9
  * Text Domain: wp-e-commerce
3
  * Plugin Name: WP eCommerce
4
  * Plugin URI: http://wpecommerce.org/
5
  * Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://wpecommerce.org" target="_blank">WPeCommerce.org</a> | <a href="https://wordpress.org/support/plugin/wp-e-commerce/" target="_blank">Support Forum</a> | <a href="http://docs.wpecommerce.org/" target="_blank">Documentation</a>
6
+ * Version: 3.11.1
7
  * Author: WP eCommerce
8
  * Author URI: http://wpecommerce.org/
9
  * Text Domain: wp-e-commerce
wpsc-admin/includes/purchase-log-list-table-class.php CHANGED
@@ -409,7 +409,7 @@ class WPSC_Purchase_Log_List_Table extends WP_List_Table {
409
  * Define the columns in the table which are sortable. You can add/amend
410
  * this list using the WordPress core filter manage_{screen}_sortable_columns
411
  * Specifically: manage_dashboard_page_wpsc-purchase-logs_sortable_columns
412
- * *
413
  * @return array[string]string List of sortable column IDs and corresponding db column of the item
414
  */
415
  public function get_sortable_columns() {
409
  * Define the columns in the table which are sortable. You can add/amend
410
  * this list using the WordPress core filter manage_{screen}_sortable_columns
411
  * Specifically: manage_dashboard_page_wpsc-purchase-logs_sortable_columns
412
+ *
413
  * @return array[string]string List of sortable column IDs and corresponding db column of the item
414
  */
415
  public function get_sortable_columns() {
wpsc-components/merchant-core-v3/classes/payment-gateway.php CHANGED
@@ -790,4 +790,4 @@ class WPSC_Payment_Gateway_Setting {
790
  }
791
  }
792
 
793
- WPSC_Payment_Gateways::init();
790
  }
791
  }
792
 
793
+ WPSC_Payment_Gateways::init();
wpsc-components/merchant-core-v3/gateways/amazon-payments.php CHANGED
@@ -22,7 +22,9 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
22
  )
23
  );
24
 
 
25
  private $order_handler;
 
26
  private $reference_id;
27
  private $seller_id;
28
  private $mws_access_key;
@@ -43,9 +45,10 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
43
 
44
  $this->user_is_authenticated = isset( $_GET['amazon_payments_advanced'] ) && 'true' == $_GET['amazon_payments_advanced'] && isset( $_GET['access_token'] );
45
 
46
- $this->order_handler = WPSC_Amazon_Payments_Order_Handler::get_instance( $this );
47
 
48
  add_action( 'init', array( $this->order_handler, 'process_ipn' ) );
 
49
  // Define user set variables
50
  $this->seller_id = $this->setting->get( 'seller_id' );
51
  $this->mws_access_key = $this->setting->get( 'mws_access_key' );
@@ -816,8 +819,8 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
816
  */
817
  public function api_request( $args ) {
818
 
819
- if ( ! class_exists( 'PayWithAmazon\ResponseParser' ) ) {
820
- require_once WPSC_MERCHANT_V3_SDKS_PATH . '/amazon-payments/sdk/ResponseParser.php';
821
  }
822
 
823
  $defaults = array(
@@ -837,11 +840,18 @@ class WPSC_Payment_Gateway_Amazon_Payments extends WPSC_Payment_Gateway {
837
  $this->log( $args, $response );
838
 
839
  if ( ! is_wp_error( $response ) ) {
 
840
  $response_object = array();
841
  $response_object['ResponseBody'] = $response['body'];
842
  $response_object['Status'] = wp_remote_retrieve_response_code( $response );
843
- $response_parser = new PayWithAmazon\ResponseParser( $response_object );
844
- $response = $response_parser->toArray();
 
 
 
 
 
 
845
  }
846
 
847
  return $response;
@@ -1579,13 +1589,13 @@ class WPSC_Amazon_Payments_Order_Handler {
1579
 
1580
  $this->doing_ipn = true;
1581
 
1582
- if ( ! class_exists( 'PayWithAmazon\IpnHandler' ) ) {
1583
- require_once WPSC_MERCHANT_V3_SDKS_PATH . '/amazon-payments/sdk/IpnHandler.php';
1584
- }
1585
-
1586
  try {
1587
- $ipn = new PayWithAmazon\IpnHandler( $headers, $body );
1588
- $data = $ipn->toArray();
 
 
 
 
1589
  $seller_id = $data['SellerId'];
1590
 
1591
  if ( $seller_id != $this->gateway->seller_id ) {
@@ -1689,17 +1699,19 @@ class WPSC_Amazon_Payments_Order_Handler {
1689
  $message = ob_get_clean();
1690
  $subject = $template['subject'];
1691
 
1692
- $content_type = function () { return 'text/html'; };
1693
-
1694
- add_filter( 'wp_mail_content_type', $content_type );
1695
 
1696
  $sent = wp_mail( $order->get( 'billingemail' ), $subject, $message );
1697
 
1698
- remove_filter( 'wp_mail_content_type', $content_type );
1699
 
1700
  return $sent;
1701
  }
1702
 
 
 
 
 
1703
  /**
1704
  * Retrieves the email template path (and subject) for declined email notifications.
1705
  *
22
  )
23
  );
24
 
25
+ private $ipn_handler;
26
  private $order_handler;
27
+ private $response_parser;
28
  private $reference_id;
29
  private $seller_id;
30
  private $mws_access_key;
45
 
46
  $this->user_is_authenticated = isset( $_GET['amazon_payments_advanced'] ) && 'true' == $_GET['amazon_payments_advanced'] && isset( $_GET['access_token'] );
47
 
48
+ $this->order_handler = WPSC_Amazon_Payments_Order_Handler::get_instance( $this );
49
 
50
  add_action( 'init', array( $this->order_handler, 'process_ipn' ) );
51
+
52
  // Define user set variables
53
  $this->seller_id = $this->setting->get( 'seller_id' );
54
  $this->mws_access_key = $this->setting->get( 'mws_access_key' );
819
  */
820
  public function api_request( $args ) {
821
 
822
+ if ( ! version_compare( phpversion(), '5.3', '>=' ) ) {
823
+ return;
824
  }
825
 
826
  $defaults = array(
840
  $this->log( $args, $response );
841
 
842
  if ( ! is_wp_error( $response ) ) {
843
+
844
  $response_object = array();
845
  $response_object['ResponseBody'] = $response['body'];
846
  $response_object['Status'] = wp_remote_retrieve_response_code( $response );
847
+
848
+ if ( ! class_exists( 'PayWithAmazon\ResponseParser' ) ) {
849
+ require_once WPSC_MERCHANT_V3_SDKS_PATH . '/amazon-payments/sdk/ResponseParser.php';
850
+ }
851
+
852
+ $this->response_parser->response = $response_object;
853
+
854
+ $response = $this->response_parser->toArray();
855
  }
856
 
857
  return $response;
1589
 
1590
  $this->doing_ipn = true;
1591
 
 
 
 
 
1592
  try {
1593
+
1594
+ if ( ! class_exists( 'PayWithAmazon\IpnHandler' ) ) {
1595
+ require_once WPSC_MERCHANT_V3_SDKS_PATH . '/amazon-payments/sdk/IpnHandler.php';
1596
+ }
1597
+
1598
+ $data = $this->ipn_handler->toArray();
1599
  $seller_id = $data['SellerId'];
1600
 
1601
  if ( $seller_id != $this->gateway->seller_id ) {
1699
  $message = ob_get_clean();
1700
  $subject = $template['subject'];
1701
 
1702
+ add_filter( 'wp_mail_content_type', array( __CLASS__, 'email_content_type' ) );
 
 
1703
 
1704
  $sent = wp_mail( $order->get( 'billingemail' ), $subject, $message );
1705
 
1706
+ remove_filter( 'wp_mail_content_type', array( __CLASS__, 'email_content_type' ) );
1707
 
1708
  return $sent;
1709
  }
1710
 
1711
+ public static function email_content_type( $type ) {
1712
+ return 'text/html';
1713
+ }
1714
+
1715
  /**
1716
  * Retrieves the email template path (and subject) for declined email notifications.
1717
  *
wpsc-components/merchant-core-v3/libraries/amazon-payments/sdk/IpnHandler.php CHANGED
@@ -75,7 +75,7 @@ class IpnHandler implements IpnHandlerInterface
75
  /* Setter function
76
  * Sets the value for the key if the key exists in ipnConfig
77
  */
78
-
79
  public function __set($name, $value)
80
  {
81
  if (array_key_exists(strtolower($name), $this->ipnConfig)) {
@@ -88,7 +88,7 @@ class IpnHandler implements IpnHandlerInterface
88
  /* Getter function
89
  * Returns the value for the key if the key exists in ipnConfig
90
  */
91
-
92
  public function __get($name)
93
  {
94
  if (array_key_exists(strtolower($name), $this->ipnConfig)) {
@@ -129,7 +129,7 @@ class IpnHandler implements IpnHandlerInterface
129
  *
130
  * @return string error message
131
  */
132
-
133
  private function getErrorMessageForJsonError($json_error)
134
  {
135
  switch ($json_error) {
@@ -206,7 +206,7 @@ class IpnHandler implements IpnHandlerInterface
206
  *
207
  * @return bool true if valid
208
  */
209
-
210
  private function constructAndVerifySignature()
211
  {
212
  $signature = base64_decode($this->getMandatoryField("Signature"));
@@ -224,7 +224,7 @@ class IpnHandler implements IpnHandlerInterface
224
  *
225
  * gets the certificate from the $certificatePath using Curl
226
  */
227
-
228
  private function getCertificate($certificatePath)
229
  {
230
  $httpCurlRequest = new HttpCurl($this->ipnConfig);
@@ -283,7 +283,7 @@ class IpnHandler implements IpnHandlerInterface
283
  *
284
  * @return string field contents if found
285
  */
286
-
287
  private function getMandatoryField($fieldName)
288
  {
289
  $value = $this->getField($fieldName);
@@ -299,7 +299,7 @@ class IpnHandler implements IpnHandlerInterface
299
  *
300
  * @return string field contents if found, null otherwise
301
  */
302
-
303
  private function getField($fieldName)
304
  {
305
  if (array_key_exists($fieldName, $this->snsMessage)) {
@@ -310,7 +310,7 @@ class IpnHandler implements IpnHandlerInterface
310
  }
311
 
312
  /* returnMessage() - JSON decode the raw [Message] portion of the IPN */
313
-
314
  public function returnMessage()
315
  {
316
  return json_decode($this->snsMessage['Message'], true);
@@ -326,7 +326,7 @@ class IpnHandler implements IpnHandlerInterface
326
  * Topic ARN - Topic of the IPN
327
  * @return response in JSON format
328
  */
329
-
330
  public function toJson()
331
  {
332
  $response = $this->simpleXmlObject();
@@ -344,7 +344,7 @@ class IpnHandler implements IpnHandlerInterface
344
  /* toArray() - Converts IPN [Message] field to associative array
345
  * @return response in array format
346
  */
347
-
348
  public function toArray()
349
  {
350
  $response = $this->simpleXmlObject();
@@ -389,7 +389,7 @@ class IpnHandler implements IpnHandlerInterface
389
  /* getRemainingIpnFields()
390
  * Gets the remaining fields of the IPN to be later appended to the return message
391
  */
392
-
393
  private function getRemainingIpnFields()
394
  {
395
  $ipnMessage = $this->returnMessage();
@@ -405,3 +405,5 @@ class IpnHandler implements IpnHandlerInterface
405
  return $remainingFields;
406
  }
407
  }
 
 
75
  /* Setter function
76
  * Sets the value for the key if the key exists in ipnConfig
77
  */
78
+
79
  public function __set($name, $value)
80
  {
81
  if (array_key_exists(strtolower($name), $this->ipnConfig)) {
88
  /* Getter function
89
  * Returns the value for the key if the key exists in ipnConfig
90
  */
91
+
92
  public function __get($name)
93
  {
94
  if (array_key_exists(strtolower($name), $this->ipnConfig)) {
129
  *
130
  * @return string error message
131
  */
132
+
133
  private function getErrorMessageForJsonError($json_error)
134
  {
135
  switch ($json_error) {
206
  *
207
  * @return bool true if valid
208
  */
209
+
210
  private function constructAndVerifySignature()
211
  {
212
  $signature = base64_decode($this->getMandatoryField("Signature"));
224
  *
225
  * gets the certificate from the $certificatePath using Curl
226
  */
227
+
228
  private function getCertificate($certificatePath)
229
  {
230
  $httpCurlRequest = new HttpCurl($this->ipnConfig);
283
  *
284
  * @return string field contents if found
285
  */
286
+
287
  private function getMandatoryField($fieldName)
288
  {
289
  $value = $this->getField($fieldName);
299
  *
300
  * @return string field contents if found, null otherwise
301
  */
302
+
303
  private function getField($fieldName)
304
  {
305
  if (array_key_exists($fieldName, $this->snsMessage)) {
310
  }
311
 
312
  /* returnMessage() - JSON decode the raw [Message] portion of the IPN */
313
+
314
  public function returnMessage()
315
  {
316
  return json_decode($this->snsMessage['Message'], true);
326
  * Topic ARN - Topic of the IPN
327
  * @return response in JSON format
328
  */
329
+
330
  public function toJson()
331
  {
332
  $response = $this->simpleXmlObject();
344
  /* toArray() - Converts IPN [Message] field to associative array
345
  * @return response in array format
346
  */
347
+
348
  public function toArray()
349
  {
350
  $response = $this->simpleXmlObject();
389
  /* getRemainingIpnFields()
390
  * Gets the remaining fields of the IPN to be later appended to the return message
391
  */
392
+
393
  private function getRemainingIpnFields()
394
  {
395
  $ipnMessage = $this->returnMessage();
405
  return $remainingFields;
406
  }
407
  }
408
+
409
+ $this->ipn_handler = new PayWithAmazon\IpnHandler( $headers, $body );
wpsc-components/merchant-core-v3/libraries/amazon-payments/sdk/ResponseParser.php CHANGED
@@ -10,62 +10,62 @@ require_once 'Interface.php';
10
  class ResponseParser implements ResponseInterface
11
  {
12
  public $response = null;
13
-
14
  public function __construct($response=null)
15
  {
16
  $this->response = $response;
17
  }
18
-
19
  /* Returns the XML portion of the response */
20
-
21
  public function toXml()
22
  {
23
  return $this->response['ResponseBody'];
24
  }
25
-
26
  /* toJson - converts XML into Json
27
  * @param $response [XML]
28
  */
29
-
30
  public function toJson()
31
  {
32
  $response = $this->simpleXmlObject();
33
-
34
  return (json_encode($response));
35
  }
36
-
37
  /* toArray - converts XML into associative array
38
  * @param $this->response [XML]
39
  */
40
-
41
  public function toArray()
42
  {
43
  $response = $this->simpleXmlObject();
44
-
45
  // Converting the SimpleXMLElement Object to array()
46
  $response = json_encode($response);
47
-
48
  return (json_decode($response, true));
49
  }
50
-
51
  private function simpleXmlObject()
52
  {
53
  $response = $this->response;
54
-
55
  // Getting the HttpResponse Status code to the output as a string
56
  $status = strval($response['Status']);
57
-
58
  // Getting the Simple XML element object of the XML Response Body
59
  $response = simplexml_load_string((string) $response['ResponseBody']);
60
-
61
  // Adding the HttpResponse Status code to the output as a string
62
  $response->addChild('ResponseStatus', $status);
63
-
64
  return $response;
65
  }
66
-
67
  /* Get the status of the BillingAgreement */
68
-
69
  public function getBillingAgreementDetailsStatus($response)
70
  {
71
  $data= new \SimpleXMLElement($response);
@@ -77,7 +77,9 @@ class ResponseParser implements ResponseInterface
77
  foreach ($data->xpath('//GetBA:BillingAgreementStatus') as $value) {
78
  $baStatus = json_decode(json_encode((array)$value), TRUE);
79
  }
80
-
81
- return $baStatus ;
82
  }
83
  }
 
 
10
  class ResponseParser implements ResponseInterface
11
  {
12
  public $response = null;
13
+
14
  public function __construct($response=null)
15
  {
16
  $this->response = $response;
17
  }
18
+
19
  /* Returns the XML portion of the response */
20
+
21
  public function toXml()
22
  {
23
  return $this->response['ResponseBody'];
24
  }
25
+
26
  /* toJson - converts XML into Json
27
  * @param $response [XML]
28
  */
29
+
30
  public function toJson()
31
  {
32
  $response = $this->simpleXmlObject();
33
+
34
  return (json_encode($response));
35
  }
36
+
37
  /* toArray - converts XML into associative array
38
  * @param $this->response [XML]
39
  */
40
+
41
  public function toArray()
42
  {
43
  $response = $this->simpleXmlObject();
44
+
45
  // Converting the SimpleXMLElement Object to array()
46
  $response = json_encode($response);
47
+
48
  return (json_decode($response, true));
49
  }
50
+
51
  private function simpleXmlObject()
52
  {
53
  $response = $this->response;
54
+
55
  // Getting the HttpResponse Status code to the output as a string
56
  $status = strval($response['Status']);
57
+
58
  // Getting the Simple XML element object of the XML Response Body
59
  $response = simplexml_load_string((string) $response['ResponseBody']);
60
+
61
  // Adding the HttpResponse Status code to the output as a string
62
  $response->addChild('ResponseStatus', $status);
63
+
64
  return $response;
65
  }
66
+
67
  /* Get the status of the BillingAgreement */
68
+
69
  public function getBillingAgreementDetailsStatus($response)
70
  {
71
  $data= new \SimpleXMLElement($response);
77
  foreach ($data->xpath('//GetBA:BillingAgreementStatus') as $value) {
78
  $baStatus = json_decode(json_encode((array)$value), TRUE);
79
  }
80
+
81
+ return $baStatus;
82
  }
83
  }
84
+
85
+ $this->response_parser = new PayWithAmazon\ResponseParser();
wpsc-components/theme-engine-v1/helpers/ajax.php CHANGED
@@ -749,7 +749,7 @@ function wpsc_submit_checkout( $collected_data = true ) {
749
 
750
  //Check to ensure log row was inserted successfully
751
  if(is_null($purchase_log_id)) {
752
- $error_messages[] = __( 'A database error occured while processing your request.', 'wp-e-commerce' );
753
  wpsc_update_customer_meta( 'checkout_misc_error_messages', $error_messages );
754
  return;
755
  }
749
 
750
  //Check to ensure log row was inserted successfully
751
  if(is_null($purchase_log_id)) {
752
+ $error_messages[] = __( 'A database error occurred while processing your request.', 'wp-e-commerce' );
753
  wpsc_update_customer_meta( 'checkout_misc_error_messages', $error_messages );
754
  return;
755
  }
wpsc-components/theme-engine-v1/helpers/page.php CHANGED
@@ -1198,7 +1198,7 @@ function wpec_remap_shop_subpages( $vars ) {
1198
 
1199
  function wpsc_remove_page_from_query_string( $query_string ) {
1200
 
1201
- if ( false === strpos( implode( ' ', $query_string ), 'wp-e-commerce' ) ) {
1202
  return $query_string;
1203
  }
1204
 
1198
 
1199
  function wpsc_remove_page_from_query_string( $query_string ) {
1200
 
1201
+ if ( false === strpos( implode( ' ', $query_string ), 'wpsc' ) ) {
1202
  return $query_string;
1203
  }
1204
 
wpsc-components/theme-engine-v2/helpers/template-tags/product.php CHANGED
@@ -620,7 +620,7 @@ function wpsc_get_product_description( $more_link_text = null, $mode = 'with-tea
620
  $more_link_text = __( 'More details &raquo;', 'wp-e-commerce' );
621
  }
622
 
623
- $content = get_the_content( $more_link_text, $stripteaser );
624
 
625
  if ( $mode == 'only-teaser' ) {
626
  remove_filter( 'the_content_more_link', '__return_empty_string', 99 );
@@ -1208,4 +1208,4 @@ function wpsc_get_category_filter( $args = '' ) {
1208
 
1209
  function wpsc_category_filter( $args = '' ) {
1210
  echo wpsc_get_category_filter( $args );
1211
- }
620
  $more_link_text = __( 'More details &raquo;', 'wp-e-commerce' );
621
  }
622
 
623
+ $content = in_the_loop() ? get_the_content( $more_link_text, $stripteaser ) : get_post_field( 'post_content', get_queried_object_id() );
624
 
625
  if ( $mode == 'only-teaser' ) {
626
  remove_filter( 'the_content_more_link', '__return_empty_string', 99 );
1208
 
1209
  function wpsc_category_filter( $args = '' ) {
1210
  echo wpsc_get_category_filter( $args );
1211
+ }
wpsc-components/theme-engine-v2/mvc/controllers/checkout.php CHANGED
@@ -317,7 +317,7 @@ class WPSC_Controller_Checkout extends WPSC_Controller {
317
  //Check to ensure purchase log row was inserted successfully
318
  if(is_null($purchase_log->get( 'id' ))) {
319
  $this->message_collection->add(
320
- __( 'A database error occured while processing your request.', 'wp-e-commerce' ),
321
  'error'
322
  );
323
  return;
317
  //Check to ensure purchase log row was inserted successfully
318
  if(is_null($purchase_log->get( 'id' ))) {
319
  $this->message_collection->add(
320
+ __( 'A database error occurred while processing your request.', 'wp-e-commerce' ),
321
  'error'
322
  );
323
  return;
wpsc-core/js/tinymce3/window.php CHANGED
@@ -169,7 +169,7 @@ global $wpdb;
169
  <td><strong><label for="add_product_buynow"><?php _e("Shortcode:", 'wp-e-commerce'); ?></label></strong></td>
170
  <td>
171
  <input type="radio" id="wpsc_product_shortcode" name="wpsc_product_shortcode" value="1"><?php _e('Add a buy now button', 'wp-e-commerce');?>
172
- <br /><span class="description"><?php _e('This adds a Paypal Buy Now button for the product selected. Clicking on the button will take your customer straight to PayPal.', 'wp-e-commerce') ?></span>
173
  </td>
174
  <?php } ?>
175
 
169
  <td><strong><label for="add_product_buynow"><?php _e("Shortcode:", 'wp-e-commerce'); ?></label></strong></td>
170
  <td>
171
  <input type="radio" id="wpsc_product_shortcode" name="wpsc_product_shortcode" value="1"><?php _e('Add a buy now button', 'wp-e-commerce');?>
172
+ <br /><span class="description"><?php _e('This adds a PayPal Buy Now button for the product selected. Clicking on the button will take your customer straight to PayPal.', 'wp-e-commerce') ?></span>
173
  </td>
174
  <?php } ?>
175
 
wpsc-core/wpsc-constants.php CHANGED
@@ -55,7 +55,7 @@ function wpsc_core_constants() {
55
 
56
  // Define Plugin version
57
  if ( ! defined( 'WPSC_VERSION' ) ) {
58
- define( 'WPSC_VERSION' , '3.11.0' );
59
  }
60
 
61
  if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
@@ -63,7 +63,7 @@ function wpsc_core_constants() {
63
  }
64
 
65
  if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
66
- define( 'WPSC_PRESENTABLE_VERSION', '3.11.0' );
67
  }
68
 
69
  // Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
@@ -95,6 +95,7 @@ function wpsc_core_constants() {
95
  define( 'WPSC_CORE_JS_URL' , WPSC_URL . '/wpsc-core/js' );
96
  define( 'WPSC_CORE_JS_PATH', WPSC_FILE_PATH . '/wpsc-core/js' );
97
 
 
98
  // Require loading of deprecated functions for now. We will ween WPEC off
99
  // of this in future versions.
100
  if ( ! defined( 'WPEC_LOAD_DEPRECATED' ) ) {
55
 
56
  // Define Plugin version
57
  if ( ! defined( 'WPSC_VERSION' ) ) {
58
+ define( 'WPSC_VERSION' , '3.11.1' );
59
  }
60
 
61
  if ( ! defined( 'WPSC_MINOR_VERSION' ) ) {
63
  }
64
 
65
  if ( ! defined( 'WPSC_PRESENTABLE_VERSION' ) ) {
66
+ define( 'WPSC_PRESENTABLE_VERSION', '3.11.1' );
67
  }
68
 
69
  // Define a salt to use when we hash, WPSC_SALT may be defined for us in our config file, so check first
95
  define( 'WPSC_CORE_JS_URL' , WPSC_URL . '/wpsc-core/js' );
96
  define( 'WPSC_CORE_JS_PATH', WPSC_FILE_PATH . '/wpsc-core/js' );
97
 
98
+
99
  // Require loading of deprecated functions for now. We will ween WPEC off
100
  // of this in future versions.
101
  if ( ! defined( 'WPEC_LOAD_DEPRECATED' ) ) {
wpsc-includes/wpsc-countries.class.php CHANGED
@@ -706,7 +706,6 @@ class WPSC_Countries {
706
  }
707
 
708
  if ( ! $region_id ) {
709
- _wpsc_doing_it_wrong( 'WPSC_Countries::get_country_id_by_region_id', __( 'Function "get_country_id_by_region_id" requires an integer $region_id', 'wp-e-commerce' ), '3.8.14' );
710
  return false;
711
  }
712
 
706
  }
707
 
708
  if ( ! $region_id ) {
 
709
  return false;
710
  }
711
 
wpsc-languages/{wp-e-commerce-hr_HR.mo → wp-e-commerce-hr.mo} RENAMED
File without changes
wpsc-languages/{wp-e-commerce-hr_HR.po → wp-e-commerce-hr.po} RENAMED
File without changes
wpsc-languages/{wp-e-commerce-tr.mo → wp-e-commerce-tr_TR.mo} RENAMED
File without changes
wpsc-languages/{wp-e-commerce-tr.po → wp-e-commerce-tr_TR.po} RENAMED
File without changes
wpsc-languages/{wp-e-commerce-zh_ZH.mo → wp-e-commerce-zh_CN.mo} RENAMED
File without changes
wpsc-languages/{wp-e-commerce-zh_ZH.po → wp-e-commerce-zh_CN.po} RENAMED
File without changes