zwaldeck / mollie

Java framework to consume the Mollie API
Other
39 stars 37 forks source link

Missing feeRegion on MethodPricing #89

Closed nbokdam closed 1 year ago

nbokdam commented 1 year ago

I was trying to use the mollie client to retrieve all payment methods and their pricing. Pricing can differ per region, and therefore there's a feeRegionprovided by Mollie.

It would be nice if feeRegion is also included in the class be.woutschoovaerts.mollie.data.method.MethodPricing.

Sources MethodReponse specification: https://docs.mollie.com/reference/v2/methods-api/get-method#response

Code snippet of how I'm trying to use the logic:

    fun getAllPaymentMethods(): List<MolliePaymentMethodPricing> {
        val queryParams = QueryParams()
        queryParams["include"] = "pricing"

        return client.methods().listAllMethods(queryParams).embedded.let {
            MolliePaymentMethodPricing.fromMollieMethodResponse(it)
        }
    }
paulvaneijden commented 1 year ago

Thanks for the suggestion, however this is open source so anyone can contribute including you! if you're comfortable with that: feel free to submit this code to this project, by forking it into your own github account, push your changes in the code, and then create a merge request for us to review.

nbokdam commented 1 year ago

Thanks, I'll work on this today!

nbokdam commented 1 year ago

Created a PR: https://github.com/zwaldeck/mollie/pull/91