Что-то пошло не так, произошла внутренняя ошибка.
Я не знаю, что делать и как это исправить.

Вот что я пробовал использовать JavaScript во внешнем интерфейсе.
Link Bank Account
var linkHandler = Plaid.create({
clientName: '',
env: '', // or 'development' or 'production' based on your environment
key: '', // Replace with your Plaid public key
product: ['balance'], // or other products like 'transactions', 'balance', etc.
onSuccess: function(public_token, metadata) {
console.log('Plaid Link success!');
console.log(public_token);
console.log(metadata);
// This is where you handle the success
// Send the public_token to your backend to exchange it for an access_token
fetch('/admin/api/plaid.php', {
method: 'POST',
body: JSON.stringify({
public_token: public_token
}),
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log('Access token received:', data.access_token);
});
},
onExit: function(err, metadata) {
console.log('Plaid Link exited');
console.log(err, metadata);
}
});
document.getElementById('link-button').onclick = function() {
console.log('Button clicked, opening Plaid Link...');
linkHandler.open();
};
Вот файл, который пытается получить plaid.php
Я не уверен, связано ли это с ошибкой или нет.
Мне не удалось найти много документации по Plaid и PHP.
Когда я позвонил в Plaid, они мне не помогли. >
require 'vendor/autoload.php';
use TomorrowIdeas\Plaid\Plaid;
$plaid = new Plaid(
\getenv("PLAID_CLIENT_ID"),
\getenv("PLAID_CLIENT_SECRET"),
\getenv("PLAID_ENVIRONMENT")
);
// Get the public_token from the request body
$data = json_decode(file_get_contents('php://input'), true);
$public_token = $data['public_token'];
try {
$response = $plaid->items->get("access_token");
print_r($response);
} catch (\TomorrowIdeas\Plaid\PlaidRequestException $e) {
echo "Error: " . $e->getMessage() . "\n";
var_dump($e); // Inspect the exception object for available properties
}
$item = $plaid->items->get("itm_1234");
exit();
Подробнее здесь: https://stackoverflow.com/questions/793 ... orrowideas
Мобильная версия