Download Cyclos 4 PRO Documentation
Transcript
switch (owner.group.internalName) {
case 'business':
prefix += '1'
break
case 'consumer':
prefix += '2'
break
default:
prefix += '9'
}
} else {
prefix += '0'
}
return prefix + "/" + RandomStringUtils.randomNumeric(7)
4.3. Solutions using scripts
Examples of solutions that require a single script can be found directly in the specific script
description page (links directly above). Solutions that need several scripts and configurations
can be found in this section.
PayPal Integration
It is possible to integrate Cyclos with PayPal, allowing users to buy units with their PayPal
account. This is done with a custom operation which allows users to confirm the payment
in PayPal and then, once the payment is confirmed, a payment from a system account
is performed to the corresponding user account, automating the process of buying units.
However, keep in mind the rates charged by PayPal, which vary according to some conditions.
To do so, first you'll need a PayPal premium or business account (for testing – using PayPal
sandbox – any account is enough). You'll need to go to the PayPal Developer page to create
an application, and get the client id and secret.
Then several configurations are required in Cyclos. Scripts can only be created as global
administrators switched to a network, so it is advised to use a global admin to perform the
configuration. Carefully follow each of the following steps:
Check the root URL
Make sure that the configuration for users use a correct root url. In System > System
configuration > Configurations, select the configuration set for users and make sure the Main
URL field points to the correct external URL. It will be used to generate the links which will be
sent to PayPal redirect users back to Cyclos after confirming / canceling the operation.
Enable transaction number in currency
This can be checked under System > Currencies select the currency used for this operation,
mark the Enable transfer number option and fill in the required parameters.
Cyclos 4 PRO Documentation
64