diff --git a/wpsc-components/theme-engine-v1/widgets/specials_widget.php b/wpsc-components/theme-engine-v1/widgets/specials_widget.php index 7e17cd7bed..4faaa00ffa 100755 --- a/wpsc-components/theme-engine-v1/widgets/specials_widget.php +++ b/wpsc-components/theme-engine-v1/widgets/specials_widget.php @@ -170,7 +170,11 @@ function _wpsc_filter_special_widget_join( $join ) { * 5. Function now expect a single paramter with an array of options (used to be a string which prepended the output). */ +<<<<<<< HEAD +function wpsc_specials( $args, $instance ) { +======= function wpsc_specials( $args = null, $instance ) { +>>>>>>> parent of eb244fad (PHP 8 Compatibility) global $wpdb; diff --git a/wpsc-includes/meta.functions.php b/wpsc-includes/meta.functions.php index deb863e23a..6255c0e254 100755 --- a/wpsc-includes/meta.functions.php +++ b/wpsc-includes/meta.functions.php @@ -21,7 +21,11 @@ function wpsc_sanitize_meta_key( $key ) { * @param string $object_type Object type. * @return mixed Meta value. */ +<<<<<<< HEAD +function wpsc_get_meta( $object_id, $meta_key, $object_type ) { +======= function wpsc_get_meta( $object_id = 0, $meta_key, $object_type ) { +>>>>>>> parent of eb244fad (PHP 8 Compatibility) global $wpdb; diff --git a/wpsc-merchants/paypal-standard.merchant.php b/wpsc-merchants/paypal-standard.merchant.php index 137aa2ee1c..ed766fb8d4 100755 --- a/wpsc-merchants/paypal-standard.merchant.php +++ b/wpsc-merchants/paypal-standard.merchant.php @@ -125,10 +125,18 @@ function _construct_value_array( $aggregate = false ) { 'currency_code' => $this->get_paypal_currency_code(), 'lc' => $this->cart_data['store_currency'], 'no_note' => '1', - 'charset' => 'utf-8', - ); - - // IPN data + 'charset' => 'utf-8', + + ); + + // Set PayPal payments to come through as authorisations + if (get_option('authorisation_or_completed_payment') == 1) { + $paypal_vars += array( + 'paymentaction' => 'authorization' + ); + } + + // IPN data if (get_option('paypal_ipn') == 1) { $notify_url = $this->cart_data['notification_url']; $notify_url = add_query_arg('gateway', 'wpsc_merchant_paypal_standard', $notify_url); @@ -170,9 +178,10 @@ function _construct_value_array( $aggregate = false ) { // Order settings to be sent to paypal $paypal_vars += array( 'invoice' => $this->cart_data['session_id'] + ); - - if ( $buy_now ) { + + if ( $buy_now ) { $paypal_vars['custom'] = 'buy_now'; } @@ -651,11 +660,15 @@ function submit_paypal_multiple (){ update_option( 'paypal_ship', (int) $_POST['paypal_ship'] ); } + if ( isset( $_POST['authorisation_or_completed_payment'] ) ) { + update_option( 'authorisation_or_completed_payment', (int) $_POST['authorisation_or_completed_payment'] ); + } + if ( ! isset( $_POST['paypal_form'] ) ) { $_POST['paypal_form'] = array(); } - foreach( (array) $_POST['paypal_form'] as $form => $value ) { + foreach( (array) $_POST['paypal_form'] as $form => $value ) { update_option( 'paypal_form_' . $form, sanitize_text_field( $value ) ); } @@ -749,7 +762,22 @@ function form_paypal_multiple() { $address_override2 = "checked='checked'"; break; } + + $authorisation_or_completed_payment = get_option( 'authorisation_or_completed_payment' ); + $authorisation_or_completed_payment1 = ""; + $authorisation_or_completed_payment2 = ""; + switch( $authorisation_or_completed_payment ) { + case 1: + $authorisation_or_completed_payment1 = "checked= 'checked'"; + break; + + case 0: + default: + $authorisation_or_completed_payment2 = "checked='checked'"; + break; + } $output .= " +
+ " . __( "This setting allows you to choose if you with to have PayPal payments come through as authorisations, or completed payments. Tick yes for payments to come through as authorisations, or no for payments to come through as completed payments. If set to authorisations, you will then be able to capture or void the transaction from within your PayPal account.", 'wp-e-commerce' ) . " +
+