CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Integrate with current Worldpay donations process
Pages: [1]

Author Topic: Integrate with current Worldpay donations process  (Read 688 times)

badlydrawnben

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: n/a
  • CMS version: Drupal 7
  • MySQL version: latest
  • PHP version: latest
Integrate with current Worldpay donations process
November 28, 2012, 02:45:00 am
Hi,

I work for a small UK charity. We don't use CiviCRM at the moment. Our donations are processed via Worldpay -  its callback script inserts a record into a Donations table in our Drupal database. There doesn't seem to be a working Worldpay option in the list of built-in payment preprocessors.

I'm just wondering if it's relatively easy to amend the code below so that it inserts a record into CiviContribute instead (and can still fire off an email autoresponder.)

   // Insert transaction details into the database.
         $query = db_insert('donations')
            ->fields(array(
               'trans_id' => check_plain($_POST['transId']),
               'trans_time' => $timestamp,
               'trans_status' => check_plain($_POST['transStatus']),
               'trans_ip' => check_plain($_POST['ipAddress']),
               'currency' => check_plain($_POST['currency']),
               'amount' => check_plain($_POST['amount']),
               'funding' => check_plain($_POST['MC_fund']),
               'gift_aid' => $giftaid,
               'newsletter' => $newsletter,
               'title' => check_plain($_POST['MC_title']),
               'first_name' => check_plain($_POST['MC_firstname']),
               'last_name' => check_plain($_POST['MC_lastname']),
               'email' => check_plain($_POST['email']),
               'address_one' => check_plain($_POST['address1']),
               'address_two' => check_plain($_POST['MC_address2']),
               'address_three' => check_plain($_POST['MC_address3']),
               'town' => check_plain($_POST['town']),
               'county' => check_plain($_POST['MC_county']),
               'country' => check_plain($_POST['country']),
               'postcode' => check_plain($_POST['postcode']),
               'phone' => check_plain($_POST['MC_phone']),
               'yearofbirth' => check_plain($_POST['MC_yearofbirth']),
               'testMode' => check_plain($_POST['testMode']),
               'datetime' => date('Y-m-d G:i:s', $timestamp),
            ))
            ->execute();

Possibe?
Good idea/Bad idea?

Thanks,

Ben

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Integrate with current Worldpay donations process
November 28, 2012, 07:05:34 am

yes, it should be relatively easy to take the below DB query and convert it into a series of Civi API calls (or one chained API call)

might want to check the api documentation and see how that query maps to various civi objects

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Integrate with current Worldpay donations process
March 25, 2013, 01:55:42 pm
did anything come of this?

A client is looking at using Ammado which afaik is primarily using WorldPay for swiping credit cards
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Integrate with current Worldpay donations process

This forum was archived on 2017-11-26.