1

对于客户,我需要为子客户在其网站上处理的每个订单收取申请费。整个代码都在使用身份验证和一切。但从我添加的那一刻起:

'applicationFee' => $applicationFee

我接到这个错误的电话:

执行 API 调用时出错(422:无法处理的实体):无法处理此帐户的应用程序请求。文档:https ://docs.mollie.com/guides/handling-errors “

“$applicationFee”的内容是正确的,我已经能够检查了。$shop_mollie_data->profile_id 包含在 Mollie 仪表板上找到的不同 websiteprofileId。

              $provider = new MollieConnectProvider($request, $clientId, $clientSecret, $redirectUrl);
              $newAccessToken = $provider->getRefreshTokenResponse($shop_mollie_data->refresh_token);

              $mollie = new MollieApiClient();
              $mollie->setAccessToken($newAccessToken['access_token']);

              $payment = $mollie->payments->create([
                'amount' => [
                  'currency' => 'EUR',
                  'value' => (string) (sprintf("%.2f", $order_total))
                ],
                'description' => ucfirst($shop->name) . ' - Order #' . $order_nm,
                'webhookUrl' => $url_callback,
                'redirectUrl' => $url_success,
                'method' => 'bancontact',
                'locale' => $language_id,
                'metadata' => [
                  "order_id" => $ref,
                  "shop id" => $shop->id
                ],
                'profileId' => $shop_mollie_data->profile_id,
                'testmode' => true,
                'applicationFee' => $applicationFee
              ]);
4

0 回答 0