Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Erro de valor boleano. #180

Open
luccavallari opened this issue Sep 26, 2023 · 0 comments
Open

Erro de valor boleano. #180

luccavallari opened this issue Sep 26, 2023 · 0 comments

Comments

@luccavallari
Copy link

2023-09-26T12:20:46+00:00 CRITICAL Uncaught Error: Call to a member function get_total() on bool in /home/dominio.com.br/public_html/wp-content/plugins/woocommerce-pagarme-2.5.0/includes/class-wc-pagarme-api.php:262
Stack trace:
#0 /home/dominio.com.br/public_html/wp-content/plugins/woocommerce-pagarme-2.5.0/includes/class-wc-pagarme-api.php(379): WC_Pagarme_API->generate_transaction_data()
#1 /home/dominio.com.br/public_html/wp-content/plugins/woocommerce-pagarme-2.5.0/includes/class-wc-pagarme-credit-card-gateway.php(241): WC_Pagarme_API->get_customer_data_from_checkout_pay_page()
#2 /home/dominio.com.br/public_html/wp-includes/class-wp-hook.php(308): WC_Pagarme_Credit_Card_Gateway->checkout_scripts()
#3 /home/dominio.com.br/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#4 /home/dominio.com.br/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#5 /home/dominio.com.br/public_html/wp-includes/script-loader.php(2194): do_action()
#6 /home/dominio.com.br/public_html/wp-includes/class-wp-hook.php(308), em /home/dominio.com.br/public_html/wp-content/plugins/woocommerce-pagarme-2.5.0/includes/class-wc-pagarme-api.php, na linha 262

Ai eu fiz o seguinte

public function generate_transaction_data( $order, $posted ) {
// Set the request data.

	if ( $order ) {
		$total = (float) $order->get_total();
		} 
	$data = array(
		'api_key'      => $this->gateway->api_key,
		'amount'       => $total * 100,

Resolveu este erro, porém começou a aparecer este:

2023-09-26T17:45:02+00:00 CRITICAL Uncaught Error: Class 'WC_Pagarme_API' not found in /home/dominio.com.br/public_html/wp-content/plugins/woocommerce-pagarme-2.5.0/includes/class-wc-pagarme-banking-ticket-gateway.php:50

Desfiz a alteração porque apesar de ter esse erro de booleano, ainda realiza as transações.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant