Search found 20 matches

by jakob.schumann
Fri Apr 16, 2021 10:25 am
Forum: Cyclos 4 Communities
Topic: Request for feedback: Edit API with PHP for a specific purpose. (Details below)
Replies: 3
Views: 221

Re: Request for feedback: Edit API with PHP for a specific purpose. (Details below)

Hello Xpek, you can take a look at https://github.com/bueffelsoft/cyclos-rest-api as an example of an API client in PHP. This is a quite complex construct, using the src/ApiWrapper.php as base class to send requests and receive the answers. The src/CyclosWrapper.php then uses this base class to make...
by jakob.schumann
Sun Apr 11, 2021 5:15 am
Forum: Scripting & Webservices issues
Topic: Revoke / Terminate agreements
Replies: 1
Views: 223

Re: Revoke / Terminate agreements

To answer myself (partly): Agreements can be revoked by using the user's setAcceptedAgreements() method: import org.cyclos.entities.access.Agreement def sepaAgreement = entityManagerHandler.find(Agreement, scriptParameters.agreementName) // get the user's agreements, we need them all to set them aga...
by jakob.schumann
Sat Apr 10, 2021 8:18 am
Forum: Scripting & Webservices issues
Topic: Revoke / Terminate agreements
Replies: 1
Views: 223

Revoke / Terminate agreements

Hello! How can I revoke an accepted agreement for an user via script? (e.g. when the agreement or some data changed) a) for optional agreements, e.g. reset the SEPA mandate agreement when a new IBAN is entered I found https://documentation.cyclos.org/current/ws-api-docs/org/cyclos/services/access/Ag...
by jakob.schumann
Wed Mar 24, 2021 4:53 am
Forum: Scripting & Webservices issues
Topic: Result for users search - missing fields
Replies: 4
Views: 469

Result for users search - missing fields

Hello, when using the endpoint GET /​users I have two problems: 1) is it somehow possible to return the status of the users? It is already possible to filter by more than one status but without the user status being in the resulting fields it is not possible to differentiate them. 2) What do I have ...
by jakob.schumann
Wed Mar 24, 2021 4:44 am
Forum: Scripting & Webservices issues
Topic: error with PUT users
Replies: 3
Views: 616

Re: error with PUT users

In https://forum.cyclos.org/viewtopic.php?t=2376 it says for "staleEntity": "MOBILE.GENERAL.error.staleEntity": "The data you are saving has been modified by another user or process. Please, reload the page and try again.", Maybe this can give you a hint on what is goin...
by jakob.schumann
Thu Jul 16, 2020 2:13 pm
Forum: Scripting & Webservices issues
Topic: How can i write log entries by a script?
Replies: 5
Views: 2428

Re: How can i write log entries by a script?

Thanks for the hint, but using errorLogService.create("PaymentService.preview", "test message", sessionData.channel, sessionData.loggedBasicUser) in a custom field validator causes There was an error while accessing the database to be displayed instead of the validators error mes...
by jakob.schumann
Thu Jul 16, 2020 1:39 pm
Forum: Scripting & Webservices issues
Topic: How can a script translate text?
Replies: 5
Views: 2287

Re: How can a script translate text?

Thanks, both variants are working! Just to be sure: So there is no way to translate e.g. a custom error message for a custom field validator via the translation files? Aren't there any multi-language cyclos installations that use scripts that generate messages? The only way would be to include all t...
by jakob.schumann
Fri Jul 10, 2020 6:36 am
Forum: Bug - problem reporting
Topic: Cyclos 4.13 error for POST /{user}/orders
Replies: 6
Views: 2456

Re: Cyclos 4.13 error for POST /{user}/orders

Ok, understood, it is not possible to use this endpoint for us. Still it is a bug: Expected result: 403 Access denied, with a permission error message Current result: an exception is thrown, user receives a 404 with response "{"entityType":"Order","key":"-2467...
by jakob.schumann
Fri Jul 03, 2020 11:22 am
Forum: Bug - problem reporting
Topic: Cyclos 4.13 error for POST /{user}/orders
Replies: 6
Views: 2456

Re: Cyclos 4.13 error for POST /{user}/orders

Thanks for your reply, here are the details: Are you submitting the request logged as the seller? No, not as buyer or seller but as third party. Does the seller has the permission 'Enable web shop ads'? Yes Does the buyer has the permission 'View web shop'? Yes Seller and buyer are visible to each o...
by jakob.schumann
Thu Jul 02, 2020 10:45 am
Forum: Bug - problem reporting
Topic: Cyclos 4.13 error for POST /{user}/orders
Replies: 6
Views: 2456

Cyclos 4.13 error for POST /{user}/orders

POSTing to the new REST endpoint /{user}/orders fails with the following exception: 2020-07-02T15:34:02.058+02:00 ERROR Webdienste <<IP>> Website <<domain>> OrderService submitToBuyer {"deliveryMethodName":"kein Versand nötig","seller":"klima_projekt_2","...
by jakob.schumann
Tue Jun 30, 2020 1:15 pm
Forum: Scripting & Webservices issues
Topic: How to access account balance & transactions
Replies: 2
Views: 2497

Re: How to access account balance & transactions

I figured the main part out using the accountService (running this code in Eclipse: https://gist.github.com/j-schumann/66f8529fc447146a88d5ccc995252b09) What I find curious is the behaviour of getAccountBalanceHistory (https://documentation.cyclos.org/4.13/scripting-api-docs/org/cyclos/services/bank...
by jakob.schumann
Mon Jun 29, 2020 5:29 am
Forum: Scripting & Webservices issues
Topic: Cyclos 4.13 error for POST /{user}/orders
Replies: 0
Views: 2261

Cyclos 4.13 error for POST /{user}/orders

Hello, with the new 4.13 I'm trying to use the new POST /{user}/orders endpoint, the parameters seem correct now. No more 422 Unprocessable Entity from missing elements, with e.g. {"properties":["deliveryAddress.zip"],"propertyErrors":{"deliveryAddress.zip" .....
by jakob.schumann
Mon Jun 29, 2020 5:21 am
Forum: Scripting & Webservices issues
Topic: How to debug in Eclipse?
Replies: 7
Views: 2863

Re: How to debug in Eclipse?

Thanks, after some further adaptions it's working now. Looking forward to 4.14 Still Eclipse asks me every time if I want to execute as groovy script/groovy shell/etc., it doesn't seem to remember which run configuration to use. Has anybody written unit tests for cyclos scripts and a framework showi...
by jakob.schumann
Wed Jun 10, 2020 3:44 am
Forum: Scripting & Webservices issues
Topic: custom login form in PHP / access Cyclos API from PHP
Replies: 1
Views: 2395

Re: custom login form in PHP / access Cyclos API from PHP

Hello! To receive a session token that can be used to redirect the user to cyclos or use as an auth mechanism via the API you can POST to /sessions and give the following as body parameters in JSON: user - login name/email/userid password remoteAddress - the IP the user used to access your PHP scrip...
by jakob.schumann
Tue Jun 09, 2020 5:53 am
Forum: Scripting & Webservices issues
Topic: How to access account balance & transactions
Replies: 2
Views: 2497

How to access account balance & transactions

Hello! For a scipt to calculate an account fee I need to access the accounts (current) balance or better: The balance at the start or end of a given month (for the edge case when a transaction was already made in the new month, before the account fee was processed). I only found account.getClosedAcc...