Pesapal.com

Forum

Welcome, Guest
Username
Password:
 

Pesapal Woocommerce Integration
(1 viewing) (1) Guest
Welcome to the Pesapal integration forum!

This forum discusses everything about Pesapal integration on your web site. Having any problems? This is the right place to post a question and we are sure you will get an answer
  • Page:
  • 1

TOPIC: Pesapal Woocommerce Integration

Pesapal Woocommerce Integration 11 years, 5 months ago #900

  • p_njo
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hello,
I am trying to use Pesapal with Woocommerce via this plugin (wordpress.org/plugins/pesapal-for-woocommerce/)

but I get this error when I try activating the plugin:

Fatal error: Cannot redeclare class OAuthSignatureMethod_HMAC_SHA1 in /home/innovise/public_html/tujuane/wp-content/plugins/pesapal-for-woocommerce/libs/OAuth.php on line 134

How can I fix this?

System:
Woocommerce ver.2.1.9

Re: Pesapal Woocommerce Integration 11 years, 5 months ago #901

  • lazro
  • OFFLINE
  • Administrator
  • Pesapal
  • Posts: 404
Hi p_njo,

You have another plugin that's including the OAuth file. You need to find out which plugin it is and comment out the code that does the inclusion. Else comment out our OAuth. If you do so make sure you never uninstall the other plugin that include the OAuth :-)

My greatest guess, you have a twitter plugin :-)
Regards,

Lazaro Ong'ele
Web Developer

Skype: Lazrotep
+254-020-249-5438 ; +254-706-191-729
Dagoretti Lane, Off Naivasha Road.

Facebook: www.facebook.com/pesapal
Twitter: twitter.com/PesaPal
Helpdesk: support.pesapal.com
This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
The following user(s) said Thank You: p_njo

Re: Pesapal Woocommerce Integration 11 years, 5 months ago #902

  • p_njo
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I do have a twitter plugin :)

I need to use it so only option is to comment out pesapal OAuth. How do I do that?

Thanks so much for the fast response

Re: Pesapal Woocommerce Integration 11 years, 5 months ago #903

  • lazro
  • OFFLINE
  • Administrator
  • Pesapal
  • Posts: 404
Hello,

Open this file "wp-content/plugins/pesapal-for-woocommerce/libs/OAuth.php"


Add a wrapper around the class in question. WHat this does is ignore the code withing the IF statement if you've already loaded the class

if(!class_exists( $classname ) ) {
// Maintain our code
}


eg..


if(!class_exists("OAuthSignatureMethod_HMAC_SHA1") ) {
class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
function get_name() {
return "HMAC-SHA1";
}

public function build_signature($request, $consumer, $token) {
$base_string = $request->get_signature_base_string();
$request->base_string = $base_string;

$key_parts = array(
$consumer->secret,
($token) ? $token->secret : ""
);

$key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
$key = implode('&', $key_parts);

return base64_encode(hash_hmac('sha1', $base_string, $key, true));
}
}

}


Read more on this here: www.php.net/manual/en/function.class-exists.php
Regards,

Lazaro Ong'ele
Web Developer

Skype: Lazrotep
+254-020-249-5438 ; +254-706-191-729
Dagoretti Lane, Off Naivasha Road.

Facebook: www.facebook.com/pesapal
Twitter: twitter.com/PesaPal
Helpdesk: support.pesapal.com
This e-mail address is being protected from spambots. You need JavaScript enabled to view it.
Last Edit: 11 years, 5 months ago by lazro.
  • Page:
  • 1