我正在按照以下指南收费:https://stripe.com/docs/connect/shared-customers
1)商店客户:
Map<String, Object> params = new HashMap<>();
params.put("email", "paying.user@example.com");
params.put("source", "tok_visa");
Customer customer = Customer.create(params);
2)制作令牌:
Map<String, Object> params = new HashMap<String, Object>();
params.put("customer", customer.getId());
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{CONNECTED_STRIPE_ACCOUNT_ID}").build();
Token token = Token.create(params, requestOptions);`
3)创建费用:
Map<String, Object> params = new HashMap<>();
params.put("amount", 1000);
params.put("currency", "usd");
params.put("source", token.getId());
RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{CONNECTED_STRIPE_ACCOUNT_ID}").build();
Charge charge = Charge.create(params, requestOptions);`
收费创建成功。 但是,我尝试获取此客户的所有费用的清单时,却什么也没收到:
Map<String, Object> params = new HashMap<>();
params.put("customer", customer.getId());
Charge.list(params); //no charges in response
那么如何为以这种方式创建的该客户收取所有费用?
答案 0 :(得分:0)
您需要列出在关联帐户上创建的费用。意思是,您需要传递与创建费用相同的请求选项。
erase()