PHP postback url google wallet IAP

后端 未结 4 1742
情深已故
情深已故 2021-01-16 05:12

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

 $sellerIdentifier,
  \"aud\" => \"Google\",
         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-16 05:55

    to make a hotdog additionally do this:

     $sellerIdentifier,
      "aud" => "Google",
      "typ" => "google/payments/inapp/item/v1",
      "exp" => time() + 3600,
      "iat" => time(),
      "request" => array (
        "name" => "cake",
        "description" => "yum yum",
        "price" => "10.50",
        "currencyCode" => "USD",
        "sellerData" => "",
      )
    );
    $hotdog_payload = array(
      "iss" => $sellerIdentifier,
      "aud" => "Google",
      "typ" => "google/payments/inapp/item/v1",
      "exp" => time() + 3600,
      "iat" => time(),
      "request" => array (
        "name" => "hotdog",
        "description" => "yum yum",
        "price" => "5.99",
        "currencyCode" => "USD",
        "sellerData" => "",
      )
    );
    
    $cake_token = JWT::encode($cake_payload, $sellerSecret);
    $hotdog_token = JWT::encode($hotdog_payload, $sellerSecret);
    ?>
    

    pass both to a separate purchase() function in javascript (so purchase_hotdog() and purchase_cake()

提交回复
热议问题