cashier-mollie icon indicating copy to clipboard operation
cashier-mollie copied to clipboard

Comma-separated list of first payment method in config

Open mmachatschek opened this issue 5 years ago • 4 comments

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?

mmachatschek avatar May 05 '20 15:05 mmachatschek

Can you try passing an array?

sandervanhooft avatar May 05 '20 15:05 sandervanhooft

@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;
    }

mmachatschek avatar May 05 '20 16:05 mmachatschek

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

chris-redbeed avatar May 11 '20 21:05 chris-redbeed

Thanks @chris-redbeed !

sandervanhooft avatar Jun 11 '20 13:06 sandervanhooft