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');
	}
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...