Fundraising Tech/Donation Pipeline Setup

From mediawiki.org

Before you get too far down this list, see Installing the software stack on the fundraising tech team page, where we explain how to accomplish all of these things the easy way, with Vagrant.

Installing CRM[edit]

Clone the repo:

git clone https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm

cd crm

git submodule update --init

Once you have your virtual host setup and pointing to /path/to/crm/drupal, you can run through the installer for drupal to generate a settings.php file. Once it's created, you'll want to add these lines and fill in your usernames and passwords. You'll want to manually create the additional databases as well.

Then enable the modules and update the database:

drush pm-enable `cat sites/default/enabled_modules`

drush updb

Installing PaymentsWiki[edit]

Clone the repo

git clone https://gerrit.wikimedia.org/r/mediawiki/core

cd core

git checkout fundraising/REL1_27

git submodule update --init --recursive

cd skins

git clone https://git.wikimedia.org/git/mediawiki/skins/Vector.git

Once you have your virtual host pointing to the directory, you can run through the installer to get LocalSettings.php. Then add these lines to enable to correct extensions.

Payments Environment[edit]

Logging[edit]

rsyslog.d[edit]

If you are running your payments environment in ubuntu, we recommend setting up the log buckets in rsyslog.d in largely the same way we set them up on the payments cluster.

  • in /etc/rsyslog.d, create a file called 60-payments.conf
  • Insert the following code into 60-payments.conf
    #  Fundraising rules for rsyslog.
    #
    #                       For more information see rsyslog.conf(5) and /etc/rsyslog.conf
    #
    
    if ($syslogseverity <= 3) then /var/log/payments/error
    
    if ($programname contains '_payment_in') then /var/log/payments/initial
    &~
    
    if ($programname contains '_fraud') then /var/log/payments/fraud
    &~
    
    if ($programname contains 'globalcollect_gateway_co') then /var/log/payments/globalcollect_commstats
    &~
    
    if ($programname contains 'globalcollect_gateway') then /var/log/payments/globalcollect
    &~
    
    if ($programname contains 'adyen_gateway') then /var/log/payments/adyen
    &~
    
    if ($programname contains 'worldpay_gateway') then /var/log/payments/worldpay
    &~
    
    if ($syslogseverity == 7) then /var/log/payments/debug
    &~
    
    if ($programname contains 'payflowpro_gateway') then /var/log/payments/payflow
    &~
    
    if ($programname contains 'apache2') then /var/log/payments/apache2_errors
    &~
    
    if ($programname contains 'amazon_gateway') then /var/log/payments/amazon
    &~
    
    if ($programname contains '_gateway') then /var/log/payments/misc
    

Installing SmashPig[edit]

Manually create a database named 'smashpig' that your crm user can access. Run the scripts inside SmashPig's 'Schema' folder against the database.

To get tests passing install sqlite.

To test the IPN listener, set up a web site to serve the smashpig_http_handler.php from the PublicHttp folder of SmashPig.

Under nginx, with some convenient shortcuts:

server {
    listen 80;
    server_name smashpig.dev;
    index smashpig_http_handler.php
    access_log /var/log/nginx/smashpig.access.log;
    error_log /var/log/nginx/smashpig.error.log;
    root /path/to/SmashPig/PublicHttp;
    rewrite /adyen /smashpig_http_handler.php?p=adyen/listener  break;
    rewrite /amazon /smashpig_http_handler.php?p=amazon/listener  break;
    rewrite /astropay /smashpig_http_handler.php?p=astropay/listener  break;
    rewrite /globalcollect /smashpig_http_handler.php?p=globalcollect/listener  break;
    rewrite /paypal /smashpig_http_handler.php?p=paypal/listener  break;
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    location /atest {
        alias /path/to/SmashPig/PaymentProviders/Amazon/Tests/manual;
    }
}

Test Data[edit]

git clone https://gerrit.wikimedia.org/r/wikimedia/fundraising/dash

cd dash/test_data

Note: These scripts assume your databases are named drupal and civicrm.

CentralNotice[edit]

Installation is documented here.