public static function Sampleform()
 {
     try {
         ButtonGenerator::GenerateForm(self::$accessKey, self::$secretKey, self::$amount, self::$description, self::$referenceId, self::$immediateReturn, self::$returnUrl, self::$abandonUrl, self::$processImmediate, self::$ipnUrl, self::$collectShippingAddress, self::$signatureMethod, self::$environment);
     } catch (Exception $e) {
         echo 'Exception : ', $e->getMessage(), "\n";
     }
 }
 /**
  * @todo not finished
  * 
  * @param Payment_Invoice $invoice
  * @return <type>
  */
 public function singlePayment(Payment_Invoice $invoice)
 {
     throw new Exception('Amazon Payment gateway is under development.');
     ob_start();
     ButtonGenerator::GenerateForm($this->getParam('AWSAccessKeyId'), $this->getParam('AWSSecretKey'), $invoice->getCurrency() . ' ' . $invoice->getTotalWithTax(), $invoice->getTitle(), $invoice->getId(), 0, $this->getParam('return_url'), $this->getParam('cancel_url'), 1, $this->getParam('notify_url'), 0, 'HmacSHA256', 'sandbox');
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }
Exemplo n.º 3
0
$returnUrl = $vars->return;
//Optionally enter the URL where buyers should be redirected after they complete the transaction
$immediateReturn = "0";
//Optionally, enter "1" if you want to skip the final status page in Amazon Payments
$processImmediate = "1";
//Optionally, enter "1" if you want to settle the transaction immediately else "0". Default value is "1"
$ipnUrl = $vars->notify_url;
//Optionally, type the URL of your host page to which Amazon Payments should send the IPN transaction information.
$collectShippingAddress = 0;
//Optionally, enter "1" if you want Amazon Payments to return the buyer's shipping address as part of the transaction information
if ($this->params->get('sandbox') == 1) {
    $environment = "sandbox";
} else {
    $environment = "prod";
}
$formdata = ButtonGenerator::GenerateForm($accessKey, $secretKey, $amount, $description, $referenceId, $immediateReturn, $returnUrl, $abandonUrl, $processImmediate, $ipnUrl, $collectShippingAddress, $signatureMethod, $environment);
?>

	<div class="akeeba-bootstrap">
		<form name="amazon_payment" class="form-horizontal" action="<?php 
echo $formdata['endPoint'];
?>
" method="<?php 
echo $formdata['httpmethod'];
?>
">
			
				<?php 
$form = '';
foreach ($formdata['params'] as $name => $value) {
    $form .= "<input type=\"hidden\" name=\"{$name}";