scala - com.paypal.core.rest.PayPalRESTException:Read timed out -


I am using paypal for payment in my project. It works to successfully complete Visa Cards and MasterCard and payments.

  Private def defaults (payment: payer, payer, access token: string): payment = {val apiContext = new APICCText (access token) var objPay = payment apiContext.setConfigurationMap (sdkConfig) {ObjPay = objPay.create (apiContext) // Exception is here / here some code ..... ......} hold {case e: PayPalRESTException = & gt; {Println ("Exception in the last payment method") val msg = e.getMessage println (e) println (msg)}} objPay}   

but American Express & Amp; I get the following exception from Discover card:

  The last payment method in the exception is com.paypal.core.rest.PayPalRESTException: Read Time-Period Read Time Expired < / Code>  

I am using these library dependencies ......

  "com.paypal.sdk"% "PayPal-Core"% " 1.5.2 "," Com.paypal.sdk "%" rest-api-sdk "%" 0.7.1 "," com.paypal.sdk "%" invoice "%" 2.4.106 "," com.paypal. Sdk "%" for "adaptive payment"% "2.5.106", "com.paypal.sdk"% "customizerddk"% "2.4.106", "com.paypal.sdk"% "permissions"% "2.3.106 "," com.stripe "%" strip-h Or "%" 1.7.1 "," SparkJava "%" Spark-Core "%" 1.1.1 "," Comparative SDK "%" Merchantsdick "%" 2.1.96 "  < / Div> 

American Express and Discover Sometimes the time for resources is now. If you are using the rest SDK as your base, the http.connectiontimeout variable is set to 30 seconds. You should increase it to at least 60 (and possibly more if you still have timeouts).

In Scala, you can set http.setRequestTimeoutInMs (6000) to extend timeout for 60 seconds.

SDK samples include a bootstrap.php file which sets an APIctext. // Use the APIICact object to authenticate API calls // Client id and client for // OAuthTokenCredential class // // developer.paypal.com $ apiContext = new ApiContext ( The new OAuthTokenCredential ('...', '...') can be obtained from); // #### SDK configuration // If you have a static file // based configuration $ apiContext- & gt; If you want to use setConfig (array ('mode' = & gt;), then eject this line and cancel the PP_CONFIG_PATH // 'define' block. 'Sandbox', 'http.ConnectionTimeOut' => 30 , 'Log.LogEnabled' = & gt; true, 'log.filename' = & gt; '../paypal.log', 'log.logvalval ='> 'right'));

The http.ConnectionTimeOut field is where you want to see it set to 60 or more.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -