00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_AmazonPayments_Block_Link_Shortcut extends Mage_Core_Block_Template
00035 {
00036 public function getCheckoutUrl()
00037 {
00038 #return $this->getUrl('amazonpayments/cba', array('_secure'=>true));
00039 return $this->getUrl('amazonpayments/cba/shortcut');
00040 }
00041
00042 public function getImageUrl()
00043 {
00044 return Mage::getStoreConfig('payment/amazonpayments_cba/button_url');
00045 #return 'http://g-ecx.images-amazon.com/images/G/01/cba/images/buttons/btn_Chkout-orange-large.gif';
00046 }
00047
00048 public function _toHtml()
00049 {
00050 if (Mage::getStoreConfigFlag('payment/amazonpayments_cba/active')
00051 && Mage::getSingleton('checkout/session')->getQuote()->validateMinimumAmount()) {
00052 return parent::_toHtml();
00053 }
00054
00055 return '';
00056 }
00057
00058 public function getCbaOneClickJsUrl()
00059 {
00060 if (Mage::getStoreConfigFlag('payment/amazonpayments_cba/sandbox_flag')) {
00061 $url = 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/widget/sandbox/widget.js';
00062 } else {
00063 $url = 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/widget/widget.js';
00064 }
00065 return $url;
00066 }
00067
00068 public function getCbaStylesheetUrl()
00069 {
00070 $url = 'https://images-na.ssl-images-amazon.com/images/G/01/cba/styles/one-click.css';
00071 return $url;
00072 }
00073
00074 public function getCbaJquerySetupUrl()
00075 {
00076 $url = 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/jquery.js';
00077 return $url;
00078 }
00079
00080
00081
00082
00083
00084
00085 public function getIsOneClickEnabled()
00086 {
00087 return Mage::getStoreConfigFlag('payment/amazonpayments_cba/use_oneclick');
00088 }
00089
00090 }