PayPal payment getway issue with integration with woocommerce
-
Hii teams,
During Payment with PayPal on Checkout Page i have get error message
[UNPROCESSABLE_ENTITY] The requested action could not be performed, semantically incorrect, or failed business validation. https://developer.paypal.com/docs/api/orders/v2/#error-CURRENCY_NOT_SUPPORTEDand i have change currency according to india.
function woocommerce_paypal_args_for_inr($paypal_args){ if ( $paypal_args['currency_code'] == 'INR'){ $convert_rate = getFromYahoo(); $count = 1; while( isset($paypal_args['amount_' . $count]) ){ $paypal_args['amount_' . $count] = round( $paypal_args['amount_' . $count] / $convert_rate, 2); $count++; } $paypal_args['tax_cart'] = round( $paypal_args['tax_cart'] / $convert_rate, 2); } return $paypal_args; } add_filter('woocommerce_paypal_args', 'woocommerce_paypal_args_for_inr'); function getFromYahoo() { $from = 'INR'; $to = 'USD'; $url = 'https://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s='. $from . $to .'=X'; $handle = @fopen($url, 'r'); if ($handle) { $result = fgets($handle, 4096); fclose($handle); } $allData = explode(',',$result); return $allData[1]; }
Again i am unable to set payments through PayPal Live as well as sendBox credentials.
- The topic ‘PayPal payment getway issue with integration with woocommerce’ is closed to new replies.