List Info

Thread: Bad Signature on Cart




Bad Signature on Cart
country flaguser name
United States
2007-05-26 03:58:49
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-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checko
ut-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Bad Signature on Cart
user name
2007-05-26 11:27:02
Hi

Just double check if u are not mixing merchant Id/Key from sandbox with production, or viceversa..

hope this helps

ropu

On 5/26/07, abhi.janu83gmail.com">abhi.janu83gmail.com < abhi.janu83gmail.com">abhi.janu83gmail.com> wrote:

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
&nbsp; cart= File.read("#{RAILS_ROOT}/app/views/buy/cart.xml")

signature=OpenSSL::HMAC.digest(OpenSSL:igest::SHA1.new,merchent_key,cart)

 &nbsp;bs64cart=Base64.encode64(cart)
&nbsp; bs64sign=Base64.encode64(signature)
end

code in my rhtml file:

<;html>
&nbsp;   ;<body&gt;
 &nbsp; &nbsp;   ; <form method=&quot;POST&quot; action=&quot;https://sandbox.google.com/
checkout/cws/v2/Merchant/merchent_id/checkout&quot; accept-charset="utf-8">
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;<input type=";hidden&quot; name=";cart" value=&quot;<%= bs64cart%&gt;"&gt;
 &nbsp; &nbsp;   ; &nbsp; &nbsp; &lt;input type=";hidden&quot; name=";signature&quot; value=&quot;<%= bs64sign
%>";>

&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;<input type=";image"; name=";Google Checkout&quot; alt="Fast
checkout through Google&quot; src="http://sandbox.google.com/checkout/
buttons/checkout.gif?
merchant_id=merchent_id&amp;w=180&;h=46&style=white&amp;variant=text&loc=en_US&quot;
height="46&quot; width=&quot;180"/>
 ; &nbsp; &nbsp; &nbsp; &lt;/form>;
 &nbsp; &nbsp;</body>
&lt;/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&quot; group.
To post to this group, send email to google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checkout-api-integration?hl=en
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )