window.atob: produces [Object Object]
I tried encoding my jwt using window.btoa like this:
google.load('payments','1.0',{'packages':['production_config']});
function purchase(){
var encodedData = window.btoa({"iss":"02------
secret------94","aud":"Google","typ":"google/payments/inapp/item/
v1","iat":1329362137,"exp":1329448537,"request":
{"currencyCode":"USD","price":"0.01","name":"penny","sellerData":"","description":"none"}});
goog.payments.inapp.buy({
jwt: encodedData,
success: function() { window.alert('success')},
failure: function() { window.alert('failure')}
})
}
and I get this wallet error:
Uh oh. There was a problem.
We couldn't start your purchase because of a technical issue.
Details of the problem below:
Looks like there is an error in the setup for your purchase. Please
contact the merchant with this error message: Expected 3 components in
jwt: W29iamVjdCBPYmplY3Rd
!?
Thanks
On Feb 16, 12:12 am, Peng Ying <
py...@google.com> wrote:
> You're probably purchasing from yourself then, create a separate buyer
> account
>
> Follow the dev guide instead of copying and pasting for instructions on
> defining dynamic itemshttps://
developers.google.com/in-app-payments/docs/tutorial#2
> Google+ <
http://goo.gl/28b8c>