Giter VIP home page Giter VIP logo

paypal-springboot's People

Contributors

masasdani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

paypal-springboot's Issues

Paypal error request id after 2 payements

Hello,

There is a paypal bug when you pay more than 2 times because of the request id, the error message is :
"2019-01-22 15:33:19.143 ERROR 5416 --- [nio-8082-exec-7] com.paypal.base.HttpConnection : Error code : 400 with response : {"name":"DUPLICATE_REQUEST_ID","message":"The value of PayPal-Request-Id header has already been used","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"f3a9504624464"}"

But i have found a solution !

You need to add this line "apiContext.setMaskRequestId(true);" in the createPayement method located in the PaypalService class juste before the return statement

To be sure you understand :
public Payment createPayment(
Double total,
String currency,
PaypalPaymentMethod method,
PaypalPaymentIntent intent,
String description,
String cancelUrl,
String successUrl) throws PayPalRESTException{
Amount amount = new Amount();
amount.setCurrency(currency);
....
RedirectUrls redirectUrls = new RedirectUrls();
redirectUrls.setCancelUrl(cancelUrl);
redirectUrls.setReturnUrl(successUrl);
payment.setRedirectUrls(redirectUrls);
//Add the line below
apiContext.setMaskRequestId(true);

	return payment.create(apiContext);
}

I don't know why this is working but since i have put the line i'm able to pay more than 2 times !

Again thank you for this repository and have a nice day.

VALIDATION_ERROR

hi when i tried to run the projet i've had the following exception:
2018-05-01 14:41:48.477 ERROR 5264 --- [nio-8083-exec-2] com.paypal.base.HttpConnection : Error code : 400 with response : {"name":"VALIDATION_ERROR","details":[{"field":"transactions.amount","issue":"Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"c90e93717f741"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.