Wordpress Paypal Error after Paypal express checkout button is pressed - wordpress

I'm getting an error such as this after updating Woocommerce to its latest version.
PayPal error (10002): An error (10002) occurred while processing your PayPal payment. Please contact the store owner for assistance.
This is my error log:
06-05-2020 # 15:33:45 - WC_Gateway_PPEC_Client::_request: remote request to https://api-3t.paypal.com/nvp with params: Array
(
[LOGOIMG] => https://public-health-safety.com/wp-content/uploads/2019/06/PHS-Logo-150x72.jpg
[HDRIMG] =>
[PAGESTYLE] =>
[BRANDNAME] => PHS
[RETURNURL] => https://public-health-safety.com/checkout/?woo-paypal-return=true
[CANCELURL] => https://public-health-safety.com/cart/?woo-paypal-cancel=true
[LANDINGPAGE] => Login
[SOLUTIONTYPE] => Sole
[PAYMENTREQUEST_0_PAYMENTACTION] => sale
[PAYMENTREQUEST_0_INSURANCEAMT] => 0
[PAYMENTREQUEST_0_HANDLINGAMT] => 0
[PAYMENTREQUEST_0_CUSTOM] =>
[PAYMENTREQUEST_0_INVNUM] =>
[PAYMENTREQUEST_0_CURRENCYCODE] => USD
[PAYMENTREQUEST_0_AMT] => 190
[PAYMENTREQUEST_0_ITEMAMT] => 190
[PAYMENTREQUEST_0_SHIPPINGAMT] => 0
[PAYMENTREQUEST_0_TAXAMT] => 0
[PAYMENTREQUEST_0_SHIPDISCAMT] => 0
[NOSHIPPING] => 0
[EMAIL] => phsinc33#yahoo.com
[PAYMENTREQUEST_0_SHIPTONAME] =>
[PAYMENTREQUEST_0_SHIPTOSTREET] => 1528 W Adams
[PAYMENTREQUEST_0_SHIPTOSTREET2] =>
[PAYMENTREQUEST_0_SHIPTOCITY] => Chicago
[PAYMENTREQUEST_0_SHIPTOSTATE] => IL
[PAYMENTREQUEST_0_SHIPTOZIP] => 60607
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => US
[PAYMENTREQUEST_0_SHIPTOPHONENUM] => 3124910081
[L_PAYMENTREQUEST_0_NAME0] => AA 20-0608 - Asbestos Awareness 4-hour Training CAMICB
[L_PAYMENTREQUEST_0_DESC0] => ASBESTOS AWARENESS 4-HR TRAINING
Qualifies:
Per requirement of Community Association Managers International Certification
[L_PAYMENTREQUEST_0_QTY0] => 2
[L_PAYMENTREQUEST_0_AMT0] => 95
[L_PAYMENTREQUEST_0_NUMBER0] =>
[METHOD] => SetExpressCheckout
[VERSION] => 120.0
[USER] =>
[PWD] =>
[SIGNATURE] =>
)
06-05-2020 # 15:33:45 - WC_Gateway_PPEC_Client::_process_response: acknowleged response body: Array
(
[TIMESTAMP] => 2020-06-05T20:33:45Z
[CORRELATIONID] => ca25e49242d8a
[ACK] => Failure
[VERSION] => 120.0
[BUILD] => 54596016
[L_ERRORCODE0] => 10002
[L_SHORTMESSAGE0] => Authentication/Authorization Failed
[L_LONGMESSAGE0] => You do not have permissions to make this API call
[L_SEVERITYCODE0] => Error
)
Please help!

It appears as though you need to set your API credentials (User/Password/Signature).
They can be obtained via https://www.paypal.com/api

Related

Wordpress4.9.1 SMTP not working

I am using the WP mail SMTP (0.11.2) plugin.
usingWordpress4.9.1
When I sent my email it gives me this error SMTP -> ERROR: Failed to connect to server or Could not authenticate.
How can I fix it?
C:\wamp64\www\wordpress\wp-content\plugins\wp-mail-smtp\wp_mail_smtp.php:258:boolean false
Here is my testmail debuging info:
PHPMailer Object
(
[Version] => 5.2.22
[Priority] =>
[CharSet] => UTF-8
[ContentType] => text/plain
[Encoding] => 8bit
[ErrorInfo] => SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[From] => xxxxxxxxxx#gmail.com
[FromName] => 搖滾俱樂部
[Sender] =>
[ReturnPath] =>
[Subject] => WP Mail SMTP: Test mail to bb5566123com#yahoo.com.tw
[Body] => 這封測試郵件由 WordPress 外掛 WP Mail SMTP 自動產生。
[AltBody] =>
[Ical] =>
[MIMEBody:protected] => 這封測試郵件由 WordPress 外掛 WP Mail SMTP 自動產生。
[MIMEHeader:protected] => Date: Fri, 8 Dec 2017 14:51:09 +0000
To: xxxxxxxxx#yahoo.com.tw
From: =?UTF-8?B?5pCW5ru+5L+x5qiC6YOo?=
Subject: WP Mail SMTP: Test mail to bb5566123com#yahoo.com.tw
Message-ID: <1d6e4a91953547c850de852e798ccbba#club3.idv.tw>
X-Mailer: PHPMailer 5.2.22 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[mailHeader:protected] =>
[WordWrap] => 0
[Mailer] => smtp
[Sendmail] => /usr/sbin/sendmail
[UseSendmailOptions] => 1
[PluginDir] =>
[ConfirmReadingTo] =>
[Hostname] =>
[MessageID] =>
[MessageDate] => Fri, 8 Dec 2017 14:51:09 +0000
[Host] => smtp.gmail.com
[Port] => 465
[Helo] =>
[SMTPSecure] => ssl
[SMTPAutoTLS] => 1
[SMTPAuth] => 1
[SMTPOptions] => Array
(
)
[Username] => xxxxxxxxxxx#gmail.com
[Password] => xxxxxxxxxxxx
[AuthType] =>
[Realm] =>
[Workstation] =>
[Timeout] => 300
[SMTPDebug] => 0
[Debugoutput] => echo
[SMTPKeepAlive] =>
[SingleTo] =>
[SingleToArray] => Array
(
)
[do_verp] =>
[AllowEmpty] =>
[LE] =>
[DKIM_selector] =>
[DKIM_identity] =>
[DKIM_passphrase] =>
[DKIM_domain] =>
[DKIM_private] =>
[DKIM_private_string] =>
[action_function] =>
[XMailer] =>
[smtp:protected] => SMTP Object
(
[Version] => 5.2.22
[SMTP_PORT] => 25
[CRLF] =>
[do_debug] => 0
[Debugoutput] => echo
[do_verp] =>
[Timeout] => 300
[Timelimit] => 300
[smtp_transaction_id_patterns:protected] => Array
(
[exim] => /[0-9]{3} OK id=(.*)/
[sendmail] => /[0-9]{3} 2.0.0 (.*) Message/
[postfix] => /[0-9]{3} 2.0.0 Ok: queued as (.*)/
)
[smtp_conn:protected] =>
[error:protected] => Array
(
[error] =>
[detail] =>
[smtp_code] =>
[smtp_code_ex] =>
)
[helo_rply:protected] =>
[server_caps:protected] =>
[last_reply:protected] =>
)
[to:protected] => Array
(
[0] => Array
(
[0] => xxxxxxxxxx#yahoo.com.tw
[1] =>
)
)
[cc:protected] => Array
(
)
[bcc:protected] => Array
(
)
[ReplyTo:protected] => Array
(
)
[all_recipients:protected] => Array
(
[xxxxxxxxxxx#yahoo.com.tw] => 1
)
[RecipientsQueue:protected] => Array
(
)
[ReplyToQueue:protected] => Array
(
)
[attachment:protected] => Array
(
)
[CustomHeader:protected] => Array
(
)
[lastMessageID:protected] => <1d6e4a91953547c850de852e798ccbba#club3.idv.tw>
[message_type:protected] => plain
[boundary:protected] => Array
(
[1] => b1_1d6e4a91953547c850de852e798ccbba
[2] => b2_1d6e4a91953547c850de852e798ccbba
[3] => b3_1d6e4a91953547c850de852e798ccbba
)
[language:protected] => Array
(
[authenticate] => SMTP Error: Could not authenticate.
[connect_host] => SMTP Error: Could not connect to SMTP host.
[data_not_accepted] => SMTP Error: data not accepted.
[empty_message] => Message body empty
[encoding] => Unknown encoding:
[execute] => Could not execute:
[file_access] => Could not access file:
[file_open] => File Error: Could not open file:
[from_failed] => The following From address failed:
[instantiate] => Could not instantiate mail function.
[invalid_address] => Invalid address:
[mailer_not_supported] => mailer is not supported.
[provide_address] => You must provide at least one recipient email address.
[recipients_failed] => SMTP Error: The following recipients failed:
[signing] => Signing Error:
[smtp_connect_failed] => SMTP connect() failed.
[smtp_error] => SMTP server error:
[variable_set] => Cannot set or reset variable:
[extension_missing] => Extension missing:
)
[error_count:protected] => 2
[sign_cert_file:protected] =>
[sign_key_file:protected] =>
[sign_extracerts_file:protected] =>
[sign_key_pass:protected] =>
[exceptions:protected] => 1
[uniqueid:protected] => 1d6e4a91953547c850de852e798ccbba
)
Heading
Connection: opening to ssl://smtp.gmail.com:465, timeout=300, options=array (
)
Connection: Failed to connect to server.
Error number 2. "Error notice: stream_socket_client():
SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failedConnection: Failed to connect to server.
Error number 2. "Error notice: stream_socket_client(): Failed to enable cryptoConnection: Failed to connect to server.
Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error)
SMTP ERROR: Failed to connect to server: (0)SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Try this plugin https://wordpress.org/plugins/blastex and send email without local smtp server !
Probably self signed certificate on smtp server !!!

Zend OPcache class loading error

Every so often, one of the instances in our application will start throwing this error:
[Fri Aug 29 14:23:25.359848 2014] [:error] [pid 2759] [client 1.2.3.4:58627] PHP Fatal error: Zend OPcache class loading error, class FSC\\HateoasBundle\\Serializer\\EventSubscriber\\EmbedderEventSubscriber in /var/app/current/vendor/composer/ClassLoader.php on line 183
It happens when loading any page. I've tried composer dump-autoload, but that does nothing. Repeatedly restarting Apache is equally useless. This is PHP 5.5.7 running on Apache 2.4.6. Here's the opcache preferences:
[root#ip-1-2-3-4 html]# php -i | grep opc
/etc/php-5.5.d/opcache.ini,
opcache.blacklist_filename => /etc/php-5.5.d/opcache*.blacklist => /etc/php-5.5.d/opcache*.blacklist
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => Off => Off
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.fast_shutdown => 1 => 1
opcache.file_update_protection => 2 => 2
opcache.force_restart_timeout => 180 => 180
opcache.inherited_hack => On => On
opcache.interned_strings_buffer => 8 => 8
opcache.load_comments => 1 => 1
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 4000 => 4000
opcache.max_file_size => 0 => 0
opcache.max_wasted_percentage => 5 => 5
opcache.memory_consumption => 256 => 256
opcache.optimization_level => 0xFFFFFFFF => 0xFFFFFFFF
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 2 => 2
opcache.revalidate_path => Off => Off
opcache.save_comments => 1 => 1
opcache.use_cwd => On => On
opcache.validate_timestamps => On => On
We're all at a loss as to what's going on. Anyone have any ideas?

How do I retrieve variation name from Variation id in woocommerce?

I use the following function call to get a product variations,
$available_variations = $product->get_available_variations();
And in the returned $available_variations I have all the variations.
I am given the variation_id, and I do not have the knowledge of the name of the attribute, which in this case is country-of-origin, so how do i retrieve the attribute values, which are Hong Kong and Singapore in this case?
Below is the dump of above $available_variations,
[18-Mar-2014 17:04:20 UTC] Array
(
[variation_id] => 2968
[attributes] => Array
(
[attribute_pa_country-of-origin] => hong-kong
)
[image_src] =>
[image_link] =>
[image_title] =>
[image_alt] =>
[price_html] => <span class="price"><span class="amount">SGD$15</span></span>
[availability_html] =>
[sku] =>
[weight] => kg
[dimensions] =>
[min_qty] => 1
[max_qty] => 0
[backorders_allowed] =>
[is_in_stock] => 1
[is_downloadable] =>
[is_virtual] =>
[is_sold_individually] => no
)
[18-Mar-2014 17:04:20 UTC] Array
(
[variation_id] => 2969
[attributes] => Array
(
[attribute_pa_country-of-origin] => singapore
)
[image_src] =>
[image_link] =>
[image_title] =>
[image_alt] =>
[price_html] => <span class="price"><span class="amount">SGD$12</span></span>
[availability_html] =>
[sku] =>
[weight] => kg
[dimensions] =>
[min_qty] => 1
[max_qty] => 0
[backorders_allowed] =>
[is_in_stock] => 1
[is_downloadable] =>
[is_virtual] =>
[is_sold_individually] => no
)
I know this is old but just incase someone needs this in the future and comes across this post, the correct way is.
echo $available_variations[0][attributes][attribute_pa_country-of-origin];
echo $available_variations[1][attributes][attribute_pa_country-of-origin];

ER-Diagram : How to manage sessions ? (parallel drupal <-> symfony2)

I am building my app and have been annoyed concerning sessions storage. I am a newbie about sessions. I am working with Symfony2 and MySQL, and as Symfony is storage-agnostic, I am searching into the Drupal 7 diagram to find a good model.
So I wondered a couple of things :
How to manage sessions in an Entity-Relationship diagram ?
In drupal 7 diagram, what do sessions->fields mean ?
Sessions -> uid (int(10)) -> OK
Sessions -> sid (varchar(128)) ?
Sessions -> ssid (varchar(128)) ?
Sessions -> hostname (varchar(128)) -> OK
Sessions -> timestamp (int(11)) -> guessing date of connection
Sessions -> cache (int(11)) -> Why only an integer ?
Sessions -> session (longblob) -> What do you put inside ?
As I imagined my own diagram, I had 2 tables :
Session that stored the sessionId, cookie and establishing date
User_Session, association between Sessions and Users, which stores IP address and DateInit.
Why not storing one session by Cookie and storing also each time the user connects ?
If someone could help me understand and help me find the true entity-relationship model...
Description of the session table from Drupal 7 is given in its system_schema() function:
$schema['sessions'] = array(
'description' => "Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated.",
'fields' => array(
'uid' => array(
'description' => 'The {users}.uid corresponding to a session, or 0 for anonymous user.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'sid' => array(
'description' => "A session ID. The value is generated by Drupal's session handlers.",
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'ssid' => array(
'description' => "Secure session ID. The value is generated by Drupal's session handlers.",
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'hostname' => array(
'description' => 'The IP address that last used this session ID (sid).',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'timestamp' => array(
'description' => 'The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'cache' => array(
'description' => "The time of this user's last post. This is used when the site has specified a minimum_cache_lifetime. See cache_get().",
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'session' => array(
'description' => 'The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
),
),
'primary key' => array(
'sid',
'ssid',
),
'indexes' => array(
'timestamp' => array('timestamp'),
'uid' => array('uid'),
'ssid' => array('ssid'),
),
'foreign keys' => array(
'session_user' => array(
'table' => 'users',
'columns' => array('uid' => 'uid'),
),
),
);
But this is not an E-R model. Also, it heavily depends on Drupal own session handling function.

drupal conditional action with custom php code

When adding custom php code for a conditional action, drupal/ubercart provides two php variables ($order and $account) that hold information about the order and account for the checkout that was just completed.
I can't find anywhere on the internet documentation about how these objects are structured...anyone know where this documentation is or how these objects are setup???
thanks
Here's what the $order object looks like on a fairly standard install (might be a bit different depending on your installation. Of course the products in the order dictate what the items section looks like:
stdClass Object
(
[order_id] => 123
[uid] => 456
[order_status] => payment_received
[order_total] => 100
[product_count] => 1
[primary_email] => test#example.com
[delivery_first_name] => Test
[delivery_last_name] => Customer
[delivery_phone] => 123-123-1234
[delivery_company] => ABC Company, Inc.
[delivery_street1] => 123 Easy St.
[delivery_street2] =>
[delivery_city] => Anytown
[delivery_zone] => 39
[delivery_postal_code] => 12345
[delivery_country] => 840
[billing_first_name] => Test
[billing_last_name] => Customer
[billing_phone] => 123-123-1234
[billing_company] => ABC Company, Inc.
[billing_street1] => 123 Easy St.
[billing_street2] =>
[billing_city] => Anytown
[billing_zone] => 39
[billing_postal_code] => 12345
[billing_country] => 840
[payment_method] => credit
[data] => Array
(
[cc_data] => ***encrypted credit card data***
)
[created] => 1295455508
[modified] => 1295457962
[host] => 127.0.0.1
[products] => Array
(
[0] => stdClass Object
(
[order_product_id] => 245
[order_id] => 123
[nid] => 5
[title] => Test Product
[manufacturer] =>
[model] => TEST-PRODUCT-SKU
[qty] => 1
[cost] => 100.00000
[price] => 100.00000
[weight] => 0
[data] => Array
(
[attributes] => Array
(
)
[shippable] => 1
[module] => uc_product
)
[order_uid] => 456
)
)
[payment_details] =>
[quote] => Array
(
[method] => flatrate_1
[accessorials] => 0
[rate] => 7.00000
[quote_form] =>
)
[line_items] => Array
(
[0] => Array
(
[line_item_id] => subtotal
[type] => subtotal
[title] => Subtotal
[amount] => 100
[weight] => 0
[data] =>
)
[1] => Array
(
[line_item_id] => 194
[type] => shipping
[title] => Flat Rate Shipping
[amount] => 7.00000
[weight] => 1
[data] =>
)
)
)
$account is the user object.
$order is the ubercart order object.
There are some minimum defined values for both of these objects, but they can contain anything really. The reason is, that Drupal will allow modules to expand the user object, while ubercart will allow modules to expand the order object.
The best thing to do in such situations is to inspect the objects to figure out how to get to what you need.
The devel module will allow you to pretty print variables using dsm() or dump the variable t a log file using dd(). Those are two ways to get to the variable info.

Resources