Fundraising tech/Queue testing

From MediaWiki.org
Jump to navigation Jump to search

First steps for all[edit]

  • CentralNotice banner or donatewiki (later)
  • submit donation form, which adds messages to pending and pending-new queue
/vagrant$ redis-cli monitor | grep RPUSH   # watch for new messages being pushed to Redis
    • Works for Amazon as long as you are using https (vagrant roles enable https), returnURL is https://payments.wiki.local.wmftest.net:4430/w/index.php?title=Special:AmazonGateway and you are in test mode. Need to use test accounts from Amazon payments console
    • Mirroring to pending-new queue requires https://gerrit.wikimedia.org/r/#/c/299797/3 , just merged
    • AstroPay: need VPN, and need to use credit card 'GNB', only enabled for BR when $wgAstroPayGatewayTest = true 
      • Name: ASTROPAY TESTING
      • Cpf: 00003456789
      • Email: testing@astropaycard.com
  • Consume pending-new to db
/vagrant/srv/SmashPig$ php Maintenance/ConsumePendingQueue.php
  • consume antifraud queue messages
drush --user=1 -v -r /vagrant/srv/org.wikimedia.civicrm/drupal fqc

Adyen[edit]

( To test Redis job queue, make data-store/jobs config look like data-store/pending-new, with queue name changed to 'jobs', and replace StompJobRunner.php below with QueueJobRunner.php )

  • Create fake IPN messages matching pending queue messages
/vagrant/srv/SmashPig$ php Maintenance/CreateIpnMessagesFromPendingDb.php adyen
  • Simulate auth IPN listener hits
/vagrant/srv/SmashPig$ Tests/SoapInjector/soapinject.py payments-listener.local.wmftest.net '/smashpig_http_handler.php?p=adyen/listener' auth_success.10.1.xml
  • run JobRunner to perform mock capture requests and send more antifraud queue messages
    • You can set your SmashPig.yaml to use a mock API endpoint to avoid hitting even the adyen test system, see PaymentProviders/Adyen/Tests/config_test_success.yaml
/vagrant/srv/SmashPig$ php Maintenance/StompJobRunner.php --config-node adyen
  • consume antifraud queue messages
drush --user=1 -v -r /vagrant/srv/org.wikimedia.civicrm/drupal fqc
  • Simulate capture IPN listener hits
/vagrant/srv/SmashPig/Tests$ ./soapinject.py payments-listener.local.wmftest.net '/smashpig_http_handler.php?p=adyen/listener' ../../adyen-12345-captures.xml
  • run JobRunner to combine pending messages and send to completed queue
/vagrant/srv/SmashPig$ php Maintenance/StompJobRunner.php --config-node adyen

Amazon[edit]

  • Create fake IPN messages matching pending queue messages
/vagrant/srv/SmashPig$ php Maintenance/CreateIpnMessagesFromPendingDb.php amazon
  • Simulate capture completed IPN listener hit - listener will add completed queue message with indication to look in pending queue for missing details
    • Maybe need to create a MockIpnHandler
/vagrant/srv/SmashPig$ PaymentProviders/Amazon/Tests/inject.py payments-listener.local.wmftest.net '/smashpig_http_handler.php?p=amazon/listener' CaptureCompleted.7-0.json

AstroPay[edit]

  • Create fake IPN messages matching pending queue messages
/vagrant/srv/SmashPig$ php Maintenance/CreateIpnMessagesFromPendingDb.php --config-node astropay astropay
  • Simulate successful payment IPN listener hit - listener will add completed queue message with indication to look in pending queue for missing details
/vagrant/srv/SmashPig$ curl -d @success.37956.2.curl http://payments-listener.local.wmftest.net/smashpig_http_handler.php?p=astropay/listener

Ingenico[edit]

PayPal[edit]

  • Either mock the PP form, or immediately redirect back.  Probably something in-between, where we show diagnostics about the request and then a button to return successfully or cancel.

Last steps for all[edit]

  • Run donations queue consumer
drush --user=1 -v -r /vagrant/srv/org.wikimedia.civicrm/drupal qc
  • Run TY mail sender (is vagrant configured to fake email safely?)
drush eval --user=1 -v -r /vagrant/srv/org.wikimedia.civicrm/drupal 'drush_thank_you();'