picqer / moneybird-php-client

PHP Client for Moneybird V2
MIT License
82 stars 77 forks source link

Add support for Moneybird Payments Mandate #267

Open holtkamp opened 2 years ago

holtkamp commented 2 years ago

As of 12-04-2022 the Moneybird API added the /moneybird_payments_mandate resource on a contact.

This allows to request and delete Moneybird Payment mandates for Contacts.

Currently this can be accessed like this:

$contactId = '123456789';
$contact = $apiClient->contact();
$paymentsMandate = $contact->connection()->get($contact->getEndpoint() . '/' . $contactId. '/moneybird_payments_mandate');

It would be nice if this API Client would offer a this "out-of-the-box".

I could try to come up with a PR.

What would be the best approach?

Simplest approach seems to be add a new method: \Picqer\Financials\Moneybird\Entities\Contact::getPaymentsMandate(): ?array, but I am not sure whether that is the proper approach...

mbardelmeijer commented 1 year ago

Would be interested in this as well :)