Revert changes from PayPal

This commit is contained in:
Claudio Sanches 2019-10-02 14:20:13 -03:00
parent 20ee6c7aed
commit 3c9b9ac6a0
1 changed files with 4 additions and 21 deletions

View File

@ -72,7 +72,6 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
add_action( 'woocommerce_order_status_processing', array( $this, 'capture_payment' ) );
add_action( 'woocommerce_order_status_completed', array( $this, 'capture_payment' ) );
add_filter( 'woocommerce_thankyou_order_received_text', array( $this, 'order_received_text' ), 10, 2 );
if ( ! $this->is_valid_for_use() ) {
$this->enabled = 'no';
@ -381,17 +380,17 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$this->log( 'Refund Result: ' . wc_print_r( $result, true ) );
switch ( strtolower( $result->ACK ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
switch ( strtolower( $result->ACK ) ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
case 'success':
case 'successwithwarning':
$order->add_order_note(
/* translators: 1: Refund amount, 2: Refund ID */
sprintf( __( 'Refunded %1$s - Refund ID: %2$s', 'woocommerce' ), $result->GROSSREFUNDAMT, $result->REFUNDTRANSACTIONID ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
sprintf( __( 'Refunded %1$s - Refund ID: %2$s', 'woocommerce' ), $result->GROSSREFUNDAMT, $result->REFUNDTRANSACTIONID ) // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
);
return true;
}
return isset( $result->L_LONGMESSAGE0 ) ? new WP_Error( 'error', $result->L_LONGMESSAGE0 ) : false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
return isset( $result->L_LONGMESSAGE0 ) ? new WP_Error( 'error', $result->L_LONGMESSAGE0 ) : false; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
}
/**
@ -415,7 +414,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
$this->log( 'Capture Result: ' . wc_print_r( $result, true ) );
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
// phpcs:disable WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
if ( ! empty( $result->PAYMENTSTATUS ) ) {
switch ( $result->PAYMENTSTATUS ) {
case 'Completed':
@ -451,20 +450,4 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
wp_enqueue_script( 'woocommerce_paypal_admin', WC()->plugin_url() . '/includes/gateways/paypal/assets/js/paypal-admin' . $suffix . '.js', array(), WC_VERSION, true );
}
/**
* Custom PayPal order received text.
*
* @since 3.9.0
* @param string $text Default text.
* @param WC_Order $order Order data.
* @return string
*/
public function order_received_text( $text, $order ) {
if ( $this->id ) {
return esc_html__( 'Thank you for your payment. Your transaction has been completed, and a receipt for your purchase has been emailed to you. Log into your PayPal account to view transaction details.', 'woocommerce' );
}
return $text;
}
}