Search code examples
apache-flexe-commercebilling

Flex and Amazon Payments


I am trying to get amazon payments working w/ my flex app, as shown here: http://miti.pricope.com/2009/07/11/using-amazon-flexible-payment-system-with-flex/

I've done exactly as he says, I've downloaded the files & changed the access key & secret key. When I run it on localhost or my production server I get "Signature did not match"

What else do I need to get this to work?

Is there something else I need that he forgot to include?


Solution

  • Lets try next:

    goto return.and find function validateQueryString() and change to this:

    function validateQueryString()
    {
        echo "validing the query string now\n";
        $querystring = $_SERVER['QUERY_STRING'];
        echo $querystring."\n";
        echo $_GET['signature'];
        $obj = new Amazon_FPS_CBUIUtils(AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY);
        //Original signature received in response from Amazon FPS should be specified.
        $signatureMatched = $obj->validateQueryString($querystring,$_GET['signature']);
    
        if ($signatureMatched) {
            echo "signature matched \n";
      $request =  new Amazon_FPS_Model_PayRequest();
      //set the proper senderToken here.
      $request->setSenderTokenId($_GET['tokenID']);
      $amount = new Amazon_FPS_Model_Amount();
      $amount->setCurrencyCode("USD");
      //set the transaction amount here;
      $amount->setValue($_SESSION['transaction_amount']); 
      $request->setTransactionAmount($amount);
      //set the unique caller reference here.
      $request->setCallerReference($_GET['callerReference']); 
      $service = new Amazon_FPS_Client(AWS_ACCESS_KEY_ID, 
                                            AWS_SECRET_ACCESS_KEY);
        invokePay($service, $request);
        }
        else
            echo "Signature did not match \n";
    }
    

    and post output here please, including your Signature did not match

    Thanks.