How do I add multiple items using google wallet digital goods?

▼魔方 西西 提交于 2020-01-06 14:53:21

问题


I am trying to add multiple items using google digital goods, what I want is for my users to be able to checkout with multiple items that are in their cart. Here is the code(not full code) with one item. How can I add multiple?

$payload = array(
    "iss" => $row['seller_identifier'], "aud" => "Google",
    "typ" => "google/payments/inapp/item/v1", "exp" => time() + 3600,
    "iat" => time(),
     "request" => array(
        "name"       => $_SESSION["itemname"],
        "price"      => $_SESSION["itemprice"], "currencyCode" => "USD",
        "sellerData" => "user_id:" . $this->userid
    )
);

回答1:


Multiple digital content items are not supported by design in the Google Wallet for digital goods API.

Depending on your use case, you can either sell the items individually (e.g. something like a "Buy Now" button) or calculate the total cost and place one bundle transaction.



来源:https://stackoverflow.com/questions/18500719/how-do-i-add-multiple-items-using-google-wallet-digital-goods

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!