You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no arquivo iugu-woocommerce.php linha 101 a function woocommerce_get_customer_payment_tokens sobreescreve os $tokens e anula todos os outros gateways de pagamento.
isso acaba tornando o iugu como metodo de pagamento exclusivo e cria incompatibilidade com outros plugins de pagamento.
O correto seria array_push ou um array_merge nos $tokens, dessa forma evitando apagar os $tokens carregados em outros plugins que tenham usado o mesmo filter "woocommerce_get_customer_payment_tokens"
function woocommerce_get_customer_payment_tokens($tokens, $customer_id, $gateway_id) {
if (WC()->session != null &&
!WC()->session->get('in_woocommerce_get_customer_payment_tokens', false)) {
WC()->session->set('in_woocommerce_get_customer_payment_tokens', true);
try {
$api = new WC_Iugu_API(null, 'credit-card');
if (strlen(get_user_meta(get_current_user_id(), '_iugu_customer_id', true)) > 0) {
$api->get_customer_id();
**$tokens = $api->get_payment_methods();**
}
if (is_array($tokens) && count($tokens) == 0) {
$customer_id_iugu = $api->get_customer_id();
if ($customer_id_iugu) {
$payment_methods_iugu = $api->get_iugu_customer_payment_methods($customer_id_iugu);
if (is_array($payment_methods_iugu) && count($payment_methods_iugu) > 0) {
foreach ($payment_methods_iugu as $token_info) {
if (isset($token_info['item_type']) && $token_info['item_type'] == 'credit_card') {
$api->set_wc_payment_method($token_info, false, $customer_id_iugu);
}
}
**$tokens = WC_Iugu_API::get_payment_methods();**
}
}
}
} finally {
WC()->session->set('in_woocommerce_get_customer_payment_tokens', false);
}
}
return $tokens;
}
The text was updated successfully, but these errors were encountered:
no arquivo iugu-woocommerce.php linha 101 a function woocommerce_get_customer_payment_tokens sobreescreve os $tokens e anula todos os outros gateways de pagamento.
isso acaba tornando o iugu como metodo de pagamento exclusivo e cria incompatibilidade com outros plugins de pagamento.
O correto seria array_push ou um array_merge nos $tokens, dessa forma evitando apagar os $tokens carregados em outros plugins que tenham usado o mesmo filter "woocommerce_get_customer_payment_tokens"
The text was updated successfully, but these errors were encountered: