Author Topic: Need Help On Amazon Flexible Payments Service Module For Virtuemart  (Read 12351 times)

John

  • Beginner
  • *
  • Posts: 11
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:

 

<formaction=" https://authorize.payments.amazon.com/pba/paypipeline"method="post" />

  <input type="hidden"name="immediateReturn" value="0" />

  <input type="hidden"name="amount" value="USD <?php printf("%.2f",

$db->f("order_total"))?>"/>

  <input type="hidden"name="signature" value="Generate the signature as described inthe integration guide" >

  <input type="hidden"name="description" value="Product Description Here" />

  <input type="hidden"name="amazonPaymentsAccountId" value="Put your   Amazon Payments Account Id here as describedin the integration guide" />

  <input type="hidden"name="accessKey" value="Put your accessKey here as described inthe integration guide" />

  <input type="hidden"name="returnUrl" value=" http://yourwebsite.com/confirmed"/>

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

  <input type="hidden"name="abandonUrl" value=" http://yourwebsite.com/cancel"/>

  <input type="image" src=" https://authorize.payments.amazon.com/pba/images/amazonPaymentsButton.jpg"border="0" />

</form>

How do I getvirtuemart to automatically generate a signature as described here:

 

http://docs.amazonwebservices.com/AmazonFPS/2007-01-08/PayNowWidgetImplementationGuide/

<?
            #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 http://pear.php.net/package/Crypt_HMAC
            require_once'HTTP/Request.php'; #see http://pear.php.net/package/HTTP_Request
           
            $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;   
           
            ksort($formHiddenInputs);
            $stringToSign ="";
           
            foreach ($formHiddenInputs as$formHiddenInputName => $formHiddenInputValue) {
            $stringToSign = $stringToSign. $formHiddenInputName . $formHiddenInputValue;
            }
           
            $formHiddenInputs['signature'] = getSignature($stringToSign,$secretKey);
           
            $form = "<formaction=\" https://authorize.payments.amazon.com/pba/paypipeline\"method=\"post\">\n";
            foreach ($formHiddenInputs as$formHiddenInputName => $formHiddenInputValue) {
            $form = $form ."<input type=\"hidden\"name=\"$formHiddenInputName\"value=\"$formHiddenInputValue\" />\n";
            }
            $form = $form ."<input type=\"image\" src=\" https://authorize.payments.amazon.com/pba/images/amazonPaymentsButton.jpg\"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)));
            returnbase64_encode($binary_hmac);
            }
          ?>
           
            <html>
              <body>
                <?=getPayNowButtonForm("USD1.00", "e-Card", "i123n", "1", " http://yourwebsite.com/return.html",
                  " http://yourwebsite.com/abandon.htm")?>
              </body>
            </html>

 

Pastedfrom < http://docs.amazonwebservices.com/AmazonFPS/2007-01-08/PayNowWidgetImplementationGuide/generatesig.html>

Sylvia

  • Beginner
  • *
  • Posts: 4
    • The Boutique Shop Online
Re: Need Help On Amazon Flexible Payments Service Module For Virtuemart
« Reply #1 on: February 29, 2008, 02:39:37 am »
Has anything come  of this?

sylvia

Sylvia

  • Beginner
  • *
  • Posts: 4
    • The Boutique Shop Online
Re: Need Help On Amazon Flexible Payments Service Module For Virtuemart
« Reply #2 on: August 14, 2008, 19:40:21 pm »
Ok, so Amazon is ready for payments....is VirtueMart????   :-\

https://payments.amazon.com/sdui/sdui/business?sn=cba/o

http://blogs.barrons.com/techtraderdaily/2008/07/29/amazon-takes-on-ebays-paypal-with-payments-service/

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?

sylvia

2004carlt

  • Beginner
  • *
  • Posts: 2
    • Best Blender
Re: Need Help On Amazon Flexible Payments Service Module For Virtuemart
« Reply #3 on: November 13, 2009, 19:00:26 pm »
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.

scottpjr

  • Beginner
  • *
  • Posts: 1
Re: Need Help On Amazon Flexible Payments Service Module For Virtuemart
« Reply #4 on: June 20, 2011, 22:27:58 pm »
Hi,

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:

http://usjoomlapros.com/Extensions/Amazon-CHeckout-For-Virtuemart/flypage.tpl.html

Or email me if you have any questions.

THX

Scott

kleinbaas

  • Beginner
  • *
  • Posts: 34
Re: Need Help On Amazon Flexible Payments Service Module For Virtuemart
« Reply #5 on: March 03, 2012, 21:43:42 pm »
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?

wipeout22

  • Beginner
  • *
  • Posts: 1
Re: Need Help On Amazon Flexible Payments Service Module For Virtuemart
« Reply #6 on: December 22, 2012, 14:43:27 pm »
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