1

Eway provides a way to add invoice ref and description by adding params like InvoiceDescription and InvoiceReference in alterPaymentProcessorParams hook provided by civicrm.

Unfortunately this does not work for recurring payments.

Eway does not seem to provide any flexibility to set Invoice reference or Invoice Description for a recurring payment. See the parameter that could be set - https://eway.io/api-v3/#recurring-payments.

Any thoughts for an alternative way to set these field values?

We are using Eway recurring extension to record payments in civi - https://civicrm.org/extensions/eway-recurring-payment-processor

3

1 Answer 1

2

ok - this has fixed for us and the reason was the incorrect param sent to the ProcessPayment operation. The correct way of sending the invoice params is -

$client = CRM_Core_Payment_EwayUtils::getClient($params['payment_processor_id']);
$endPoint = 'https://www.eway.com.au/gateway/managedpayment/ProcessPayment';

$paymentInfo = array(
  'man:managedCustomerID' => $params['managed_customer_id'],
  'man:amount' => $params['amount_in_cents'],
  'man:invoiceReference' => $params['invoice_id'],
  'man:invoiceDescription' => $params['description'],
);
$result = $client->call('man:ProcessPayment', $paymentInfo, '', $endPoint);

Note the correct usage of man:invoiceReference and man:invoiceDescription. It should be case-sensitive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.