GoogleCheckoutを自分のウェブサイトに統合しようとしています。必要なhmac-sha-1署名を生成するために次の関数を作成しました。
def make_signature(cart_xml):
import hmac
import hashlib
import base64
# The number is a psuedo-merchantID, cart_xml contains a string with the
# shopping cart xml as outlined on google's documentation.
signature = hmac.new("711348421531236", cart_xml, hashlib.sha1)
signature = base64.b64encode(signature.digest())
return signature
このコードは、 http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API.html#create_checkout_cartに概説されている要件に基づいています。
ただし、カートに署名を検証させることができません。次のエラーが表示され続けます:「カートの署名が正しくありません」
誰かがこれを修正する方法を知っていますか?