代码之家  ›  专栏  ›  技术社区  ›  Pawan

用于在Apple IOS中取消应用内购买的URL

ios
  •  0
  • Pawan  · 技术社区  · 7 年前

    我正在使用Apple with Java以这种方式验证应用内购买

    public static void  validateProductPurhcaseReceipt(String receiptData, String VERIFICATION_URL)
        {
            Map outPut = new HashMap();
            HttpClient httpClient = new DefaultHttpClient();
            try {
                HttpPost request = new HttpPost(VERIFICATION_URL);
                JSONObject requestData = new JSONObject();
                requestData.put("receipt-data", receiptData);
                requestData.put("password", "f1ebdc2f49664d7188b4d83f90131ecf");
                StringEntity requestEntity = new StringEntity(requestData.toString());
                request.addHeader("content-type", "application/x-www-form-urlencoded");
                request.setEntity(requestEntity);
                HttpResponse response = httpClient.execute(request);
                String responseBody = EntityUtils.toString(response.getEntity());
                JSONObject responseJSON = new JSONObject(responseBody);
                System.out.println(responseJSON);
                }
            catch (Exception ex) {
            ex.printStackTrace();
            }
            finally {
                httpClient.getConnectionManager().shutdown();
            }
    
        }
    

    我使用的URL用于验证收据是

    Development mode = https://sandbox.itunes.apple.com/verifyReceipt
    Production mode = https://buy.itunes.apple.com/verifyReceipt
    

    请告诉我取消应用内购买的URL是什么

    1 回复  |  直到 7 年前
        1
  •  1
  •   lostInTransit    7 年前

    没有任何可以取消IAP的。如果是自动续订订阅,用户可以选择在下一次续订之前从iTunes设置中取消订阅。如果是一次性购买,IAP要么通过要么失败。

    这是一个 Apple support doc 解释不同类型的IAP

    如果您想知道如何在验证失败时取消IAP, this SO question 讨论它( and this ).