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
)
);
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.