You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Need Help On Amazon Flexible Payments Service Module For Virtuemart

Started by John, November 30, 2007, 20:39:16 PM

Previous topic - Next topic


Hi,I need help developing a basic Amazon Payments VirtueMart 1.0.12 payment module, my knowledge of PHP is limited & this is what I have now:


  <input type="hidden"name="referenceId" value="<?php printf("%08d",$db->f("order_id")); ?>" />

  <input type="hidden"name="abandonUrl" value=""/>

  <input type="image" src="

            #PHP Sample Code for creatinga 'Pay Now' widget
            #To use this sample, replacethe values of $accessKey and $secretKey with the values for youraccount
            require_once'Crypt/HMAC.php'; #see
            require_once'HTTP/Request.php'; #see
            $accessKey ="<insert-your-access-key-here>";
            $secretKey = "<insert-your-secret-key-here>";
            functiongetPayNowButtonForm($amount, $description, $referenceId,
            $immediateReturn, $returnUrl,$abandonUrl) {
            global $accessKey;
            $formHiddenInputs['accessKey'] = $accessKey;
            $formHiddenInputs['amount'] =$amount;
            $formHiddenInputs['description'] = $description;
            if ($referenceId)$formHiddenInputs['referenceId'] = $referenceId;       
            if ($immediateReturn)$formHiddenInputs['immediateReturn'] = $immediateReturn;   
            if ($returnUrl)$formHiddenInputs['returnUrl'] = $returnUrl;   
            if ($abandonUrl)$formHiddenInputs['abandonUrl'] = $abandonUrl;   
            $stringToSign ="";
            foreach ($formHiddenInputs as$formHiddenInputName => $formHiddenInputValue) {
            $stringToSign = $stringToSign. $formHiddenInputName . $formHiddenInputValue;
            $formHiddenInputs['signature'] = getSignature($stringToSign,$secretKey);
            $form = "<formaction=\"\"method=\"post\">\n";
            foreach ($formHiddenInputs as$formHiddenInputName => $formHiddenInputValue) {
            $form = $form ."<input type=\"hidden\"name=\"$formHiddenInputName\"value=\"$formHiddenInputValue\" />\n";
            $form = $form ."<input type=\"image\" src=\"\"border=\"0\" alt=\"Pay Using Amazon\"/>\n";
            $form = $form ."</form>\n";
            return $form;
            functiongetSignature($stringToSign) {
            global $secretKey;
            $hmac = newCrypt_HMAC($secretKey,"sha1");
            $binary_hmac =pack("H40", $hmac->hash(trim($stringToSign)));
                <?=getPayNowButtonForm("USD1.00", "e-Card", "i123n", "1", "",

Pastedfrom <>


Ok, so Amazon is ready for VirtueMart????   :-\

Might it be possible to use one of the other payment modules to copy & modify to be able to use Amazon? 

If so, could someone provide some guidance?



I'd like to know if there's such a thing as a module that would do the same job. There seems to be a Google Checkout module but none for Amazon Payments.



We have just completed an Amazon checkout module and have installed on a few of our clients sites and it works perfectly.

1 click install. This is not an extra module but will be located on the actual checkout page for the client. You just need to enter int your account information and the Amazon Checkout will appear.

You can see more info here:

Or email me if you have any questions.




OK, so has anyone tried scott's extension? If so, does it work and does it work in Joonla 1.5 and VirtueMart 1.1.5 stable?

Scott, any way of trying it out before paying for it?


Is your website joomla 2.5 and virtuemart 2.

I did it on this site -  smartrestyle. I might beable to help you

send details of Joomla version and virtuemart

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Shortcuts: ALT+S post or ALT+P preview