Page MenuHomePhabricator

Create script to migrate existing GlobalCollect recurring payments to Connect tokens
Closed, ResolvedPublic4 Estimated Story Points

Description

"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. "

Testing:

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:
https://www.mediawiki.org/wiki/Fundraising_tech/Testing#GlobalCollect_(Legacy_Ingenico)

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'

Expected results:
  • 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.

Event Timeline

Ejegg triaged this task as Medium priority.Jul 11 2017, 7:59 PM
Ejegg moved this task from Triage to Next on the Fundraising-Backlog board.
Ejegg set the point value for this task to 4.

Change 421665 had a related patch set uploaded (by Ejegg; owner: Ejegg):
[mediawiki/extensions/DonationInterface@master] WIP API call to tokenize old GC recurring

https://gerrit.wikimedia.org/r/421665

Change 421665 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] API call to tokenize old GC recurring

https://gerrit.wikimedia.org/r/421665

Change 436188 had a related patch set uploaded (by Ejegg; owner: Ejegg):
[wikimedia/fundraising/crm@master] Update donation-interface library to 2.3.0

https://gerrit.wikimedia.org/r/436188

Change 436188 abandoned by Ejegg:
Update donation-interface library to 2.3.0

https://gerrit.wikimedia.org/r/436188

Change 582883 had a related patch set uploaded (by Ejegg; owner: Ejegg):
[wikimedia/fundraising/crm@master] WIP drush script to tokenize old recurring GC

https://gerrit.wikimedia.org/r/582883

Ejegg removed Ejegg as the assignee of this task.Mar 23 2020, 7:14 PM

Change 582883 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Drush script to tokenize old recurring GC

https://gerrit.wikimedia.org/r/582883

Change 602162 had a related patch set uploaded (by Cstone; owner: Cstone):
[wikimedia/fundraising/crm@master] Switch the params sent to getDateForNextMonth to now send a frequency_interval.

https://gerrit.wikimedia.org/r/602162

Change 602162 merged by Ejegg:
[wikimedia/fundraising/crm@master] Switch the params sent to getDateForNextMonth to now send a frequency_interval.

https://gerrit.wikimedia.org/r/602162