Hi there,
Is it possible to make a payment from one system account to another via the Payment webservice?
Ie something like this:
doPayment( amount = 10,
fromSystem = True,
toSystem = True,
currency= 'X',
transferTypeId=31)
Ie - with no fromMember or toMember set?
The transfer type is a transaction type in cyclos which is for a system to system account payment in the specified currency which has been set up to be shown in the list of transaction types for the webservice channel in question.
I have debugged the running cyclos 3.7.3 code and i cannot see any transfer types listed when the initial query for possible transfer types is made. Is this a conscious decision or something i'm missing?
Many thanks,
Stephen
[Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web services
Moderators: hugo, alexandre, rmvanarkel
-
- Posts: 22
- Joined: Fri Sep 21, 2012 11:41 am
[Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web services
Max Gate Digital Ltd
Consultancy - Projects - Services - Research
Consultancy - Projects - Services - Research
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web servi
Hi.
It is possible, but there is a bug on web service client creation that doesn't lists transfer types from system to system.
So, you first have to save the web service client, then the transfer types which are available for the selected channel will show up.
Also, make sure that the service client is not restricted to a member.
It is possible, but there is a bug on web service client creation that doesn't lists transfer types from system to system.
So, you first have to save the web service client, then the transfer types which are available for the selected channel will show up.
Also, make sure that the service client is not restricted to a member.
Luis Fernando Planella Gonzalez
Cyclos development team
Cyclos development team
-
- Posts: 22
- Joined: Fri Sep 21, 2012 11:41 am
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web servi
The system to system transfer type is being listed in the 'Perform payments' list, and i have it selected. That wasn't the issue i was asking about.
The problem i have is that when i try and use this transfer type to make a payment, I am getting an 'INVALID PARAMETERS' response. I'm not sure which parameter is invalid, as the error doesn't contain that information.
Which parameters are needed to make a system to system account transfer via webservices? is it just the following:
amount = 10.0
fromSystem = True
toSystem = True
currency = '<currency SYMBOL>'
transferTypeId = 31
[ where 31 is the id of the system to system transaction type, and <currency symbol> is X or Y or GBP etc? ]
The problem i have is that when i try and use this transfer type to make a payment, I am getting an 'INVALID PARAMETERS' response. I'm not sure which parameter is invalid, as the error doesn't contain that information.
Which parameters are needed to make a system to system account transfer via webservices? is it just the following:
amount = 10.0
fromSystem = True
toSystem = True
currency = '<currency SYMBOL>'
transferTypeId = 31
[ where 31 is the id of the system to system transaction type, and <currency symbol> is X or Y or GBP etc? ]
Max Gate Digital Ltd
Consultancy - Projects - Services - Research
Consultancy - Projects - Services - Research
-
- Posts: 22
- Joined: Fri Sep 21, 2012 11:41 am
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web servi
ok - i've got the error message:
"INVALID_PARAMETERS. Reason: The service client doesn't have permission to the specified transfer type: 31 - ..."
I have the transfer type selected on the web services client screen - so should this work?
"INVALID_PARAMETERS. Reason: The service client doesn't have permission to the specified transfer type: 31 - ..."
I have the transfer type selected on the web services client screen - so should this work?
Max Gate Digital Ltd
Consultancy - Projects - Services - Research
Consultancy - Projects - Services - Research
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web servi
Hi,
I have the same issue. Cyclos 3.7.3 web service does not support "Self payments" system-to-system.
I haven't found any easy solution for this, so I updated Cyclos itself.
and
Regards,
Justas
I have the same issue. Cyclos 3.7.3 web service does not support "Self payments" system-to-system.
I haven't found any easy solution for this, so I updated Cyclos itself.
Code: Select all
diff --git a/cyclos_3.7.3/src/nl/strohalm/cyclos/services/transactions/PaymentServiceImpl.java b/cyclos_3.7.3/src/nl/strohalm/cyclos/services/transactions/PaymentServiceImpl.java
index fe5af80..79f2b0f 100644
--- a/cyclos_3.7.3/src/nl/strohalm/cyclos/services/transactions/PaymentServiceImpl.java
+++ b/cyclos_3.7.3/src/nl/strohalm/cyclos/services/transactions/PaymentServiceImpl.java
@@ -1592,10 +1592,9 @@ public class PaymentServiceImpl implements PaymentServiceLocal {
final Validator validator = new Validator("transfer");
Collection<TransactionContext> possibleContexts = new ArrayList<TransactionContext>();
possibleContexts.add(TransactionContext.PAYMENT);
+ possibleContexts.add(TransactionContext.SELF_PAYMENT);
if (LoggedUser.isWebService() || LoggedUser.isSystem()) {
possibleContexts.add(TransactionContext.AUTOMATIC);
- } else {
- possibleContexts.add(TransactionContext.SELF_PAYMENT);
}
validator.property("context").required().anyOf(possibleContexts);
validator.property("to").required().key("payment.recipient");
Code: Select all
diff --git a/cyclos_3.7.3/src/nl/strohalm/cyclos/webservices/utils/PaymentHelper.java b/cyclos_3.7.3/src/nl/strohalm/cyclos/webservices/utils/PaymentHelper.java
index 851dc92..e0132b6 100644
--- a/cyclos_3.7.3/src/nl/strohalm/cyclos/webservices/utils/PaymentHelper.java
+++ b/cyclos_3.7.3/src/nl/strohalm/cyclos/webservices/utils/PaymentHelper.java
@@ -19,22 +19,11 @@
*/
package nl.strohalm.cyclos.webservices.utils;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
import nl.strohalm.cyclos.entities.access.Channel;
import nl.strohalm.cyclos.entities.accounts.AccountOwner;
import nl.strohalm.cyclos.entities.accounts.MemberAccount;
import nl.strohalm.cyclos.entities.accounts.fees.transaction.TransactionFee;
-import nl.strohalm.cyclos.entities.accounts.transactions.PaymentRequestTicket;
-import nl.strohalm.cyclos.entities.accounts.transactions.Transfer;
-import nl.strohalm.cyclos.entities.accounts.transactions.TransferQuery;
-import nl.strohalm.cyclos.entities.accounts.transactions.TransferType;
-import nl.strohalm.cyclos.entities.accounts.transactions.TransferTypeQuery;
+import nl.strohalm.cyclos.entities.accounts.transactions.*;
import nl.strohalm.cyclos.entities.customization.fields.PaymentCustomField;
import nl.strohalm.cyclos.entities.customization.fields.PaymentCustomFieldValue;
import nl.strohalm.cyclos.entities.exceptions.EntityNotFoundException;
@@ -65,17 +54,15 @@ import nl.strohalm.cyclos.utils.validation.ValidationException;
import nl.strohalm.cyclos.webservices.WebServiceContext;
import nl.strohalm.cyclos.webservices.model.FieldValueVO;
import nl.strohalm.cyclos.webservices.model.TransactionFeeVO;
-import nl.strohalm.cyclos.webservices.payments.AbstractPaymentParameters;
-import nl.strohalm.cyclos.webservices.payments.AccountHistoryParams;
-import nl.strohalm.cyclos.webservices.payments.PaymentParameters;
-import nl.strohalm.cyclos.webservices.payments.PaymentStatus;
-import nl.strohalm.cyclos.webservices.payments.RequestPaymentParameters;
-
+import nl.strohalm.cyclos.webservices.payments.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.springframework.dao.DataIntegrityViolationException;
+import java.math.BigDecimal;
+import java.util.*;
+
/**
* Helper class for web services payments<br>
* <b>WARN</b>: Be aware that this helper <b>doesn't</b> access the services through the security layer. They are all local services.
@@ -110,7 +97,7 @@ public class PaymentHelper {
// First, we need a list of existing TTs for the payment
final TransferTypeQuery query = new TransferTypeQuery();
query.setResultType(ResultType.LIST);
- query.setContext(TransactionContext.PAYMENT);
+ query.setContext(dto.getContext());
query.setChannel(channel);
query.setFromOwner(dto.getFrom());
query.setToOwner(dto.getTo());
Justas
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web servi
Hi,stephendwolff wrote:ok - i've got the error message:
"INVALID_PARAMETERS. Reason: The service client doesn't have permission to the specified transfer type: 31 - ..."
I have the transfer type selected on the web services client screen - so should this work?
I have exactly the same issue. Did you find a solution ? (I mean, other that modifying the code of Cyclos as suggested by Justas)
Regards,
Xebax
-
- Posts: 22
- Joined: Fri Sep 21, 2012 11:41 am
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web servi
Hi Xebax,
I think we used a work around in the end - whereby the system account we needed to use, we made a member account, with a single user.
I've some experience with customising the source code, but this wasn't a bug we decided to address when the work around worked well for us.
Hope this fits your use case!
Cheers,
Stephen
I think we used a work around in the end - whereby the system account we needed to use, we made a member account, with a single user.
I've some experience with customising the source code, but this wasn't a bug we decided to address when the work around worked well for us.
Hope this fits your use case!
Cheers,
Stephen
Max Gate Digital Ltd
Consultancy - Projects - Services - Research
Consultancy - Projects - Services - Research
-
- Posts: 3
- Joined: Tue Nov 12, 2019 10:01 am
Re: [Cyclos 3.7.3] Making Sys Ac to Sys Ac pmt via web services
Right now I have same problem on this version.
But it's System to Member transfer which is another type than you metioned.
But it's System to Member transfer which is another type than you metioned.