mollie / mollie-api-php

Mollie API client for PHP
http://www.mollie.com
BSD 2-Clause "Simplified" License
552 stars 191 forks source link

Include an example on how to apply ApplicationFees #57

Closed holtkamp closed 7 years ago

holtkamp commented 7 years ago

This part of the documentation indicates that some additional parameters are required when creating a Payment that involves an application fee:

https://www.mollie.com/en/docs/reference/payments/create#pfp-params

The applicationFee parameter should be an object. However, when creating the Payment an associative array should be provided:

/* @var \Mollie_API_Client @apiClient */
$apiClient->payments->create($paymentAsAnAssociativeArray);

An example on expected way to cast the object to an array (I think this is the approach?) would be nice to add to add to https://github.com/mollie/mollie-api-php/blob/master/examples/10-oauth-new-payment.php

willemstuursma commented 7 years ago

In PHP, you can create the object as an associative array. Since JSON does not have any associative arrays, it will be cast to an object.

holtkamp commented 7 years ago

😄 , I understand. However, an example might be nice. When searching this repository for applicationFee it is not mentioned once:

https://github.com/mollie/mollie-api-php/search?utf8=%E2%9C%93&q=applicationFee

Just my 2 cents to help you guys improve technical communication towards developers researching Mollie's services...