从沙箱中的“格子链接”的onSuccess回调取回所选帐户数据时遇到一些麻烦。我以前收到过它,例如:
ImmutableMultiDict([('public_token', 'public-sandbox-44d92bb8-190a-4adc-a259-492a5043b8cb'), ('metadata[institution][name]', 'Chase'), ('metadata[institution][institution_id]', 'ins_3'), ('metadata[account][id]', 'GerJ5MG6DptkP7e9Dwq3UPJo71m4k7u1aVDxy'), ('metadata[account][name]', 'Plaid Checking'), ('metadata[account][type]', 'depository'), ('metadata[account][subtype]', 'checking'), ('metadata[account][mask]', '0000'), ('metadata[account_id]', 'GerJ5MG6DptkP7e9Dwq3UPJo71m4k7u1aVDxy'), ('metadata[accounts][0][id]', 'GerJ5MG6DptkP7e9Dwq3UPJo71m4k7u1aVDxy'), ('metadata[accounts][0][name]', 'Plaid Checking'), ('metadata[accounts][0][mask]', '0000'), ('metadata[accounts][0][type]', 'depository'), ('metadata[accounts][0][subtype]', 'checking'), ('metadata[accounts][1][id]', 'nZqvzrX9nKIBDkbynEZwSE3lbLy1Qbu6oa1VW'), ('metadata[accounts][1][name]', 'Plaid Saving'), ('metadata[accounts][1][mask]', '1111'), ('metadata[accounts][1][type]', 'depository'), ('metadata[accounts][1][subtype]', 'savings'), ('metadata[link_session_id]', '5f9f5937-661c-4080-b355-15f993158807'), ('metadata[public_token]', 'public-sandbox-44d92bb8-190a-4adc-a259-492a5043b8cb')])
不确定我可以进行哪些更改,这意味着我现在仅接收公共令牌数据,例如:
ImmutableMultiDict([('public_token', 'public-sandbox-eef26e8f-5e0c-4cf4-b861-fe6407d259ae')])
我的实现在使用Python / Flask的Plaid文档中已经相当成熟。任何帮助将不胜感激。
onSuccess: function(public_token, metadata) {
$.post('/get_access_token', {
public_token: public_token,
});
@app.route("/get_access_token", methods=['POST'])
@login_required
def get_access_token():
global access_token
print(request.form)