PayPal API DoDirectPayment required IP field does not support IPv6

DoDirectPayment API call requires an IP address field (this is a buyer's IP) so I am using ServletRequest.getRemoteAddr to get the request IP. However this IP is assumed to be IPv4 and does not seem to support IPv6. Have anyone found a workaround for this?

Thanks.

Answers


IP Address is not required by PayPal, so I do not send IP address in local debug mode. I only send in production mode in which we use IPv4.

DoDirectPaymentRequestDetailsType details = new DoDirectPaymentRequestDetailsType();
#if (!DEBUG)
details.IPAddress = HttpContext.Current.Request.UserHostAddress;
#endif

IPADDRESS is an optional (but recommended) field at the moment. Support for IPv6 is being added, but is not yet available. As the API document indicates, the IPADDRESS field is recorded as a means to detect possible fraud.


Need Your Help

How do I run a shell script with administrator privileges through AppleScript without prompting for a password?

macos shell applescript

I want to have my AppleScript application run a Python script with sudo, but I don't want the application to prompt the user for a password (our users do not have sudo privileges).

Oracle - PL/SQL Coding - Inserting Into Multiple Tables From Another Table

sql oracle oracle-apex

I'm currently using Oracle Application Express. I am having trouble with some PL/SQL coding.