mollie / laravel-mollie

Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite
https://www.mollie.com/
MIT License
325 stars 62 forks source link

Error executing API call (request): The recurring payment method is inactive. #67

Closed Tjoosten closed 6 years ago

Tjoosten commented 6 years ago

Hi i can't process my payments. Because the recurring type is inactive. I've been looking in the docs for hours but can't find any solution. Can someone help me?

"Error": Error executing API call (request): The recurring payment method is inactive. "API version": 1.X

My code:

/**
     * Charge the payment in the Mollie payment provider
     *
     * @throws \Exception when we couldn't charge the payment in de payment gateway.
     *
     * @param  Backer $backer The data from the customer (backer) That comes out of the database.
     * @param  mixed $input The given user input. (validated)
     * @return Mollie_API_Object_Payment
     */
    public function chargePayment(Backer $backer, $input): Mollie_API_Object_Payment
    {
        $data = ['amount' => $input->plan, 'customerId'  => $backer->mollie_customer_id, 'recurringType' => 'first'];
        $paymentData = array_merge($data, [
            'description' => "Donatie Activisme_BE ({$input->plan}€)", 'redirectUrl' => route('support.index'), 'method' => $input->method, 
        ]);

        $transaction = Mollie::api()->payments()->create($paymentData);
        $this->storeTransactionLocal($transaction);

        return $transaction;
    }
sandervanhooft commented 6 years ago

Hi @Tjoosten ,

Are you using a test token / oAuth with testmode?

Also, what are the contents of $input?

sandervanhooft commented 6 years ago

You can use dd($input); at the top of the function to dump example content and paste them here.

sandervanhooft commented 6 years ago

For debugging, try setting

$paymentData['method'] = null;
// was $paymentData['method'] = $input->method;

Because some payment methods are not available for testing when using recurring payments.

Tjoosten commented 6 years ago

Hi i got no spare time atm. I will post the dd($input) later this evening/night

Tjoosten commented 6 years ago

@sandervanhooft hi sorry for the delay!

but dd($input); gives:

array:6 [▼
  "amount" => "7.00"
  "customerId" => "cst_ADrK77aaNT"
  "recurringType" => "first"
  "description" => "Description (7.00€)"
  "redirectUrl" => "http://localhost:8000/support"
  "method" => "belfius"
]
sandervanhooft commented 6 years ago

It's either because method belfius is not enabled for your website profile, and/or it isn't supported in test mode. Method ideal works fine for me.

@willemstuursma What do you think?

@Tjoosten also consider upgrading the client to the latest version so you can use the API v2. It offers improved error messages.

ndijkstra commented 6 years ago

This error is because SEPA Direct Debit is not enabled on the website profile. This payment method is needed for recurring payments via belfius for example.

Tjoosten commented 6 years ago

But i filed a review for met cliënt but mollie keep in rejecting the review. But my cliënt is a registered non profit Organization....

No offence but it is a little fustrating

ndijkstra commented 6 years ago

@Tjoosten I don't see a SEPA Direct Debit application for account 3705104. Can you contact Support about that? info@mollie.com or +31 20 8202070 / +32 2 588 21 86