laravel / cashier-mollie

MIT License
376 stars 63 forks source link

Comma-separated list of first payment method in config #204

Open mmachatschek opened 4 years ago

mmachatschek commented 4 years ago

It is not possible to add a comma-separated list for the first payment method in the config. The comment says it is possible but not handled correctly in the code.

[
        /**
         * A comma-separated list of allowed Mollie payment methods for the first payment. Make sure the methods are
         * enabled in the Mollie dashboard. Set to NULL to let Mollie handle this for you. Can be overridden per plan.
         * @example 'ideal,creditcard'
         */
        'method' => null,
]

Should the comment be updated or the code adapted accordingly?

sandervanhooft commented 4 years ago

Can you try passing an array?

mmachatschek commented 4 years ago

@sandervanhooft The plan model only accepts a string as payment method. Passing a array will lead in a PHP error.

    /**
     * @param string $firstPaymentMethod
     * @return $this
     */
    public function setFirstPaymentMethod(?string $firstPaymentMethod)
    {
        $this->firstPaymentMethod = $firstPaymentMethod;

        return $this;
    }
chris-redbeed commented 4 years ago

I create a small PR for this: https://github.com/laravel/cashier-mollie/pull/210

sandervanhooft commented 4 years ago

Thanks @chris-redbeed !