"You can create a script to convert all of your recurring subscriptions to a token using the CONVERT_PAYMENTTOPROFILE API using the legacy platform in order to create a token that can be used in Connect. Connect needs the payment information, either in raw form or as a token, for every transaction, which is why you would need to use the CONVERT_PAYMENTTOPROFILE API as opposed to using the tokens that you may already be using. "
The script takes one parameter for how many to run at once.
In vagrant in srv/org.wikimedia.civicrm/drupal run:
drush recurring-globalcollect-tokenize 1
Setup a recurring donation:
The script looks for donations in civicrm_contribution_recur that have the next_sched_contribution_date of now and a day before (UTC) with trxn_ids that have RECURRING GLOBALCOLLECT in them.
Creating a Globalcollect recurring:
Set up Globalcollect with the VPN through instructions here:
Testing without creating a Globalcollect recurring:
If you want to test the logic after the token is created, you can comment out lines 97-99 and set $token to an Ingenico token.
$token = '229a1d6e-1b26-4c91-8e00-969a49c9d041'
- The original globalcollect civicrm_contribution_recur is cancelled.
- A new Ingenico civicrm_contribution_recur is created.
- A token is created in civicrm_token that is tied to civicrm_contribution_recur.
- A payment is made in civicrm_contribution that is tied to the new Ingenico civicrm_contirbution_recur.
- The new Ingenico civicrm_contirbution_recur has a next_sched_contribution_date of a month from when the tool was run.