remove print_r calls from paypal handler

This commit is contained in:
Jon Surrell 2016-11-21 20:33:09 +01:00
parent 96f9de2106
commit 66b0620f7c
4 changed files with 8 additions and 8 deletions

View File

@ -88,7 +88,7 @@ class WC_Gateway_Paypal_API_Handler {
)
);
WC_Gateway_Paypal::log( 'DoCapture Response: ' . print_r( $raw_response, true ) );
WC_Gateway_Paypal::log( 'DoCapture Response: ' . wc_safe_dump( $raw_response ) );
if ( empty( $raw_response['body'] ) ) {
return new WP_Error( 'paypal-api', 'Empty Response' );
@ -120,7 +120,7 @@ class WC_Gateway_Paypal_API_Handler {
)
);
WC_Gateway_Paypal::log( 'Refund Response: ' . print_r( $raw_response, true ) );
WC_Gateway_Paypal::log( 'Refund Response: ' . wc_safe_dump( $raw_response ) );
if ( empty( $raw_response['body'] ) ) {
return new WP_Error( 'paypal-api', 'Empty Response' );

View File

@ -91,8 +91,8 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
// Post back to get a response.
$response = wp_safe_remote_post( $this->sandbox ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr', $params );
WC_Gateway_Paypal::log( 'IPN Request: ' . print_r( $params, true ) );
WC_Gateway_Paypal::log( 'IPN Response: ' . print_r( $response, true ) );
WC_Gateway_Paypal::log( 'IPN Request: ' . wc_safe_dump( $params ) );
WC_Gateway_Paypal::log( 'IPN Response: ' . wc_safe_dump( $response ) );
// Check to see if the request was valid.
if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 && strstr( $response['body'], 'VERIFIED' ) ) {

View File

@ -88,7 +88,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
$transaction_result = $this->validate_transaction( $transaction );
WC_Gateway_Paypal::log( 'PDT Transaction Result: ' . print_r( $transaction_result, true ) );
WC_Gateway_Paypal::log( 'PDT Transaction Result: ' . wc_safe_dump( $transaction_result ) );
update_post_meta( $order->get_id(), '_paypal_status', $status );
update_post_meta( $order->get_id(), '_transaction_id', $transaction );
@ -96,7 +96,7 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
if ( $transaction_result ) {
if ( 'completed' === $status ) {
if ( $order->get_total() != $amount ) {
WC_Gateway_Paypal::log( 'Payment error: Amounts do not match (amt ' . $amount . ')' );
WC_Gateway_Paypal::log( 'Payment error: Amounts do not match (amt ' . $amount . ')', 'error' );
$this->payment_on_hold( $order, sprintf( __( 'Validation error: PayPal amounts do not match (amt %s).', 'woocommerce' ), $amount ) );
} else {
$this->payment_complete( $order, $transaction, __( 'PDT payment completed', 'woocommerce' ) );

View File

@ -30,7 +30,7 @@ abstract class WC_Gateway_Paypal_Response {
// Nothing was found.
} else {
WC_Gateway_Paypal::log( 'Error: Order ID and key were not found in "custom".' );
WC_Gateway_Paypal::log( 'Order ID and key were not found in "custom".', 'error' );
return false;
}
@ -41,7 +41,7 @@ abstract class WC_Gateway_Paypal_Response {
}
if ( ! $order || $order->get_order_key() !== $order_key ) {
WC_Gateway_Paypal::log( 'Error: Order Keys do not match.' );
WC_Gateway_Paypal::log( 'Order Keys do not match.', 'error' );
return false;
}