• <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

        PHP postback url google wallet IAP(PHP postback url 谷歌钱包 IAP)
        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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                  <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>
                            <tbody id='5lnaO'></tbody>
                          <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>