Hamid
Hamid

Reputation: 129

Sending data to google wallet it is sending response merchant error

I am sending data to google wallet it is giving error

error type: merchant_error this is the resource url:https://developers.google.com/commerce/wallet/digital/docs/tutorial#1

function setup() {
runDemoButton = document.getElementById("runDemoButton");
runDemoButton.onclick = function() {
    google.payments.inapp.buy({
        parameters: {},
        jwt:"eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIxNDIwNDk" +
                "1MzA5NDM1MjE2ODU3MSIsImF1ZCI6Ikdvb2dsZSI" +
                "sInR5cCI6Imdvb2dsZS9wYXltZW50cy9pbmFwcC9" +
                "pdGVtL3YxIiwiaWF0IjoxMzc0ODE4Mzg1LCJleHA" +
                "iOjEzNzQ4MjQzODUsInJlcXVlc3QiOnsibmFtZSI" +
                "6IlBpZWNlIG9mIENha2UiLCJkZXNjcmlwdGlvbiI" +
                "6IkEgZGVsaWNpb3VzIHBpZWNlIG9mIHZpcnR1YWw" +
                "gY2FrZSIsInByaWNlIjoiMTAuNTAiLCJjdXJyZW5" +
                "jeUNvZGUiOiJVU0QiLCJzZWxsZXJEYXRhIjoiWW9" +
                "1ciBEYXRhIEhlcmUifX0.yP89u5CAaoBCmdWknpX" +
                "084EmNngzs6BGgqLC03qO7Rw" ,
        success: function(data1) {window.alert("success"+JSON.stringify(data1))},
        failure: function(data) {window.alert("failure"+JSON.stringify(data))}
    });
    return false;
};

Upvotes: 0

Views: 342

Answers (1)

Mihai Ionescu
Mihai Ionescu

Reputation: 2108

The demo sample you are pointing to seems to work fine.

You can also try some additional sample code in various languages (Java, Python, PHP):

https://developers.google.com/commerce/wallet/digital/docs/samples

MERCHANT_ERROR implies that something is wrong with the purchase request such as a badly formatted JWT. If you are trying to re-use the sample code in your app make sure to generate a new JWT using your Seller ID and Seller Secret.

Upvotes: 1

Related Questions