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) »
  • Multiple payment processor
Pages: [1]

Author Topic: Multiple payment processor  (Read 1854 times)

liveforfun

  • Guest
Multiple payment processor
March 30, 2010, 10:04:35 pm
Hi, All,

We want to seperate domestic and foreign contributions.
Is it possible to use one payment processor to handle domestic contribution and another one to deal with foreign contribution, say one from Europe using Euro?
Any thought is welcome. Thanks in advance for your help.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Multiple payment processor
March 31, 2010, 06:16:31 am
you can set up multiple payment processors on the site and choose which one on a per-event/contrib/membership basis. if you want to use multiple payment processors on one event then i think you'd have to write the code to make the backend deal with that, either via hack or by writing a new payment processor to deal with this type of scenario.

liveforfun

  • Guest
Re: Multiple payment processor
April 05, 2010, 11:27:10 am
Emilyf,

Thanks a lot for your advice.
I'm contemplating on using Paypal Website Payments Pro and writing a new payment processor to deal with my problem.
Could you advice which files I should look into for current Paypal Website Payments Pro plugin?
I believe there is an available plugin for Paypal WPP but I don't know which files is used?
I found the following php file that are related to Paypal but I'm not sure about it. Need your kindly advice. Thanks a lot.

~/civicrm/CRM/Core/Payment
PayPalProIPN.php
PayPalIPN.php
PayPalImpl.php

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: Multiple payment processor
April 05, 2010, 02:06:31 pm

you've found the right directory and files.

might also want to read: http://wiki.civicrm.org/confluence/display/CRMDOC/Creating+Additional+Payment+Processor+Plugins

thanx

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Multiple payment processor
April 05, 2010, 02:24:59 pm
If your payment processor can handle multiple currency you might be able to use the payment processor hook to adjust the currency field being sent in the XML to the payment processor
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

liveforfun

  • Guest
Re: Multiple payment processor
April 06, 2010, 12:50:47 pm
Thanks for all your advice.

Eileen,
is the following function the hook you mentioned?
CRM_Utils_Hook::alterPaymentProcessorParams

Since Paypal website payments pro only support one currency per account.
We are considering use two account accepting contribution, one for USD and one for GBP.
Is it possible to use the hook to change payment processor settings, such as signature, username, password, API URL, recurring payment URL and so on?


liveforfun

  • Guest
Re: Multiple payment processor
April 21, 2010, 12:41:41 pm
It turned out that I used three payment processors for EUR, GBP and USD and all the code were from PayPalImpl.php.
So that users can choose payment processors based on currency.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Multiple payment processor
April 21, 2010, 12:42:57 pm
Can you post your code here / elaborate on what you did for others?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

liveforfun

  • Guest
Re: Multiple payment processor
April 22, 2010, 10:09:20 am
1. I created three payment processors based on PayPalImpl.php and changed currencyCode field to EUR, GBP, and USD

Quote
    function doDirectPayment( &$params, $component = 'contribute' ) {
        $args = array( );

        $this->initialize( $args, 'DoDirectPayment' );

        $args['paymentAction']  = $params['payment_action'];
        $args['amt']            = $params['amount'];
        $args['currencyCode']   = "EUR";
        $args['invnum']         = $params['invoiceID'];
        $args['ipaddress']      = $params['ip_address'];
        $args['creditCardType'] = $params['credit_card_type'];
        $args['acct']           = $params['credit_card_number'];
        $args['expDate']        = sprintf( '%02d', $params['month'] ) . $params['year'];
...

2. Insert one record for each payment processor to table "civicrm_payment_processor_type" in database

Quote
INSERT INTO `civicrm_payment_processor_type` (`name`, `title`, `description`, `is_active`, `is_default`, `user_name_label`, `password_label`, `signature_label`, `subject_label`, `class_name`, `url_site_default`, `url_api_default`, `url_recur_default`, `url_button_default`, `url_site_test_default`, `url_api_test_default`, `url_recur_test_default`, `url_button_test_default`, `billing_mode`, `is_recur`) VALUES ('Paypal-EUR', 'PayPal - Website Payments Pro for EUR', 'PayPal - Website Payments Pro for EUR', 1, 0, 'User Name', 'Password', 'Signature', NULL, 'Payment_PayPalImplEUR',  'https://www.paypal.com/', 'https://api-3t.paypal.com/','https://www.paypal.com/', 'https://www.paypal.com/en_US/i/btn/btn_xpressCheck', 'https://www.sandbox.paypal.com/', 'https://api-3t.sandbox.paypal.com/', 'https://www.sandbox.paypal.com/', 'https://www.paypal.com/en_US/i/btn/btn_xpressCheck', 3, 1);


3. Configure username, password and signature for each payment processor in CiviCRM

In this way, each payment processor handles transactions in one currency and routes money to one merchant account. So you can actually have three payment processors, each links to different merchant accounts, no matter it's domestic or international. And you can also choose different currency for contribution page or event using different payment processors.

This may not the best way to do it. But I think it's the fastest way to do it. ^^


AudreyKate

  • I post occasionally
  • **
  • Posts: 33
  • Karma: 1
  • CiviCRM version: 3.4.4
  • CMS version: Drupal 6.24
Re: Multiple payment processor
February 21, 2011, 09:37:55 pm
I know I'm hopping in on an old thread here, but this isn't working for me at all. I created the new processor, hard-coded the other currency into it (CAD), got it working, it sends payments to PayPal and processes them perfectly -- in US Dollars. Is there something I'm missing? Another place that the currency is being set that would be overriding what's in the processor I've created?

(Shoot. May have to learn to implement hooks.)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Multiple payment processor

This forum was archived on 2017-11-26.