alekstrust Posted January 24, 2019 Report Share Posted January 24, 2019 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. Quote Link to comment Share on other sites More sharing options...
Tyson Posted January 24, 2019 Report Share Posted January 24, 2019 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'); } } alekstrust and activa 2 Quote Link to comment Share on other sites More sharing options...
alekstrust Posted January 29, 2019 Author Report Share Posted January 29, 2019 Awesome. That was easy. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.