谢谢你的建议。
我用了“截击”而且很有效。
final String urlStr = "https://****.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, urlStr,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Toast.makeText(StripeActivity.this,"SuccessToken",Toast.LENGTH_LONG).show();
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("VolleyErrorHere", error.toString());
}
}
){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<>();
params.put("stripeToken", token.getId());
params.put("amount", "120");
params.put("currency", "jpy");
params.put("description", "anyone");
return params;
}
}; // end of string Request