新的客户记录我有一个新的客户是谁退房,并希望他们的存储卡以备将来使用。如果我正确阅读documentation,我需要分别拨打电话给Stripe,一个用卡创建客户,另一个用来为卡充电。安卓:创建带区API
的问题是..有一种方式来创建新的客户记录成条纹由刚刚使用Android/Java的代码不使用任何后端服务器大小码,如PHP,Node.js的,等等?我在与文档的麻烦
原因说明here为Java。我试图按照文档,但可悲的是,代码将无法在我的Android项目中工作(即使我将它添加到build.gradle等)
我是新来的条纹,所以我不是那么有知识。
这是我试图跟随并适用于我的项目中的代码。
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.apiKey = "sk_test_ejKNr41rD0SbiNVxkZOcneG0";
// Token is created using Stripe.js or Checkout!
// Get the payment token submitted by the form:
String token = request.getParameter("stripeToken");
// Create a Customer:
Map<String, Object> customerParams = new HashMap<String, Object>();
customerParams.put("email", "[email protected]");
customerParams.put("source", token);
Customer customer = Customer.create(customerParams);
// Charge the Customer instead of the card:
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("amount", 1000);
chargeParams.put("currency", "eur");
chargeParams.put("customer", customer.getId());
Charge charge = Charge.create(chargeParams);
// YOUR CODE: Save the customer ID and other info in a database for later.
// YOUR CODE (LATER): When it's time to charge the customer again, retrieve the customer ID.
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("amount", 1500); // $15.00 this time
chargeParams.put("currency", "eur");
chargeParams.put("customer", customerId);
Charge charge = Charge.create(chargeParams);
我看到..感谢制作这一点。我只是想知道是否有一个Android选项。那么,我需要诉诸Node.js -_- –