Jump to content

Recommended Posts

Posted

Hi,

How do I get the related billing contact from a contact id?

I'm in this method from NonmerchantGateway class:

public function buildProcess(array $contact_info, $amount, array $invoice_amounts=null, array $options=null) {}

 

$contact_info always have the current logged-in contact, I need the data of the billing contact.

Thanks.

Posted

You can use the client ID to fetch the billing contacts, e.g.

<?php
public function buildProcess(array $contact_info, ...)
{
	Loader::loadModels($this, ['Contacts']);

  	if ($this->ifSet($contact_info['client_id'])) {
		// Fetch all billing contacts for this client
		$billing_contacts = $this->Contacts->getAll($contact_info['client_id'], 'billing');
	}
}

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...