hi friends,
i m trying to integrate my shopping site with google
checkout.
i have generated shopping cart in xml.
when i m going to create signature from cart, it gives me
signature.
but when i post data to sendbox.google.com, it gives me
error "Bad
Signature on Cart"
i have created signature in binary format.
code in my controller is:
def google
cart=File.read("#/app/views/buy/cart.xml&qu
ot;)
signature=OpenSSL::HMAC.digest(OpenSSL: igest::S
HA1.new,merchent_key,cart)
bs64cart=Base64.encode64(cart)
bs64sign=Base64.encode64(signature)
end
code in my rhtml file:
<html>
<body>
<form method="POST" action="https://sandbox.google.co
m/
checkout/cws/v2/Merchant/merchent_id/checkout"
accept-charset="utf-8">
<input type="hidden"
name="cart" value="<%= bs64cart%>">
<input type="hidden"
name="signature" value="<%= bs64sign
%>">
<input type="image"
name="Google Checkout" alt="Fast
checkout through Google" src="http://sandbox.go
ogle.com/checkout/
buttons/checkout.gif?
merchant_id=merchent_id&w=180&h=46&style=white&a
mp;variant=text&loc=en_US"
height="46" width="180"/>
</form>
</body>
</html>
but its not working,
pls help me out some one
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integration googlegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---
|