• <small id='lVLla'></small><noframes id='lVLla'>

  • <i id='lVLla'><tr id='lVLla'><dt id='lVLla'><q id='lVLla'><span id='lVLla'><b id='lVLla'><form id='lVLla'><ins id='lVLla'></ins><ul id='lVLla'></ul><sub id='lVLla'></sub></form><legend id='lVLla'></legend><bdo id='lVLla'><pre id='lVLla'><center id='lVLla'></center></pre></bdo></b><th id='lVLla'></th></span></q></dt></tr></i><div id='lVLla'><tfoot id='lVLla'></tfoot><dl id='lVLla'><fieldset id='lVLla'></fieldset></dl></div>
    <tfoot id='lVLla'></tfoot>
    • <bdo id='lVLla'></bdo><ul id='lVLla'></ul>

        <legend id='lVLla'><style id='lVLla'><dir id='lVLla'><q id='lVLla'></q></dir></style></legend>
      1. PHP postback url 谷歌钱包 IAP

        时间:2023-12-01
        1. <i id='zMbh2'><tr id='zMbh2'><dt id='zMbh2'><q id='zMbh2'><span id='zMbh2'><b id='zMbh2'><form id='zMbh2'><ins id='zMbh2'></ins><ul id='zMbh2'></ul><sub id='zMbh2'></sub></form><legend id='zMbh2'></legend><bdo id='zMbh2'><pre id='zMbh2'><center id='zMbh2'></center></pre></bdo></b><th id='zMbh2'></th></span></q></dt></tr></i><div id='zMbh2'><tfoot id='zMbh2'></tfoot><dl id='zMbh2'><fieldset id='zMbh2'></fieldset></dl></div>
          <legend id='zMbh2'><style id='zMbh2'><dir id='zMbh2'><q id='zMbh2'></q></dir></style></legend>
        2. <tfoot id='zMbh2'></tfoot>

              <tbody id='zMbh2'></tbody>

            • <small id='zMbh2'></small><noframes id='zMbh2'>

                  <bdo id='zMbh2'></bdo><ul id='zMbh2'></ul>
                  本文介绍了PHP postback url 谷歌钱包 IAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  My postback php for google wallet in-app payments looks like this:

                  <?php
                  $payload = array(
                    "iss" => $sellerIdentifier,
                    "aud" => "Google",
                    "typ" => "google/payments/inapp/item/v1",
                    "exp" => time() + 3600,
                    "iat" => time(),
                    "request" => array (
                      "name" => "pizza ",
                      "description" => "yum yum",
                      "price" => "10.50",
                      "currencyCode" => "USD",
                      "sellerData" => "",
                    )
                  );
                  $testToken = JWT::encode($payload, $sellerSecret);
                  ?>
                  

                  I have two questions:

                  1. why do I see this error?... Uh oh. There was a problem. We couldn't complete your purchase because of a technical issue. Details of the problem below:Unfortunately, we could not confirm your purchase with the merchant's server. Your order has been canceled. Please contact the merchant if this problem continues.

                  2. How can this work if I have multiple items for sale? the example php above lets you buy a 'pizza for $10.50' how can I add another item like a 'hotdog for $2.99'?

                  ps: I have studied the following documentation:

                  https://developers.google.com/in-app-payments/docs/tutorial#4

                  https://developers.google.com/in-app-payments/docs/jsreference#jwt

                  https://developers.google.com/in-app-payments/docs/postback

                  Thank you for your time.

                  //update!

                  postback.php: require_once 'JWT.php';

                  JWT.php: $json = json_encode($input, JSON_UNESCAPED_SLASHES);

                  Uh oh. There was a problem. We couldn't complete your purchase because of a technical issue. Details of the problem below: Unfortunately, we could not confirm your purchase with the merchant's server. Your order has been canceled. Please contact the merchant if this problem continues.

                  解决方案

                  You're supposed to decode the raw encoded jwt data sent to your postback.php. In bare minimum your postback.php should look something like below (assuming your postback.php is hosted on apache server). Hope this helps

                  <?php
                  require_once(dirname(__FILE__) . "JWT.php");
                  
                  $response = isset($HTTP_RAW_POST_DATA) ?
                      $HTTP_RAW_POST_DATA : file_get_contents("php://input");
                  $response = substr_replace($response, "", 0, 4);   //remove "jwt=" from raw http data
                  $response = JWT::decode($response, "your secret key here");
                  print_r($response->response);
                  ?>
                  

                  这篇关于PHP postback url 谷歌钱包 IAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将授权标头与 JWT Laravel 一起使用时获取 token_not_provided 下一篇:Firebase 令牌验证

                  相关文章

                  <legend id='5lnaO'><style id='5lnaO'><dir id='5lnaO'><q id='5lnaO'></q></dir></style></legend>
                • <small id='5lnaO'></small><noframes id='5lnaO'>

                    • <bdo id='5lnaO'></bdo><ul id='5lnaO'></ul>

                    <tfoot id='5lnaO'></tfoot>
                  1. <i id='5lnaO'><tr id='5lnaO'><dt id='5lnaO'><q id='5lnaO'><span id='5lnaO'><b id='5lnaO'><form id='5lnaO'><ins id='5lnaO'></ins><ul id='5lnaO'></ul><sub id='5lnaO'></sub></form><legend id='5lnaO'></legend><bdo id='5lnaO'><pre id='5lnaO'><center id='5lnaO'></center></pre></bdo></b><th id='5lnaO'></th></span></q></dt></tr></i><div id='5lnaO'><tfoot id='5lnaO'></tfoot><dl id='5lnaO'><fieldset id='5lnaO'></fieldset></dl></div>