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 (Moderator: Dave Greenberg) »
  • Payment processor which posts data and redirect user.
Pages: [1]

Author Topic: Payment processor which posts data and redirect user.  (Read 399 times)

erik.johansson

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Drupal 7
  • MySQL version: 4
  • PHP version: 5
Payment processor which posts data and redirect user.
February 12, 2014, 11:51:48 pm
I have implemented a new payment processor for a contribution payment. The user fills his contact information in the first form as usual and after that the user comes to a confirmation page. When the user has reviewed the details and decides to continue with the contribution he/she should be redirected to an off-site payment page.
The user needs to post data such as merchant id and amount to the payment service page but the post array is empty. Does anybody have clue what I should do and is there some more in-depth documentation for payment processors? I've read documentation from these links:

https://wiki.civicrm.org/confluence/display/CRMDOC/Example+of+creating+a+payment+processor+extension
http://book.civicrm.org/developer/version/4.1/the-extensions-framework/payment-processors
http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Payment-Processor+Extension

Thanks.

erik.johansson

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Drupal 7
  • MySQL version: 4
  • PHP version: 5
Re: Payment processor which posts data and redirect user.
February 13, 2014, 12:08:51 am
This is how the code looks like in doTransferCheckout function.
Code: [Select]
    $url = rtrim($this->_paymentProcessor['url_site']);

    require_once 'HTTP/Request.php';

    $params = array(
      'method' => HTTP_REQUEST_METHOD_POST,
      'allowRedirects' => TRUE,
    );

    $request = new HTTP_Request($url, $params);

    foreach ($dibsParams as $key => $value) {
      $request->addPostData($key, $value);
    }

    $result = $request->sendRequest();

    if (PEAR::isError($result)) {
      CRM_Core_Error::fatal($result->getMessage());
    }
    CRM_Utils_System::redirect($request->getUrl());


    CRM_Utils_System::civiExit();

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Payment processor which posts data and redirect user.

This forum was archived on 2017-11-26.