plugin.tx_amazonpay {
	view {
		templateRootPaths {
			30 = {$plugin.tx_amazonpay.view.templateRootPath}
			400 = {$themes.resourcesPrivatePath}Extensions/AmazonPay/Templates/
		}
		partialRootPaths {
			300 = {$plugin.tx_amazonpay.view.partialRootPath}
			400 = {$themes.resourcesPrivatePath}Extensions/AmazonPay/Partials/
		}
		layoutRootPaths {
			300 = {$plugin.tx_amazonpay.view.layoutRootPath}
			400 = {$themes.resourcesPrivatePath}Extensions/AmazonPay/Layouts/
		}
	}
	persistence {
		storagePid = {$plugin.tx_amazonpay.settings.container.payment}
	}
	features {
		# uncomment the following line to enable the new Property Mapper.
		# rewrittenPropertyMapper = 1
		# Skip default arguments from urls
		skipDefaultArguments = 1
	}
	settings {
		# Debug
		debug = {$plugin.tx_amazonpay.settings.debug}
		# Amazon payment settings
		amazon {
			
			# Run in sandbox mode true/false
			sandbox = {$plugin.tx_amazonpay.settings.sandbox}
			# Amazon payments URL
			url = {$plugin.tx_amazonpay.settings.url}
			
			# Settings from:
			# https://sellercentral-europe.amazon.com
			# Client ID
			clientId = {$plugin.tx_amazonpay.settings.clientId}
			# Seller ID (Händler-ID)
			sellerId = {$plugin.tx_amazonpay.settings.sellerId}
			# Access Key ID
			accessKey = {$plugin.tx_amazonpay.settings.accessKey}
			# Secret Access Key
			# Be sure that this key isn't public visible!
			secretKey = {$plugin.tx_amazonpay.settings.secretKey}

			# Set the name of your store
			storeName = {$plugin.tx_amazonpay.settings.storeName}

			# Set the region
			region = {$plugin.tx_amazonpay.settings.region}

			# Prefix for the order id
			orderIdPrefix = {$plugin.tx_amazonpay.settings.orderIdPrefix}

			# Proxy
			proxyHost = {$plugin.tx_amazonpay.settings.proxyHost}
			proxyPort = {$plugin.tx_amazonpay.settings.proxyPort}
			proxyUsername = {$plugin.tx_amazonpay.settings.proxyUsername}
			proxyPassword = {$plugin.tx_amazonpay.settings.proxyPassword}

			# Application information
			# Don't modify these values
			# Application Name
			applicationName = TYPO3 AmazonPay
			# Application Version
			applicationVersion = 1.5.0
			
			# Amazon login parameters
			# https://payments.amazon.de/developer/documentation/lpwa/201952050
			login {
				
				# Type of the button
				# https://payments.amazon.de/developer/documentation/lpwa/201952050#type
				type = PwA
				
				# Color of the button
				# https://payments.amazon.de/developer/documentation/lpwa/201952050#color
				color = LightGray
				
				# Size of the button
				# https://payments.amazon.de/developer/documentation/lpwa/201952050#size
				size = large
				
				# Language
				# https://payments.amazon.de/developer/documentation/lpwa/201952050#language
				language = de-DE
				
				# Scope
				# https://payments.amazon.de/developer/documentation/lpwa/201952050#scopes
				scope = profile payments:widget payments:shipping_address payments:billing_address

				# PopUp can be 0/1
				# https://payments.amazon.de/developer/documentation/lpwa/201952050#popup
				popup = 1

				# Redirect, if empty no redirect will happen
				redirectUrl = 
			}
			checkout {
				pageUid = {$plugin.tx_amazonpay.settings.pages.checkout}
			}
		}
		# Countries that are allowed as shipping target
		allowedShippingCountries {
			# The key is the ISO-Code (short)
			DE {
				# Shipping costs (needs to be implemented)
				costs {
					group1 {
						label = Small products
						price = 2.50
					}
					group2 {
						label = Large products
						price = 4.50
					}
				}
			}
			AT {
				# Shipping costs (needs to be implemented)
				costs {
					group1 {
						label = Small products
						price = 4.50
					}
					group2 {
						label = Large products
						price = 6.50
					}
				}
			}
			#GB {
			#	..is not allowed, because it is quoted
			#}
		}
	}
}
# Page configuration
page {
	jsFooterInline {
		1507211717 = TEXT
		1507211717.value (
			jQuery(document).ready(function() {
				var config = jQuery('[data-amazonpay-config]').attr('data-amazonpay-config');
				amazonPayment.initialize(jQuery.parseJSON(config));
			});
		)
	}
}
page {
	includeJSFooter {
		amazonPayment = EXT:amazon_pay/Resources/Public/JavaScript/AmazonPayment.js
		amazonPayment.external = 0
		amazonPayment.type = text/javascript
		logger = EXT:amazon_pay/Resources/Public/JavaScript/Logger.js
		logger.external = 0
		logger.type = text/javascript
		flashMessage = EXT:amazon_pay/Resources/Public/JavaScript/FlashMessage.js
		flashMessage.external = 0
		flashMessage.type = text/javascript
		translate = EXT:amazon_pay/Resources/Public/JavaScript/Translate.js
		translate.external = 0
		translate.type = text/javascript
	}
}
# AJAX JSON API
amazonpay_jsonapi = PAGE
amazonpay_jsonapi {
	config {
		disableAllHeaderCode = 1
		additionalHeaders = Content-type:application/json;charset=utf-8
		debug = 0
		no_cache = 1
		metaCharset = utf-8
	}
	typeNum = 1479812019
	10 < tt_content.list.20.amazonpay_jsonapi
}
# Linkhandler for selecting payment presets
plugin.tx_linkhandler.tx_amazonpay_paymentpreset {
	// Do not force link generation when the news records are hidden or deleted.
	forceLink = 0
	typolink {
		parameter = {$plugin.tx_amazonpay.settings.pages.checkout}
		additionalParams = &tx_amazonpay_checkout[paymentPreset]={field:uid}&tx_amazonpay_checkout[controller]=Amazon&tx_amazonpay_checkout[action]=checkout
		additionalParams.insertData = 1
		useCacheHash = 1
	}
}
# Default CSS
plugin.tx_amazonpay._CSS_DEFAULT_STYLE (
	.tx-amazonpay {
		position: relative;
	}
	/**
	 * Please include the min-width, max-width, min-height and max-height if you plan to use a relative CSS unit 
	 * measurement to make sure the widget renders in the optimal size allowed.    
	 */
	#amazon-address-book {
		min-width: 300px;
		width: 100%;
		max-width: 900px;
		min-height: 228px;
		height: 240px;
		max-height: 400px;
	}
	#amazon-wallet {
		min-width: 300px;
		width: 100%;
		max-width: 900px;
		min-height: 228px;
		height: 240px;
		max-height: 400px;
	}
	/* The following are only required when you use the read-only widgets: */
	#readOnlyAddressBookWidgetDiv {
		min-width: 266px;
		width: 100%;
		max-width: 900px;
		min-height: 145px;
		height: 165px;
		max-height: 180px;
	}
	#readOnlyWalletWidgetDiv {
		min-width: 266px;
		width: 100%;
		max-width: 900px;
		min-height: 145px;
		height: 165px;
		max-height: 180px;
	}
	.amazon-button {
		cursor: pointer;
		line-height: 30px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		border: 1px solid #bbb;
		border-radius: 3px;
		display: inline-block;
		text-decoration: none;
		margin: 0 3px 6px 0;
		padding: 0 20px 0 30px;
		color: #333;
		font-size: 11px;
		height: 30px;
		background: #f6f6f6;
		background: -moz-linear-gradient(top,#f6f6f6 0,#e1e1e1 100%);
		background: -webkit-linear-gradient(top,#f6f6f6 0,#e1e1e1 100%);
		background: -ms-linear-gradient(top,#f6f6f6 0,#e1e1e1 100%);
		background: linear-gradient(to bottom,#f6f6f6 0,#e1e1e1 100%);
	}
	.amazon-box {
		border: 1px solid #bbb;
		border-radius: 6px;
	}
	.amazon-button:hover {
		background: #ececec;
		background: -moz-linear-gradient(top,#ececec 0,#d3d3d3 100%);
		background: -webkit-linear-gradient(top,#ececec 0,#d3d3d3 100%);
		background: -ms-linear-gradient(top,#ececec 0,#d3d3d3 100%);
		background: linear-gradient(to bottom,#ececec 0,#d3d3d3 100%);
	}
	#amazon-payment-loading {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(255,255,255,0.8);
		text-align: center;
		padding-top: 100px;
		z-index: 9999;
	}
	#amazon-payment-loading img {
		width: 100px;
		height: auto;
	}
	.amazon-button-container {
		margin-top: 10px;
	}
)