Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
PayPal: display an error message if one occurs during SetExpressCheck…
Browse files Browse the repository at this point in the history
…out.
  • Loading branch information
kovshenin committed Mar 27, 2013
1 parent 72d372a commit 310652a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/payment-paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ function payment_checkout( $payment_token ) {
} else {
$this->log( 'Error during SetExpressCheckout.', null, $response );
$error_code = isset( $response['L_ERRORCODE0'] ) ? $response['L_ERRORCODE0'] : 0;
$error_message = isset( $response['L_LONGMESSAGE0'] ) ? $response['L_LONGMESSAGE0'] : '';

if ( ! empty( $error_message ) )
$camptix->error( sprintf( __( 'PayPal error: %s (%d)', 'camptix' ), $error_message, $error_code ) );

return $this->payment_result( $payment_token, CampTix_Plugin::PAYMENT_STATUS_FAILED, array(
'error_code' => $error_code,
'raw' => $request,
Expand Down

0 comments on commit 310652a

Please sign in to comment.