The simplest payment processing Java library in the world. Unifies PayPal and Stripe into one API. Supports both regular payments and subscriptions, with NO need of handling json, requests, storage into a database yourself.
com.stripe.exception.InvalidRequestException: No such subscription: 'sub_1MOo5NIX00iKYn4iAq6PYg8N'; code: resource_missing; request-id: req_ywaU0OERhkLsSB
at com.stripe.net.LiveStripeResponseGetter.handleApiError(LiveStripeResponseGetter.java:194)
at com.stripe.net.LiveStripeResponseGetter.request(LiveStripeResponseGetter.java:65)
at com.stripe.net.ApiResource.request(ApiResource.java:181)
at com.stripe.model.Subscription.cancel(Subscription.java:644)
at com.stripe.model.Subscription.cancel(Subscription.java:596)
at com.osiris.payhook.PayHook.cancelPayment(PayHook.java:1184)
at com.osiris.payhook.Subscription.cancel(Subscription.java:80)
at com.osiris.payhook.MainTest.main(MainTest.java:161)
Caused by: java.lang.RuntimeException: com.osiris.jlib.json.exceptions.HttpErrorException:
url: https://api-m.paypal.com/v1/catalogs/products/PROD-1YH85584PA142631C
message:
json:
at com.osiris.autoplug.webserver.GD.<clinit>(GD.java:248)
... 10 more
Caused by: com.osiris.jlib.json.exceptions.HttpErrorException:
url: https://api-m.paypal.com/v1/catalogs/products/PROD-1YH85584PA142631C
message:
json:
at com.osiris.payhook.paypal.UtilsPayPalJson.jsonFromUrl(UtilsPayPalJson.java:50)
at com.osiris.payhook.paypal.UtilsPayPalJson.patchJsonAndGetResponse(UtilsPayPalJson.java:64)
at com.osiris.payhook.paypal.PayPalUtils.updateProduct(PayPalUtils.java:167)
at com.osiris.payhook.PayHook.putProduct(PayHook.java:540)
Hi, I used this library in version 2.4 which does not seem to work with paypal anymore.
When I upgrade to version 4 everything seems to have changed. Are there any upgrade instructions? Does it now require its own database and other stuff?
Exception in thread "Thread-2" java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 AND timestampCancelled = 0 AND timestampCreated < 1673038553098 AND times...' at line 1
at com.osiris.payhook.PayHook.lambda$init$4(PayHook.java:276)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 AND timestampCancelled = 0 AND timestampCreated < 1673038553098 AND times...' at line 1
at com.osiris.jsqlgen.payhook.Payment.get(Payment.java:285)
at com.osiris.jsqlgen.payhook.Payment.getPendingPayments(Payment.java:813)
at com.osiris.jsqlgen.payhook.Payment.getPendingPayments(Payment.java:802)
at com.osiris.payhook.PayHook.lambda$init$4(PayHook.java:251)
... 1 more
Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 AND timestampCancelled = 0 AND timestampCreated < 1673038553098 AND times...' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)
at com.osiris.jsqlgen.payhook.Payment.get(Payment.java:260)
... 4 more
Since webhook events are verified by sending them completely to the payment processor and then waiting for the result, a malicious user could create fake webhook events that are very very large, thus decreasing overall network speed.
If the webhook event is large enough it could even cause the app to go out of memory, because the event is parsed fully.
It seems that payment processors also don't really have a maximum allowed size for the webhook event before they close the connection.