mollie / laravel-mollie

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

Unknown parameter profileId when creating payment with application fee. #148

Closed voicecode-bv closed 4 years ago

voicecode-bv commented 4 years ago

According to the Mollie documentation we should add a profileId when creating a payment with application fee enabled. When adding this parameters an error is thrown. Am I missing something here? The application fee has been enabled for my account.

Error executing API call (422: Unprocessable Entity): Non-existent body parameter "profileId" for this API call.
$payment = Mollie::api()->payments->create([
        'applicationFee' => [
            'amount' => [
                'currency' => 'EUR',
                'value' => '1.00',
            ],
            'description' => 'Application Fee',
        ],
        'profileId' => $campaign->mollieProfile->mollie_id,
        'amount' => [
            'currency' => 'EUR',
            'value' => '10.00',
        ],
        'description' => 'Order #12345',
        'redirectUrl' => route('order.success'),
        'webhookUrl' => route('webhooks.mollie'),
        'metadata' => [
            'order_id' => '12345',
        ],
]);
MollieRick commented 4 years ago

Hi @voicecode-bv ,

This is only possible with an OAuth Token, not an API Key. What kind of key do you use?

voicecode-bv commented 4 years ago

Hi @MollieRick,

Thanks for pointing me in the right direction. I'm using the API key, so I'll give OAuth a try. 👍🏼

MollieRick commented 4 years ago

Good to hear. Feel free to reopen this issue if you have any other troubles :-)