accesto / PayumPayU

Payum component for OpenPayU integration (PayU payments)
10 stars 15 forks source link

Cannot pas customerIp during reccurent STANDARD payment #20

Closed OleksiiBulba closed 1 year ago

OleksiiBulba commented 1 year ago

What? When I run a second payment without client involvement, I cannot provide a custom client IP address.

Why? Considering that the $_SERVER variable does not contain the REMOTE_ADDR key in a console script, the library rewrites the customerIp key as null and PayU returns an error that the required field is missing.

Possible fix? Here: <project_root>/vendor/accesto/payum-pay-u/Accesto/Component/Payum/PayU/Action/ConvertPaymentAction.php:41

$details['customerIp'] = array_key_exists('customerIp', $details) ?
    $details['customerIp'] :
    (array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : null);