如何从android中的braintree获取现有的付款方式?

时间:2016-08-06 20:31:18

标签: android python http payment braintree

我有一个android客户端,它会调用一个烧瓶python服务器,如下所示:

public void getCustomerPaymentMethods() {
    Uri.Builder builder = new Uri.Builder()
            .scheme("http")
            .authority("www.server.appspot.com")
            .appendPath("get_customer_payment_methods")
            .appendPath(mCustomerId);

    String url = builder.build().toString();

    AsyncHttpClient client = new AsyncHttpClient();
    client.get(url, new BaseJsonHttpResponseHandler<List<>>() {
        @Override
        public void onSuccess(int statusCode, Header[] headers, String rawJsonResponse, List<> response) {
        }

        @Override
        public void onFailure(int statusCode, Header[] headers, Throwable throwable, String rawJsonData, List<> errorResponse) {
            // Display UI for no payment methods
            mNoPaymentMethodImageView.setVisibility(View.VISIBLE);
            mAddPaymentMethodButton.setVisibility(View.VISIBLE);
        }

        @Override
        protected List<> parseResponse(String rawJsonData, boolean isFailure) throws Throwable {
            return null;
        }
    });
}

这是映射到提供的网址的服务器端代码:

@app.route('/get_customer_payment_methods/<cutomerId>')
def get_customer_payment_methods(customerId):
    result = braintree.Customer.find(customerId)
    return result.payment_methods

我有什么对象来保存客户端python服务器的响应?

0 个答案:

没有答案