• Resolved developer07

    (@developer07)


    Hello,

    I have below error in Paypal payment.

    ERROR ::

    Fatal error: Uncaught PayPal\Exception\PayPalConnectionException: Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/payments/payment/PAYID-LVURQVA03127804GL8921801. in /home/theoruby/public_html/realhearing.co.uk/wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:207 Stack trace: #0 /home/theoruby/public_html/realhearing.co.uk/wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Transport/PayPalRestCall.php(78): PayPal\Core\PayPalHttpConnection->execute(”) #1 /home/theoruby/public_html/realhearing.co.uk/wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php(104): PayPal\Transport\PayPalRestCall->execute(Array, ‘/v1/payments/pa…’, ‘GET’, ”, Array) #2 /home/theoruby/public_html/realhearing.co.uk/wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/Paymen in /home/theoruby/public_html/realhearing.co.uk/wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php on line 207
    The site is experiencing technical difficulties.

    This is the error which is occurred when i move the paypal from sandbox mode to live mode.

    Please reply back for same as soon as possible.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi. Did you fix the problem? I’m facing the same situation!

    Plugin Author ZealousWeb

    (@zealopensource)

    Hello @developer07 and @mzambretti,

    Sorry for inconvenience.
    Can you please share your wp-admin credentials along with FTP details in our email?
    email: [email protected]

    so, we will look into and get back to you for the same.

    sididude

    (@sididude)

    Hello,
    I could redirect to the paypal test mode link after the form submission.
    But, when trying to Go LIVE got the following error after subutting the form-

    Client Authentication failed
    Thank you for your message. It has been sent.

    Can you guide me for this?
    the form is on the URL-
    https://www.clavusa.com/buy-5-day-singers-course-for-young-singers/

    I need to integrate more forms after this starts work.
    I have sandbox and live client ID, secret and all information needed.

    Please help me in this?
    Thanks.

    thewebtailors

    (@thewebtailors)

    I am experiencing the same error as developer07. I am using version 2.7. Any help is appreciated.

    i got the same error using actual version – sandbox mode is working fine and in live mode i got the same error …. 401…. but when u look at the top of the error message u see in the url … “…api.sandbox.paypal.com…” and this cannot work… because paypal will connet with live credentials and the url is linking to “sandbox”… to fix this quick an dirty modify the: \wp-content\plugins\contact-form-7-paypal-extension\inc\lib\sdk\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalConstants.php on line 22-23 to the same URL like the live mode:
    const REST_SANDBOX_ENDPOINT = "https://api.paypal.com/";
    and it should work… hope the plugin creator will fix this soon…

    EDIT: but this doesn’t fix the function…. no money transaktion is done … :/

    • This reply was modified 4 years, 11 months ago by fresh-x.
    • This reply was modified 4 years, 11 months ago by fresh-x.
    • This reply was modified 4 years, 11 months ago by fresh-x.

    Fixed by editing the sandbox api url as mentioned above and then adding this to class.cf7pe.php at line 117

    
    				 $execution = new PaymentExecution();
    				 $execution->setPayerId($_GET['PayerID']);
    				 $execution->addTransaction($payment->transactions[0]);
    
    				 $result = $payment->execute($execution, $apiContext);
    
    				 $posted_data = $from_data->get_posted_data();
    				$data = [
    					'transaction_id' => $payment->getId(),
    					'payment_amount' => $payment->transactions[0]->amount->total,
    					'payment_status' => $result->getState(),
    					'invoice_id' => $payment->transactions[0]->invoice_number
    				];
    
    				add_filter( 'wpcf7_mail_components', array( $this, 'filter__wpcf7_mail_components' ), 888, 3 );
    				$this->mail( $from_data, array_merge($posted_data, $data) );

    You can also then use [payment_status] inside the mail template to see the status etc.

    Plugin Author ZealousWeb

    (@zealopensource)

    Hello All,

    Sorry for the inconvenience.
    We have fixed this issue in new version 2.9
    Kindly download the latest version and check.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Paypal payment error in live mode’ is closed to new replies.