user2535554
user2535554

Reputation: 1

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

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

Upvotes: 0

Views: 440

Answers (1)

Mihai Ionescu
Mihai Ionescu

Reputation: 2108

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.

Upvotes: 2

Related Questions