Ampersand_PaymentGateway - Version 0.1.14

Version Notes

Ampersand_PaymentGateway v0.1.14

Download this release

Release Info

Developer Magento Core Team
Extension Ampersand_PaymentGateway
Version 0.1.14
Comparing to
See all releases


Code changes from version 0.1.11 to 0.1.14

app/code/core/Ampersand/PaymentGateway/Helper/Data.php CHANGED
@@ -13,14 +13,14 @@ class Ampersand_PaymentGateway_Helper_Data extends Mage_Core_Helper_Abstract
13
  const SESSION_KEY_BILLING_AGREEMENT_SELECTION = 'ampersand_paymentgateway_billing_agreement_selection';
14
 
15
  /**
16
- * Max number of decimal places for price formatting.
17
  */
18
- const MAX_DECIMAL_PLACES = 2;
19
 
20
  /**
21
- * Registry key for storing redirect URL.
22
  */
23
- const REGISTRY_KEY_REDIRECT_URL = 'ampersand_paymentgateway_redirect_url';
24
 
25
  /**
26
  * Customer facing failure messages.
@@ -105,33 +105,28 @@ class Ampersand_PaymentGateway_Helper_Data extends Mage_Core_Helper_Abstract
105
  }
106
 
107
  /**
108
- * Retrieve the number of decimal places assumed in formatAmount().
109
- * Countries with no decimal places, like JPY, will not contain a decimal point.
110
  *
 
111
  * @return int
112
  * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
113
  */
114
- public function getDecimalPlaces()
115
  {
116
- $localeCode = $this->getLocaleCode();
117
- $currencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
118
-
119
- // we need access to external entities to get this locale data
120
- $entityLoaderStatus = libxml_disable_entity_loader(false);
121
-
122
- $decimalPlaces = Zend_Locale_Data::getContent($localeCode, 'currencyfraction', $currencyCode);
123
- if ($decimalPlaces === false) {
124
- $decimalPlaces = Zend_Locale_Data::getContent($localeCode, 'currencyfraction');
125
  }
126
 
127
- // reset libxml_entity_loader status back to what it was before
128
- libxml_disable_entity_loader($entityLoaderStatus);
129
-
130
- if ($decimalPlaces > self::MAX_DECIMAL_PLACES) {
131
- $decimalPlaces = self::MAX_DECIMAL_PLACES;
132
  }
133
 
134
- return $decimalPlaces;
135
  }
136
 
137
  /**
@@ -200,6 +195,30 @@ class Ampersand_PaymentGateway_Helper_Data extends Mage_Core_Helper_Abstract
200
  ->getFirstItem();
201
  }
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  /**
204
  * Retrieve the current customers IP address.
205
  *
13
  const SESSION_KEY_BILLING_AGREEMENT_SELECTION = 'ampersand_paymentgateway_billing_agreement_selection';
14
 
15
  /**
16
+ * Registry key for storing redirect URL.
17
  */
18
+ const REGISTRY_KEY_REDIRECT_URL = 'ampersand_paymentgateway_redirect_url';
19
 
20
  /**
21
+ * Path to config data for currency decimals
22
  */
23
+ const XML_PATH_CURRENCY_DECIMALS = 'ampersand_paymentgateway/currency_decimals';
24
 
25
  /**
26
  * Customer facing failure messages.
105
  }
106
 
107
  /**
108
+ * Retrieve the number of decimal places for the provided currency.
 
109
  *
110
+ * @param string $currency
111
  * @return int
112
  * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
113
  */
114
+ public function getDecimalPlaces($currencyCode)
115
  {
116
+ if (strlen($currencyCode) < 1) {
117
+ throw new Exception(
118
+ $this->__('Currency code must be provided to retrieve decimal places.')
119
+ );
 
 
 
 
 
120
  }
121
 
122
+ $currencyDecimals = Mage::getConfig()->getNode(self::XML_PATH_CURRENCY_DECIMALS);
123
+ if (isset($currencyDecimals->$currencyCode)) {
124
+ $decimalPlaces = $currencyDecimals->$currencyCode;
125
+ } else {
126
+ $decimalPlaces = $currencyDecimals->DEFAULT;
127
  }
128
 
129
+ return (int)$decimalPlaces;
130
  }
131
 
132
  /**
195
  ->getFirstItem();
196
  }
197
 
198
+ /**
199
+ * Determine whether the customer is logged in or has selected to register during checkout.
200
+ *
201
+ * @return boolean
202
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
203
+ */
204
+ public function isLoggedInOrRegistering()
205
+ {
206
+ if (Mage::helper('customer')->isLoggedIn()) {
207
+ return true;
208
+ }
209
+
210
+ /**
211
+ * Note: specifically checking onepage here as other checkout methods don't offer
212
+ * 'register during checkout', eg. multishipping creates the customer account beforehand.
213
+ */
214
+ $checkoutMethod = Mage::getSingleton('checkout/session')->getQuote()->getCheckoutMethod();
215
+ if (strcmp($checkoutMethod, Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER) === 0) {
216
+ return true;
217
+ }
218
+
219
+ return false;
220
+ }
221
+
222
  /**
223
  * Retrieve the current customers IP address.
224
  *
app/code/core/Ampersand/PaymentGateway/Helper/Subscription.php CHANGED
@@ -105,8 +105,8 @@ class Ampersand_PaymentGateway_Helper_Subscription extends Mage_Core_Helper_Abst
105
  return is_null($key) ? array() : null;
106
  }
107
 
108
- // subscriptions are only available to logged in customers
109
- if (!Mage::helper('customer')->isLoggedIn()) {
110
  return is_null($key) ? array() : null;
111
  }
112
 
105
  return is_null($key) ? array() : null;
106
  }
107
 
108
+ // subscriptions are only available to registered customers
109
+ if (!Mage::helper('ampersand_paymentgateway')->isLoggedInOrRegistering()) {
110
  return is_null($key) ? array() : null;
111
  }
112
 
app/code/core/Ampersand/PaymentGateway/Model/Method/DirectAbstract.php CHANGED
@@ -13,6 +13,14 @@ abstract class Ampersand_PaymentGateway_Model_Method_DirectAbstract
13
  const AMPERSAND_LASER = 'AMPERSAND_LASER';
14
  const AMPERSAND_DINERS_CLUB = 'AMPERSAND_DINERS_CLUB';
15
  const AMPERSAND_VPAY = 'AMPERSAND_VPAY';
 
 
 
 
 
 
 
 
16
 
17
  /**
18
  * Payment Method features
@@ -68,6 +76,14 @@ abstract class Ampersand_PaymentGateway_Model_Method_DirectAbstract
68
  self::AMPERSAND_LASER => false,
69
  self::AMPERSAND_DINERS_CLUB => false,
70
  self::AMPERSAND_VPAY => false,
 
 
 
 
 
 
 
 
71
  );
72
 
73
  /**
@@ -85,6 +101,14 @@ abstract class Ampersand_PaymentGateway_Model_Method_DirectAbstract
85
  self::AMPERSAND_LASER => '/^([0-9]{3}|[0-9]{4})?$/',
86
  self::AMPERSAND_DINERS_CLUB => '/^([0-9]{3}|[0-9]{4})?$/',
87
  self::AMPERSAND_VPAY => '/^([0-9]{3}|[0-9]{4})?$/',
 
 
 
 
 
 
 
 
88
  );
89
 
90
  /**
13
  const AMPERSAND_LASER = 'AMPERSAND_LASER';
14
  const AMPERSAND_DINERS_CLUB = 'AMPERSAND_DINERS_CLUB';
15
  const AMPERSAND_VPAY = 'AMPERSAND_VPAY';
16
+ const AMPERSAND_CARTES_BLANCHE = 'AMPERSAND_CARTES_BLANCHE';
17
+ const AMPERSAND_ENROUTE = 'AMPERSAND_ENROUTE';
18
+ const AMPERSAND_JAL = 'AMPERSAND_JAL';
19
+ const AMPERSAND_DANKORT = 'AMPERSAND_DANKORT';
20
+ const AMPERSAND_CARTE_BLEUE = 'AMPERSAND_CARTE_BLEUE';
21
+ const AMPERSAND_CARTA_SI = 'AMPERSAND_CARTA_SI';
22
+ const AMPERSAND_MAESTRO_INTERNATIONAL = 'AMPERSAND_MAESTRO_INTERNATIONAL';
23
+ const AMPERSAND_GE_MONEY_UK = 'AMPERSAND_GE_MONEY_UK';
24
 
25
  /**
26
  * Payment Method features
76
  self::AMPERSAND_LASER => false,
77
  self::AMPERSAND_DINERS_CLUB => false,
78
  self::AMPERSAND_VPAY => false,
79
+ self::AMPERSAND_CARTES_BLANCHE => false,
80
+ self::AMPERSAND_ENROUTE => false,
81
+ self::AMPERSAND_JAL => false,
82
+ self::AMPERSAND_DANKORT => false,
83
+ self::AMPERSAND_CARTE_BLEUE => false,
84
+ self::AMPERSAND_CARTA_SI => false,
85
+ self::AMPERSAND_MAESTRO_INTERNATIONAL => false,
86
+ self::AMPERSAND_GE_MONEY_UK => false,
87
  );
88
 
89
  /**
101
  self::AMPERSAND_LASER => '/^([0-9]{3}|[0-9]{4})?$/',
102
  self::AMPERSAND_DINERS_CLUB => '/^([0-9]{3}|[0-9]{4})?$/',
103
  self::AMPERSAND_VPAY => '/^([0-9]{3}|[0-9]{4})?$/',
104
+ self::AMPERSAND_CARTES_BLANCHE => '/^([0-9]{3}|[0-9]{4})?$/',
105
+ self::AMPERSAND_ENROUTE => '/^([0-9]{3}|[0-9]{4})?$/',
106
+ self::AMPERSAND_JAL => '/^([0-9]{3}|[0-9]{4})?$/',
107
+ self::AMPERSAND_DANKORT => '/^([0-9]{3}|[0-9]{4})?$/',
108
+ self::AMPERSAND_CARTE_BLEUE => '/^([0-9]{3}|[0-9]{4})?$/',
109
+ self::AMPERSAND_CARTA_SI => '/^([0-9]{3}|[0-9]{4})?$/',
110
+ self::AMPERSAND_MAESTRO_INTERNATIONAL => '/^([0-9]{3}|[0-9]{4})?$/',
111
+ self::AMPERSAND_GE_MONEY_UK => '/^([0-9]{3}|[0-9]{4})?$/',
112
  );
113
 
114
  /**
app/code/core/Ampersand/PaymentGateway/Model/Observer.php CHANGED
@@ -14,7 +14,7 @@ class Ampersand_PaymentGateway_Model_Observer
14
  return $this;
15
  }
16
 
17
- if (!$this->_getIsCustomerLoggedIn()) {
18
  return $this;
19
  }
20
 
@@ -102,12 +102,12 @@ class Ampersand_PaymentGateway_Model_Observer
102
  return $this;
103
  }
104
 
105
- if (!$this->_getSubscriptionHelper()->getSubscriptionData('active')) {
106
- return $this;
107
  }
108
 
109
- if (!$this->_getIsCustomerLoggedIn()) {
110
- return;
111
  }
112
 
113
  $methods = $block->getMethods();
@@ -153,15 +153,14 @@ class Ampersand_PaymentGateway_Model_Observer
153
  }
154
 
155
  /**
156
- * Determine whether a customer is currently logged in.
157
  *
158
- * @return bool
159
  * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
160
  */
161
- protected function _getIsCustomerLoggedIn()
162
  {
163
- $customer = Mage::getSingleton('customer/session')->getCustomer();
164
- return (($customer instanceof Mage_Customer_Model_Customer) && $customer->getId()) ? true : false;
165
  }
166
 
167
  /**
14
  return $this;
15
  }
16
 
17
+ if (!$this->_getHelper()->isLoggedInOrRegistering()) {
18
  return $this;
19
  }
20
 
102
  return $this;
103
  }
104
 
105
+ if (!$this->_getHelper()->isLoggedInOrRegistering()) {
106
+ return;
107
  }
108
 
109
+ if (!$this->_getSubscriptionHelper()->getSubscriptionData('active')) {
110
+ return $this;
111
  }
112
 
113
  $methods = $block->getMethods();
153
  }
154
 
155
  /**
156
+ * Retrieve the Payment Gateway helper.
157
  *
158
+ * @return Ampersand_PaymentGateway_Helper_Data
159
  * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
160
  */
161
+ protected function _getHelper()
162
  {
163
+ return Mage::helper('ampersand_paymentgateway/data');
 
164
  }
165
 
166
  /**
app/code/core/Ampersand/PaymentGateway/Model/Service/AgreementAbstract.php CHANGED
@@ -1,196 +1,11 @@
1
  <?php
2
  abstract class Ampersand_PaymentGateway_Model_Service_AgreementAbstract
3
- extends Ampersand_PaymentGateway_Model_Service_DirectAbstract
4
  {
5
  /**
6
- * This method is only ever called from
7
- * Mage_Sales_Billing_AgreementController::startWizardAction
8
- *
9
- * When using the Wizard, this method is called to define the redirect URL that the customer
10
- * will be sent to in order to create a new billing token.
11
- *
12
- * For direct we should redirect to our own controller for collecting card details.
13
- * For redirect we can forward the customer on to the payment gateway.
14
- *
15
- * The end of the process should be a post with the payment_method and token to
16
- * Mage_Sales_Billing_AgreementController::returnWizardAction
17
- *
18
- * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
19
- * @return Ampersand_PaymentGateway_Model_Service_AgreementAbstract
20
- * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
21
  */
22
- public function initBillingAgreementToken(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
23
- {
24
- return $this;
25
-
26
- // $api = $this->_pro->getApi()
27
- // ->setReturnUrl($agreement->getReturnUrl())
28
- // ->setCancelUrl($agreement->getCancelUrl())
29
- // ->setBillingType($this->_pro->getApi()->getBillingAgreementType());
30
- //
31
- // $api->callSetCustomerBillingAgreement();
32
- // $agreement->setRedirectUrl(
33
- // $this->_pro->getConfig()->getStartBillingAgreementUrl($api->getToken())
34
- // );
35
- // return $this;
36
- }
37
-
38
- /**
39
- * Don't really see the point of this method, since placeBillingAgreement() is
40
- * called immediately afterwards, we might as well put all of our logic in there...
41
- *
42
- * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
43
- * @return Ampersand_PaymentGateway_Model_Service_AgreementAbstract
44
- * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
45
- */
46
- public function getBillingAgreementTokenInfo(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
47
- {
48
- return $this;
49
- }
50
-
51
- /**
52
- * Create a billing agreement with the payment gateway.
53
- *
54
- * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
55
- * @return Ampersand_PaymentGateway_Model_Service_AgreementAbstract
56
- * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
57
- */
58
- public function placeBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
59
- {
60
- $this->setTransactionType($agreement->getTransactionType());
61
-
62
- $this->getAdapter()
63
- ->setPayment($agreement->getPayment())
64
- ->setOrder($agreement->getOrder())
65
- ->setResponse($agreement->getResponse());
66
-
67
- try {
68
- $this->getAdapter()->prepareBillingAgreementRequest();
69
- $this->_processServiceMessages();
70
- $this->_saveBillingAgreement($agreement);
71
- } catch (Exception $e) {
72
- // retrieve custom exception message if available
73
- if ($methodException = $this->_getMethodException($e)) {
74
- $e = $methodException;
75
- }
76
-
77
- // create a flag against the message
78
- $this->_updateMessageForFailure($e);
79
-
80
- // re-throw
81
- throw $e;
82
- }
83
-
84
- return $this;
85
- }
86
-
87
- /**
88
- * Cancel a billing agreement.
89
- *
90
- * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
91
- * @return Ampersand_PaymentGateway_Model_Service_AgreementAbstract
92
- * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
93
- */
94
- public function cancelBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
95
- {
96
- $this->setTransactionType(
97
- Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_MANAGE
98
- );
99
-
100
- // retrieve the additional information for this agreement
101
- $ampersandAgreement = Mage::getModel('ampersand_paymentgateway/agreement')
102
- ->loadByReferenceId($agreement->getMethodCode(), $agreement->getReferenceId());
103
- $this->getAdapter()->setAgreement($ampersandAgreement);
104
-
105
- try {
106
- $this->getAdapter()->prepareBillingAgreementCancel();
107
- $this->_processServiceMessages();
108
- } catch (Exception $e) {
109
- // retrieve custom exception message if available
110
- if ($methodException = $this->_getMethodException($e)) {
111
- $e = $methodException;
112
- }
113
-
114
- // create a flag against the message
115
- $this->_updateMessageForFailure($e);
116
-
117
- // re-throw
118
- throw $e;
119
- }
120
-
121
- return $this;
122
- }
123
-
124
- /**
125
- * Save the billing agreement data for use in future transactions,
126
- * linked to the Magento billing agreement by a unique reference ID.
127
- *
128
- * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
129
- * @return Ampersand_PaymentGateway_Model_Service_AgreementAbstract
130
- * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
131
- */
132
- protected function _saveBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
133
- {
134
- $agreement->setBillingAgreementId($this->_generateBillingAgreementId($agreement));
135
- $agreementCredentials = $this->getAdapter()->getBillingAgreementCredentials();
136
- $agreementCredentialsObject = new Ampersand_Object($agreementCredentials);
137
-
138
- /**
139
- * @todo this is not so black and white as Direct vs Redirect, since Direct methods
140
- * might have the agreement data returned in the AUTH response, but OK for now...
141
- *
142
- * Need a better way of retrieving this information...
143
- */
144
- switch ($agreement->getTransactionType()) {
145
- case Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_CREATE_DIRECT:
146
- $cardType = $agreement->getPayment()->getCcType();
147
- $cardLastFour = $agreement->getPayment()->getCcLast4();
148
- $cardExpiryMonth = str_pad($agreement->getPayment()->getCcExpMonth(), 2, 0, STR_PAD_LEFT);
149
- $cardExpiryYear = $agreement->getPayment()->getCcExpYear();
150
- break;
151
-
152
- case Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_CREATE_REDIRECT:
153
- $cardType = $agreementCredentialsObject->getCcType();
154
- $cardLastFour = $agreementCredentialsObject->getCcLast4();
155
- $cardExpiryMonth = $agreementCredentialsObject->getCcExpMonth();
156
- $cardExpiryYear = $agreementCredentialsObject->getCcExpYear();
157
- break;
158
-
159
- default:
160
- throw new Exception('Invalid transaction type provided.');
161
- break;
162
- }
163
-
164
- Mage::getModel('ampersand_paymentgateway/agreement')
165
- ->setServiceCode($agreement->getMethodCode())
166
- ->setReferenceId($agreement->getBillingAgreementId())
167
- ->setCustomerId($agreement->getCustomer()->getId())
168
- ->setStoreId($agreement->getStoreId())
169
- ->setAdditionalInformation($agreementCredentials)
170
- ->setCardType($cardType)
171
- ->setCardLastFour($cardLastFour)
172
- ->setCardExpiryMonth($cardExpiryMonth)
173
- ->setCardExpiryYear($cardExpiryYear)
174
- ->save();
175
-
176
- return $this;
177
- }
178
-
179
- /**
180
- * Generate a unique billing agreemend reference for a customer and card combination.
181
- * The maximum length of the billing agreement ID is 32 characters.
182
- *
183
- * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
184
- * @return string
185
- * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
186
- */
187
- protected function _generateBillingAgreementId(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
188
- {
189
- $billingAgreementId = '';
190
- $billingAgreementId .= time() . '-';
191
- $billingAgreementId .= $agreement->getCustomer()->getId() . '-';
192
- $billingAgreementId .= mt_rand(11111111, 99999999);
193
-
194
- return $billingAgreementId;
195
- }
196
  }
1
  <?php
2
  abstract class Ampersand_PaymentGateway_Model_Service_AgreementAbstract
3
+ extends Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
4
  {
5
  /**
6
+ * Note: Temporarily including this proxy class for backward compatability.
7
+ * This class will eventually be removed so please use one of these instead:
8
+ * - Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
9
+ * - Ampersand_PaymentGateway_Model_Service_Redirect_AgreementAbstract
 
 
 
 
 
 
 
 
 
 
 
10
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  }
app/code/core/Ampersand/PaymentGateway/Model/Service/Direct/AgreementAbstract.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ abstract class Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
3
+ extends Ampersand_PaymentGateway_Model_Service_DirectAbstract
4
+ {
5
+ /**
6
+ * This method is only ever called from
7
+ * Mage_Sales_Billing_AgreementController::startWizardAction
8
+ *
9
+ * When using the Wizard, this method is called to define the redirect URL that the customer
10
+ * will be sent to in order to create a new billing token.
11
+ *
12
+ * For direct we should redirect to our own controller for collecting card details.
13
+ * For redirect we can forward the customer on to the payment gateway.
14
+ *
15
+ * The end of the process should be a post with the payment_method and token to
16
+ * Mage_Sales_Billing_AgreementController::returnWizardAction
17
+ *
18
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
19
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
20
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
21
+ */
22
+ public function initBillingAgreementToken(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
23
+ {
24
+ return $this;
25
+
26
+ // $api = $this->_pro->getApi()
27
+ // ->setReturnUrl($agreement->getReturnUrl())
28
+ // ->setCancelUrl($agreement->getCancelUrl())
29
+ // ->setBillingType($this->_pro->getApi()->getBillingAgreementType());
30
+ //
31
+ // $api->callSetCustomerBillingAgreement();
32
+ // $agreement->setRedirectUrl(
33
+ // $this->_pro->getConfig()->getStartBillingAgreementUrl($api->getToken())
34
+ // );
35
+ // return $this;
36
+ }
37
+
38
+ /**
39
+ * Don't really see the point of this method, since placeBillingAgreement() is
40
+ * called immediately afterwards, we might as well put all of our logic in there...
41
+ *
42
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
43
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
44
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
45
+ */
46
+ public function getBillingAgreementTokenInfo(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
47
+ {
48
+ return $this;
49
+ }
50
+
51
+ /**
52
+ * Create a billing agreement with the payment gateway.
53
+ *
54
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
55
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
56
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
57
+ */
58
+ public function placeBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
59
+ {
60
+ $this->setTransactionType($agreement->getTransactionType());
61
+
62
+ $this->getAdapter()
63
+ ->setPayment($agreement->getPayment())
64
+ ->setOrder($agreement->getOrder())
65
+ ->setResponse($agreement->getResponse());
66
+
67
+ try {
68
+ $this->getAdapter()->prepareBillingAgreementRequest();
69
+ $this->_processServiceMessages();
70
+ $this->_saveBillingAgreement($agreement);
71
+ } catch (Exception $e) {
72
+ // retrieve custom exception message if available
73
+ if ($methodException = $this->_getMethodException($e)) {
74
+ $e = $methodException;
75
+ }
76
+
77
+ // create a flag against the message
78
+ $this->_updateMessageForFailure($e);
79
+
80
+ // re-throw
81
+ throw $e;
82
+ }
83
+
84
+ return $this;
85
+ }
86
+
87
+ /**
88
+ * Cancel a billing agreement.
89
+ *
90
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
91
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
92
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
93
+ */
94
+ public function cancelBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
95
+ {
96
+ $this->setTransactionType(
97
+ Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_MANAGE
98
+ );
99
+
100
+ // retrieve the additional information for this agreement
101
+ $ampersandAgreement = Mage::getModel('ampersand_paymentgateway/agreement')
102
+ ->loadByReferenceId($agreement->getMethodCode(), $agreement->getReferenceId());
103
+ $this->getAdapter()->setAgreement($ampersandAgreement);
104
+
105
+ try {
106
+ $this->getAdapter()->prepareBillingAgreementCancel();
107
+ $this->_processServiceMessages();
108
+ } catch (Exception $e) {
109
+ // retrieve custom exception message if available
110
+ if ($methodException = $this->_getMethodException($e)) {
111
+ $e = $methodException;
112
+ }
113
+
114
+ // create a flag against the message
115
+ $this->_updateMessageForFailure($e);
116
+
117
+ // re-throw
118
+ throw $e;
119
+ }
120
+
121
+ return $this;
122
+ }
123
+
124
+ /**
125
+ * Save the billing agreement data for use in future transactions,
126
+ * linked to the Magento billing agreement by a unique reference ID.
127
+ *
128
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
129
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
130
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
131
+ */
132
+ protected function _saveBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
133
+ {
134
+ $agreement->setBillingAgreementId($this->_generateBillingAgreementId($agreement));
135
+ $agreementCredentials = $this->getAdapter()->getBillingAgreementCredentials();
136
+ $agreementCredentialsObject = new Ampersand_Object($agreementCredentials);
137
+
138
+ /**
139
+ * @todo this is not so black and white as Direct vs Redirect, since Direct methods
140
+ * might have the agreement data returned in the AUTH response, but OK for now...
141
+ *
142
+ * Need a better way of retrieving this information...
143
+ */
144
+ switch ($agreement->getTransactionType()) {
145
+ case Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_CREATE_DIRECT:
146
+ $cardType = $agreement->getPayment()->getCcType();
147
+ $cardLastFour = $agreement->getPayment()->getCcLast4();
148
+ $cardExpiryMonth = str_pad($agreement->getPayment()->getCcExpMonth(), 2, 0, STR_PAD_LEFT);
149
+ $cardExpiryYear = $agreement->getPayment()->getCcExpYear();
150
+ break;
151
+
152
+ case Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_CREATE_REDIRECT:
153
+ $cardType = $agreementCredentialsObject->getCcType();
154
+ $cardLastFour = $agreementCredentialsObject->getCcLast4();
155
+ $cardExpiryMonth = $agreementCredentialsObject->getCcExpMonth();
156
+ $cardExpiryYear = $agreementCredentialsObject->getCcExpYear();
157
+ break;
158
+
159
+ default:
160
+ throw new Exception('Invalid transaction type provided.');
161
+ break;
162
+ }
163
+
164
+ Mage::getModel('ampersand_paymentgateway/agreement')
165
+ ->setServiceCode($agreement->getMethodCode())
166
+ ->setReferenceId($agreement->getBillingAgreementId())
167
+ ->setCustomerId($agreement->getCustomer()->getId())
168
+ ->setStoreId($agreement->getStoreId())
169
+ ->setAdditionalInformation($agreementCredentials)
170
+ ->setCardType($cardType)
171
+ ->setCardLastFour($cardLastFour)
172
+ ->setCardExpiryMonth($cardExpiryMonth)
173
+ ->setCardExpiryYear($cardExpiryYear)
174
+ ->save();
175
+
176
+ return $this;
177
+ }
178
+
179
+ /**
180
+ * Generate a unique billing agreemend reference for a customer and card combination.
181
+ * The maximum length of the billing agreement ID is 32 characters.
182
+ *
183
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
184
+ * @return string
185
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
186
+ */
187
+ protected function _generateBillingAgreementId(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
188
+ {
189
+ $billingAgreementId = '';
190
+ $billingAgreementId .= time() . '-';
191
+ $billingAgreementId .= $agreement->getCustomer()->getId() . '-';
192
+ $billingAgreementId .= mt_rand(11111111, 99999999);
193
+
194
+ return $billingAgreementId;
195
+ }
196
+ }
app/code/core/Ampersand/PaymentGateway/Model/Service/Redirect/AgreementAbstract.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ abstract class Ampersand_PaymentGateway_Model_Service_Redirect_AgreementAbstract
3
+ extends Ampersand_PaymentGateway_Model_Service_RedirectAbstract
4
+ {
5
+ /**
6
+ * This method is only ever called from
7
+ * Mage_Sales_Billing_AgreementController::startWizardAction
8
+ *
9
+ * When using the Wizard, this method is called to define the redirect URL that the customer
10
+ * will be sent to in order to create a new billing token.
11
+ *
12
+ * For direct we should redirect to our own controller for collecting card details.
13
+ * For redirect we can forward the customer on to the payment gateway.
14
+ *
15
+ * The end of the process should be a post with the payment_method and token to
16
+ * Mage_Sales_Billing_AgreementController::returnWizardAction
17
+ *
18
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
19
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
20
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
21
+ */
22
+ public function initBillingAgreementToken(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
23
+ {
24
+ return $this;
25
+
26
+ // $api = $this->_pro->getApi()
27
+ // ->setReturnUrl($agreement->getReturnUrl())
28
+ // ->setCancelUrl($agreement->getCancelUrl())
29
+ // ->setBillingType($this->_pro->getApi()->getBillingAgreementType());
30
+ //
31
+ // $api->callSetCustomerBillingAgreement();
32
+ // $agreement->setRedirectUrl(
33
+ // $this->_pro->getConfig()->getStartBillingAgreementUrl($api->getToken())
34
+ // );
35
+ // return $this;
36
+ }
37
+
38
+ /**
39
+ * Don't really see the point of this method, since placeBillingAgreement() is
40
+ * called immediately afterwards, we might as well put all of our logic in there...
41
+ *
42
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
43
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
44
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
45
+ */
46
+ public function getBillingAgreementTokenInfo(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
47
+ {
48
+ return $this;
49
+ }
50
+
51
+ /**
52
+ * Create a billing agreement with the payment gateway.
53
+ *
54
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
55
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
56
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
57
+ */
58
+ public function placeBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
59
+ {
60
+ $this->setTransactionType($agreement->getTransactionType());
61
+
62
+ $this->getAdapter()
63
+ ->setPayment($agreement->getPayment())
64
+ ->setOrder($agreement->getOrder())
65
+ ->setResponse($agreement->getResponse());
66
+
67
+ try {
68
+ $this->getAdapter()->prepareBillingAgreementRequest();
69
+ $this->_processServiceMessages();
70
+ $this->_saveBillingAgreement($agreement);
71
+ } catch (Exception $e) {
72
+ // retrieve custom exception message if available
73
+ if ($methodException = $this->_getMethodException($e)) {
74
+ $e = $methodException;
75
+ }
76
+
77
+ // create a flag against the message
78
+ $this->_updateMessageForFailure($e);
79
+
80
+ // re-throw
81
+ throw $e;
82
+ }
83
+
84
+ return $this;
85
+ }
86
+
87
+ /**
88
+ * Cancel a billing agreement.
89
+ *
90
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
91
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
92
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
93
+ */
94
+ public function cancelBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
95
+ {
96
+ $this->setTransactionType(
97
+ Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_MANAGE
98
+ );
99
+
100
+ // retrieve the additional information for this agreement
101
+ $ampersandAgreement = Mage::getModel('ampersand_paymentgateway/agreement')
102
+ ->loadByReferenceId($agreement->getMethodCode(), $agreement->getReferenceId());
103
+ $this->getAdapter()->setAgreement($ampersandAgreement);
104
+
105
+ try {
106
+ $this->getAdapter()->prepareBillingAgreementCancel();
107
+ $this->_processServiceMessages();
108
+ } catch (Exception $e) {
109
+ // retrieve custom exception message if available
110
+ if ($methodException = $this->_getMethodException($e)) {
111
+ $e = $methodException;
112
+ }
113
+
114
+ // create a flag against the message
115
+ $this->_updateMessageForFailure($e);
116
+
117
+ // re-throw
118
+ throw $e;
119
+ }
120
+
121
+ return $this;
122
+ }
123
+
124
+ /**
125
+ * Save the billing agreement data for use in future transactions,
126
+ * linked to the Magento billing agreement by a unique reference ID.
127
+ *
128
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
129
+ * @return Ampersand_PaymentGateway_Model_Service_Direct_AgreementAbstract
130
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
131
+ */
132
+ protected function _saveBillingAgreement(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
133
+ {
134
+ $agreement->setBillingAgreementId($this->_generateBillingAgreementId($agreement));
135
+ $agreementCredentials = $this->getAdapter()->getBillingAgreementCredentials();
136
+ $agreementCredentialsObject = new Ampersand_Object($agreementCredentials);
137
+
138
+ /**
139
+ * @todo this is not so black and white as Direct vs Redirect, since Direct methods
140
+ * might have the agreement data returned in the AUTH response, but OK for now...
141
+ *
142
+ * Need a better way of retrieving this information...
143
+ */
144
+ switch ($agreement->getTransactionType()) {
145
+ case Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_CREATE_DIRECT:
146
+ $cardType = $agreement->getPayment()->getCcType();
147
+ $cardLastFour = $agreement->getPayment()->getCcLast4();
148
+ $cardExpiryMonth = str_pad($agreement->getPayment()->getCcExpMonth(), 2, 0, STR_PAD_LEFT);
149
+ $cardExpiryYear = $agreement->getPayment()->getCcExpYear();
150
+ break;
151
+
152
+ case Ampersand_PaymentGateway_Model_Service_Abstract::TRANSACTION_TYPE_AGREEMENT_CREATE_REDIRECT:
153
+ $cardType = $agreementCredentialsObject->getCcType();
154
+ $cardLastFour = $agreementCredentialsObject->getCcLast4();
155
+ $cardExpiryMonth = $agreementCredentialsObject->getCcExpMonth();
156
+ $cardExpiryYear = $agreementCredentialsObject->getCcExpYear();
157
+ break;
158
+
159
+ default:
160
+ throw new Exception('Invalid transaction type provided.');
161
+ break;
162
+ }
163
+
164
+ Mage::getModel('ampersand_paymentgateway/agreement')
165
+ ->setServiceCode($agreement->getMethodCode())
166
+ ->setReferenceId($agreement->getBillingAgreementId())
167
+ ->setCustomerId($agreement->getCustomer()->getId())
168
+ ->setStoreId($agreement->getStoreId())
169
+ ->setAdditionalInformation($agreementCredentials)
170
+ ->setCardType($cardType)
171
+ ->setCardLastFour($cardLastFour)
172
+ ->setCardExpiryMonth($cardExpiryMonth)
173
+ ->setCardExpiryYear($cardExpiryYear)
174
+ ->save();
175
+
176
+ return $this;
177
+ }
178
+
179
+ /**
180
+ * Generate a unique billing agreemend reference for a customer and card combination.
181
+ * The maximum length of the billing agreement ID is 32 characters.
182
+ *
183
+ * @param Mage_Payment_Model_Billing_AgreementAbstract $agreement
184
+ * @return string
185
+ * @author Joseph McDermott <joseph.mcdermott@ampersandcommerce.com>
186
+ */
187
+ protected function _generateBillingAgreementId(Mage_Payment_Model_Billing_AgreementAbstract $agreement)
188
+ {
189
+ $billingAgreementId = '';
190
+ $billingAgreementId .= time() . '-';
191
+ $billingAgreementId .= $agreement->getCustomer()->getId() . '-';
192
+ $billingAgreementId .= mt_rand(11111111, 99999999);
193
+
194
+ return $billingAgreementId;
195
+ }
196
+ }
app/code/core/Ampersand/PaymentGateway/Model/Source/CardType.php CHANGED
@@ -24,6 +24,14 @@ class Ampersand_PaymentGateway_Model_Source_CardType extends Mage_Payment_Model_
24
  Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_LASER => 'Laser',
25
  Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_DINERS_CLUB => 'Diners Club',
26
  Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_VPAY => 'V Pay',
 
 
 
 
 
 
 
 
27
  );
28
 
29
  /**
24
  Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_LASER => 'Laser',
25
  Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_DINERS_CLUB => 'Diners Club',
26
  Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_VPAY => 'V Pay',
27
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_CARTES_BLANCHE => 'Carte Blanche',
28
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_ENROUTE => 'EnRoute',
29
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_JAL => 'JAL',
30
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_DANKORT => 'Dankort',
31
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_CARTE_BLEUE => 'Carte Bleue',
32
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_CARTA_SI => 'Carta Si',
33
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_MAESTRO_INTERNATIONAL => 'Maestro (International)',
34
+ Ampersand_PaymentGateway_Model_Method_DirectAbstract::AMPERSAND_GE_MONEY_UK => 'GE Money UK',
35
  );
36
 
37
  /**
app/code/core/Ampersand/PaymentGateway/changelog.txt CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  26/03/2013 - v0.1.11 - Moved Ampersand_PaymentGateway_Helper_Data::getLocaleCode() to its own method.
2
  Changed Ampersand_PaymentGateway_Model_Config_Abstract::getMode() to abstract.
3
 
1
+ 23/04/2013 - v0.1.14 - Updated Ampersand_PaymentGateway_Helper_Data::getDecimalPlaces() to no longer
2
+ rely on Zend_Locale_Data due to issues with libxml_disable_entity_loader().
3
+ Additional card types added.
4
+
5
+ 18/04/2013 - v0.1.13 - Allow billing agreement creation and subscriptions for register during checkout.
6
+
7
+ 16/04/2013 - v0.1.12 - Reverted Ampersand_PaymentGateway_Model_Service_AgreementAbstract back to two
8
+ separate abstracts for Direct and Redirect payment methods.
9
+
10
  26/03/2013 - v0.1.11 - Moved Ampersand_PaymentGateway_Helper_Data::getLocaleCode() to its own method.
11
  Changed Ampersand_PaymentGateway_Model_Config_Abstract::getMode() to abstract.
12
 
app/code/core/Ampersand/PaymentGateway/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ampersand_PaymentGateway>
5
- <version>0.1.11</version>
6
  </Ampersand_PaymentGateway>
7
  </modules>
8
  <global>
@@ -133,6 +133,51 @@
133
  <name>V Pay</name>
134
  <order>2010</order>
135
  </AMPERSAND_VPAY>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  </types>
137
  </cc>
138
  </payment>
@@ -268,6 +313,72 @@
268
  </ampersand_paymentgateway>
269
  </default>
270
  <ampersand_paymentgateway>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  <events>
272
 
273
  <!-- START: Mage_Downloadable frontend -->
2
  <config>
3
  <modules>
4
  <Ampersand_PaymentGateway>
5
+ <version>0.1.14</version>
6
  </Ampersand_PaymentGateway>
7
  </modules>
8
  <global>
133
  <name>V Pay</name>
134
  <order>2010</order>
135
  </AMPERSAND_VPAY>
136
+ <AMPERSAND_VPAY>
137
+ <code>AMPERSAND_VPAY</code>
138
+ <name>V Pay</name>
139
+ <order>2010</order>
140
+ </AMPERSAND_VPAY>
141
+ <AMPERSAND_CARTES_BLANCHE>
142
+ <code>AMPERSAND_CARTES_BLANCHE</code>
143
+ <name>Carte Blanche</name>
144
+ <order>2011</order>
145
+ </AMPERSAND_CARTES_BLANCHE>
146
+ <AMPERSAND_ENROUTE>
147
+ <code>AMPERSAND_ENROUTE</code>
148
+ <name>EnRoute</name>
149
+ <order>2012</order>
150
+ </AMPERSAND_ENROUTE>
151
+ <AMPERSAND_JAL>
152
+ <code>AMPERSAND_JAL</code>
153
+ <name>JAL</name>
154
+ <order>2013</order>
155
+ </AMPERSAND_JAL>
156
+ <AMPERSAND_DANKORT>
157
+ <code>AMPERSAND_DANKORT</code>
158
+ <name>Dankort</name>
159
+ <order>2014</order>
160
+ </AMPERSAND_DANKORT>
161
+ <AMPERSAND_CARTE_BLEUE>
162
+ <code>AMPERSAND_CARTE_BLEUE</code>
163
+ <name>Carte Bleue</name>
164
+ <order>2015</order>
165
+ </AMPERSAND_CARTE_BLEUE>
166
+ <AMPERSAND_CARTA_SI>
167
+ <code>AMPERSAND_CARTA_SI</code>
168
+ <name>Carta Si</name>
169
+ <order>2016</order>
170
+ </AMPERSAND_CARTA_SI>
171
+ <AMPERSAND_MAESTRO_INTERNATIONAL>
172
+ <code>AMPERSAND_MAESTRO_INTERNATIONAL</code>
173
+ <name>Maestro (International)</name>
174
+ <order>2017</order>
175
+ </AMPERSAND_MAESTRO_INTERNATIONAL>
176
+ <AMPERSAND_GE_MONEY_UK>
177
+ <code>AMPERSAND_GE_MONEY_UK</code>
178
+ <name>GE Money UK</name>
179
+ <order>2018</order>
180
+ </AMPERSAND_GE_MONEY_UK>
181
  </types>
182
  </cc>
183
  </payment>
313
  </ampersand_paymentgateway>
314
  </default>
315
  <ampersand_paymentgateway>
316
+ <!-- These decimal values are based on lib/Zend/Locale/Data/supplementalData.xml,
317
+ but referenced directly in here to avoid problems with libxml_disable_entity_loader -->
318
+ <currency_decimals>
319
+ <DEFAULT>2</DEFAULT>
320
+
321
+ <ADP>0</ADP>
322
+ <AFN>0</AFN>
323
+ <ALL>0</ALL>
324
+ <AMD>0</AMD>
325
+ <BHD>3</BHD>
326
+ <BIF>0</BIF>
327
+ <BYR>0</BYR>
328
+ <CLF>0</CLF>
329
+ <CLP>0</CLP>
330
+ <COP>0</COP>
331
+ <CRC>0</CRC>
332
+ <DJF>0</DJF>
333
+ <ESP>0</ESP>
334
+ <GNF>0</GNF>
335
+ <GYD>0</GYD>
336
+ <HUF>0</HUF>
337
+ <IDR>0</IDR>
338
+ <IQD>0</IQD>
339
+ <IRR>0</IRR>
340
+ <ISK>0</ISK>
341
+ <ITL>0</ITL>
342
+ <JOD>3</JOD>
343
+ <JPY>0</JPY>
344
+ <KMF>0</KMF>
345
+ <KPW>0</KPW>
346
+ <KRW>0</KRW>
347
+ <KWD>3</KWD>
348
+ <LAK>0</LAK>
349
+ <LBP>0</LBP>
350
+ <LUF>0</LUF>
351
+ <LYD>3</LYD>
352
+ <MGA>0</MGA>
353
+ <MGF>0</MGF>
354
+ <MMK>0</MMK>
355
+ <MNT>0</MNT>
356
+ <MRO>0</MRO>
357
+ <MUR>0</MUR>
358
+ <OMR>3</OMR>
359
+ <PKR>0</PKR>
360
+ <PYG>0</PYG>
361
+ <RSD>0</RSD>
362
+ <RWF>0</RWF>
363
+ <SLL>0</SLL>
364
+ <SOS>0</SOS>
365
+ <STD>0</STD>
366
+ <SYP>0</SYP>
367
+ <TMM>0</TMM>
368
+ <TND>3</TND>
369
+ <TRL>0</TRL>
370
+ <TZS>0</TZS>
371
+ <UGX>0</UGX>
372
+ <UZS>0</UZS>
373
+ <VND>0</VND>
374
+ <VUV>0</VUV>
375
+ <XAF>0</XAF>
376
+ <XOF>0</XOF>
377
+ <XPF>0</XPF>
378
+ <YER>0</YER>
379
+ <ZMK>0</ZMK>
380
+ <ZWD>0</ZWD>
381
+ </currency_decimals>
382
  <events>
383
 
384
  <!-- START: Mage_Downloadable frontend -->
app/design/frontend/base/default/template/ampersand_paymentgateway/checkout/cart/subscription.phtml CHANGED
@@ -1,45 +1,41 @@
1
  <?php if ($this->isActive()): ?>
2
- <?php if ($this->isLoggedIn()): ?>
3
- <div class="subscription">
4
- <h2><?php echo $this->__('Subscribe to this order') ?></h2>
5
- <form id="subscription-form" action="<?php echo $this->getUrl('ampersand_paymentgateway/checkout_cart_subscription/post') ?>" method="post">
6
- <fieldset>
7
- <input type="hidden" name="remove" id="remove-subscription" value="0" />
8
-
9
- <label for="period"><?php echo $this->__('Select your subscription period.') ?></label>
10
- <select name="period" id="period" title="<?php echo $this->__('Period') ?>" class="validate-select">
11
- <?php foreach ($this->getPeriods() as $_period): ?>
12
- <?php $_selected = ($_period['value'] == $this->getSubscriptionPeriod()) ? ' SELECTED' : ''; ?>
13
- <option value="<?php echo $_period['value']; ?>"<?php echo $_selected; ?>><?php echo $_period['label']; ?></option>
14
- <?php endforeach; ?>
15
- </select>
16
- <button type="button" class="button" onclick="subscriptionForm.submit(false)" value="<?php echo $this->__('Subscribe') ?>"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
17
-
18
- <?php if ($this->getSubscriptionPeriod()): ?>
19
- <button type="button" class="button cancel-btn" onclick="subscriptionForm.submit(true)" value="<?php echo $this->__('Cancel Subscription') ?>"><span><span><?php echo $this->__('Cancel Subscription') ?></span></span></button>
20
  <?php endif; ?>
21
- </fieldset>
22
- </form>
23
- <script type="text/javascript">
24
- //<![CDATA[
25
- var subscriptionForm = new VarienForm('subscription-form');
26
- subscriptionForm.submit = function (isRemove) {
27
- if (isRemove) {
28
- $('period').removeClassName('required-entry');
29
- $('remove-subscription').value = "1";
30
- } else {
31
- $('period').addClassName('required-entry');
32
- $('remove-subscription').value = "0";
33
- }
34
- return VarienForm.prototype.submit.bind(subscriptionForm)();
 
 
 
 
 
 
 
 
 
35
  }
36
- //]]>
37
- </script>
38
- </div>
39
- <?php else: ?>
40
- <div class="subscription">
41
- <h2><?php echo $this->__('Subscribe to this order') ?></h2>
42
- <p><?php echo $this->__('You must be logged in to subscribe.'); ?></p>
43
- </div>
44
- <?php endif; ?>
45
  <?php endif; ?>
1
  <?php if ($this->isActive()): ?>
2
+ <div class="subscription">
3
+ <h2><?php echo $this->__('Subscribe to this order') ?></h2>
4
+ <form id="subscription-form" action="<?php echo $this->getUrl('ampersand_paymentgateway/checkout_cart_subscription/post') ?>" method="post">
5
+ <fieldset>
6
+ <input type="hidden" name="remove" id="remove-subscription" value="0" />
7
+ <label for="period">
8
+ <?php echo $this->__('Select your subscription period.') ?>
9
+ <?php if (!$this->isLoggedIn()): ?>
10
+ <?php echo $this->__('Please note you must login beforehand or register during checkout.'); ?>
 
 
 
 
 
 
 
 
 
11
  <?php endif; ?>
12
+ </label>
13
+ <select name="period" id="period" title="<?php echo $this->__('Period') ?>" class="validate-select">
14
+ <?php foreach ($this->getPeriods() as $_period): ?>
15
+ <?php $_selected = ($_period['value'] == $this->getSubscriptionPeriod()) ? ' SELECTED' : ''; ?>
16
+ <option value="<?php echo $_period['value']; ?>"<?php echo $_selected; ?>><?php echo $_period['label']; ?></option>
17
+ <?php endforeach; ?>
18
+ </select>
19
+ <button type="button" class="button" onclick="subscriptionForm.submit(false)" value="<?php echo $this->__('Subscribe') ?>"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
20
+ <?php if ($this->getSubscriptionPeriod()): ?>
21
+ <button type="button" class="button cancel-btn" onclick="subscriptionForm.submit(true)" value="<?php echo $this->__('Cancel Subscription') ?>"><span><span><?php echo $this->__('Cancel Subscription') ?></span></span></button>
22
+ <?php endif; ?>
23
+ </fieldset>
24
+ </form>
25
+ <script type="text/javascript">
26
+ //<![CDATA[
27
+ var subscriptionForm = new VarienForm('subscription-form');
28
+ subscriptionForm.submit = function (isRemove) {
29
+ if (isRemove) {
30
+ $('period').removeClassName('required-entry');
31
+ $('remove-subscription').value = "1";
32
+ } else {
33
+ $('period').addClassName('required-entry');
34
+ $('remove-subscription').value = "0";
35
  }
36
+ return VarienForm.prototype.submit.bind(subscriptionForm)();
37
+ }
38
+ //]]>
39
+ </script>
40
+ </div>
 
 
 
 
41
  <?php endif; ?>
js/ampersand_paymentgateway/validation.js CHANGED
@@ -8,4 +8,12 @@ Validation.creditCartTypes.set('AMPERSAND_VISA_ELECTRON', [false, new RegExp('^(
8
  Validation.creditCartTypes.set('AMPERSAND_VISA_PURCHASING', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
9
  Validation.creditCartTypes.set('AMPERSAND_LASER', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
10
  Validation.creditCartTypes.set('AMPERSAND_DINERS_CLUB', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
11
- Validation.creditCartTypes.set('AMPERSAND_VPAY', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
 
 
 
 
 
 
 
 
8
  Validation.creditCartTypes.set('AMPERSAND_VISA_PURCHASING', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
9
  Validation.creditCartTypes.set('AMPERSAND_LASER', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
10
  Validation.creditCartTypes.set('AMPERSAND_DINERS_CLUB', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
11
+ Validation.creditCartTypes.set('AMPERSAND_VPAY', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
12
+ Validation.creditCartTypes.set('AMPERSAND_CARTES_BLANCHE', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
13
+ Validation.creditCartTypes.set('AMPERSAND_ENROUTE', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
14
+ Validation.creditCartTypes.set('AMPERSAND_JAL', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
15
+ Validation.creditCartTypes.set('AMPERSAND_DANKORT', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
16
+ Validation.creditCartTypes.set('AMPERSAND_CARTE_BLEUE', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
17
+ Validation.creditCartTypes.set('AMPERSAND_CARTA_SI', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
18
+ Validation.creditCartTypes.set('AMPERSAND_MAESTRO_INTERNATIONAL', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
19
+ Validation.creditCartTypes.set('AMPERSAND_GE_MONEY_UK', [false, new RegExp('^([0-9]{3}|[0-9]{4})?$'), true]);
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ampersand_PaymentGateway</name>
4
- <version>0.1.11</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Ampersand Payment Gateway framework from Ampersand Commerce.</summary>
10
  <description>Ampersand Payment Gateway framework from Ampersand Commerce.</description>
11
- <notes>Ampersand_PaymentGateway v0.1.11</notes>
12
  <authors><author><name>AmpersandHQ</name><user>auto-converted</user><email>magento@ampersandcommerce.com</email></author></authors>
13
- <date>2013-03-28</date>
14
- <time>11:25:02</time>
15
- <contents><target name="magelocal"><dir name="Ampersand"><dir name="BillingAgreementFix"><dir name="etc"><file name="config.xml" hash="182ff5f59378cb85f2e640dab93e1d91"/></dir><dir name="Rewrite"><dir name="Mage"><dir name="Sales"><dir name="Block"><dir name="Payment"><dir name="Form"><dir name="Billing"><file name="Agreement.php" hash="ba18d3e86edacc6455e84e682e100190"/></dir></dir></dir></dir><dir name="Model"><dir name="Billing"><file name="Agreement.php" hash="09122c7aad1b186ef87e9c79fee62940"/></dir></dir></dir><dir name="Paypal"><dir name="Helper"><file name="Data.php" hash="5eb5f7e6fcad4ff6e48e12c7d9517a7a"/></dir><dir name="Model"><dir name="Express"><file name="Checkout.php" hash="9572f6a8a94b851ea2b9f5f7caf1fee7"/></dir><dir name="Method"><file name="Agreement.php" hash="d35b02f584e0359fb12aa685b1bc94a1"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magecore"><dir name="Ampersand"><dir name="PaymentGateway"><dir name="Block"><dir name="Redirect"><file name="Iframe.php" hash="b896215490bb40fdbe3a50b45f73ec7b"/><file name="Form.php" hash="d27999a0f4f1263d11dff3b4d2894368"/><file name="Location.php" hash="aabfaf8543541d11a098145f83d3e294"/></dir><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="389f6fc34bb33b049a6372a68a0f52f7"/></dir></dir></dir><dir name="Subscription"><dir name="Order"><file name="Grid.php" hash="4c1df2f20be9af3c4a0754cb1761ba48"/></dir><dir name="Edit"><file name="Form.php" hash="e070aa1106a6efb043313e959ac06195"/></dir><file name="Order.php" hash="493baa23d6c205002f06f26f49b84852"/><file name="Edit.php" hash="0bc4ad5fa46cd02740fb64c027502eed"/><file name="Grid.php" hash="a64d41c912d31995f2fc0fef37922773"/></dir><file name="Subscription.php" hash="5820166cc7762b370644936a01d51530"/></dir><dir name="Checkout"><dir name="Onepage"><dir name="Review"><file name="Subscription.php" hash="888e9b4af5749dfa58f31087591eab18"/></dir></dir><dir name="Cart"><file name="Subscription.php" hash="aefee3bff9660b4a360d8a0928c7cc46"/></dir></dir><dir name="Payment"><dir name="Form"><file name="BillingAgreementCheckbox.php" hash="2057de4e06ca0c92ccfe149e39e4df11"/><file name="Subscription.php" hash="c0c27e0802aab6bf98e0e6dc60f598d7"/><file name="Redirect.php" hash="7a0db3f83604c4bae31e49694d14d362"/><file name="BillingAgreement.php" hash="f022d1358e33976ccbd97629535a3dbb"/><file name="BillingAgreementCv2.php" hash="d402e86f22f044bc2b438d0f8370106c"/></dir><dir name="Info"><file name="Redirect.php" hash="befe27b6d3a0bad1dd79d9698d15ea16"/></dir></dir><dir name="Customer"><dir name="Account"><file name="Subscription.php" hash="fa70122cb56980ccb5b1d2ccd12fc8a8"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="16c35ebeecaac1fdfb78b39fbfef8877"/><file name="config.xml" hash="ec5aa9fd838b51eeb58676c540317cff"/><file name="system.xml" hash="75b5da153055775011114c74881637df"/></dir><dir name="sql"><dir name="ampersand_paymentgateway_setup"><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="b96f410245acdab1bac40be098cdf4ce"/><file name="mysql4-upgrade-0.0.9-0.0.10.php" hash="38eef68653f1a67fde4a2052d7689026"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="cd17a587f66e754b93038ba15aedf3a6"/><file name="mysql4-upgrade-0.0.12-0.0.13.php" hash="518960f36caf0083ba21657a18e08ccf"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="10082a8a8f0c087de164e99cf98f0f57"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="2bd23a19b2f5f95c317422965fc28e47"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="1c86fbd3c84be59c3c04a74e6f7d52c2"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="dc0db40ddef773f24aca9dbf3ad39029"/><file name="mysql4-upgrade-0.0.8-0.0.9.php" hash="9e5e4daa4696083b1a2ce899c7b10a7c"/><file name="mysql4-install-0.0.1.php" hash="6496424212e5efd6e4cc5475b0daef07"/><file name="mysql4-upgrade-0.0.11-0.0.12.php" hash="d395b9cf9f98d8aeefd0d5817e3fd819"/><file name="mysql4-upgrade-0.0.10-0.0.11.php" hash="f29952c10a05f075d8afb73fd0d2468f"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="b43beea075582cfa471dd4ce2ec394ce"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="04f939ff1119ef282290256eb58229d9"/><file name="mysql4-upgrade-0.0.13-0.0.14.php" hash="a5bb6ff4cccb9e6302c6a0cd6ffd77e3"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="be5b9b7f8dd33f211ae7c16ee1028dce"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Subscription"><file name="OrderController.php" hash="ddf95460175eccc37243df6e735290bc"/></dir><file name="SubscriptionController.php" hash="07bd75822d2bb18b953fca59ea9fc597"/></dir><dir name="Checkout"><dir name="Cart"><file name="SubscriptionController.php" hash="a7f345974379aff4803449df8c8cbf70"/></dir><file name="OnepageController.php" hash="21b5e60937833c31bcb9e0a136ced557"/></dir><dir name="Customer"><dir name="Account"><file name="SubscriptionController.php" hash="0a42fdbb7fd147f39e89c1f30e95ffee"/></dir></dir><file name="RedirectController.php" hash="35364646b7e0575e4e8c94d20f64bbc5"/></dir><dir name="Helper"><file name="Subscription.php" hash="1ae9df0ec8d95a679f61b07233f275f7"/><file name="Data.php" hash="ff4b7674ec527189de94a8893bbeeb93"/></dir><dir name="Model"><dir name="Exception"><file name="Error.php" hash="4ac369ee913575b427c6d15ff60ca27c"/><file name="DenyPayment.php" hash="b0c0b45291d220e490526ffd68e8dfc4"/></dir><dir name="Utility"><file name="Order.php" hash="47808179695d5896ec57e04cd64a7a9f"/><file name="Subscription.php" hash="d03077eaf0873032cc5380b4574aea5a"/><file name="Encryptor.php" hash="8f03d6b76461d3700fadb2ce312c2e47"/></dir><dir name="Resource"><dir name="Encryptor"><file name="Collection.php" hash="852cfd93886da3e76f3c45acde4595b5"/></dir><dir name="Subscription"><dir name="Order"><file name="Collection.php" hash="9794d1183d0ffc7ce313e74170330c07"/></dir><file name="Order.php" hash="2958956cff03a6358c648bf5ecea564e"/><file name="Collection.php" hash="d316d3cf47157d2b4cdf1e5d2873ac08"/></dir><dir name="Agreement"><file name="Collection.php" hash="8eb8fca6c042fe9bfd196cbbf64996f1"/></dir><dir name="Transaction"><file name="Collection.php" hash="8b7be054183ad76cfb9c6b7c27595fbc"/></dir><dir name="PaymentInfo"><file name="Collection.php" hash="023bad0d605c3fa8fc6e91d1b71f1711"/></dir><file name="PaymentInfo.php" hash="f093013cafdf4e90a373b465fb1e09ad"/><file name="Agreement.php" hash="dcfc1ec7df22bd0ce24b64d332021e5a"/><file name="Subscription.php" hash="f5f927e1793f44fa384eb2aead41ee81"/><file name="Transaction.php" hash="7ca37cc46a5b24faa7658a61e47633e2"/><file name="Encryptor.php" hash="3b1628a7ec59b5bd25280d9236ce94dc"/></dir><dir name="Compatibility"><dir name="Mage"><dir name="Sales"><dir name="Model"><dir name="Order"><file name="Payment.php" hash="25de73c00d619ec65c2696906b35dfad"/></dir></dir></dir></dir></dir><dir name="Service"><file name="RedirectAbstract.php" hash="fc6a896415cbbad9a8b04b221b9d514e"/><file name="AgreementAbstract.php" hash="89b0c49ed0f4cf0d6c12b2b51a4e9ae8"/><file name="Abstract.php" hash="93c2146fe9a5dea06d9f293c7e8c4dd6"/><file name="DirectAbstract.php" hash="541f1cbce88d781bed2e7f04f7453945"/></dir><dir name="Subscription"><file name="Order.php" hash="07c91afd16d567c6dcddee9374be97c8"/></dir><dir name="Method"><file name="RedirectAbstract.php" hash="fed166e8061a60c3730ace82612b343f"/><file name="AgreementAbstract.php" hash="73f51504d57b40de32a985e9c6d44465"/><file name="DirectAbstract.php" hash="41b092dfb0cfde9416d391c9e4b95ee5"/></dir><dir name="Adapter"><dir name="Redirect"><file name="AuthCaptureInterface.php" hash="df746c0af2ebd7cec75393a7823395a6"/><file name="RefundInterface.php" hash="47b73ff9f4df8898169ceb6806e56e11"/><file name="PartialInterface.php" hash="0202182d017adcc232158f1d334963fa"/></dir><dir name="Direct"><file name="AuthCaptureInterface.php" hash="f4b252722efbd660bb51a81f6ddb89ba"/><file name="RefundInterface.php" hash="b9c08aaeff738595107db65b2b578644"/><file name="PartialInterface.php" hash="86782fa288b08fbaae0b15aaab314ad6"/></dir><dir name="Agreement"><file name="ManageInterface.php" hash="53f3aa3d00f7dfff4b799282204f4847"/><file name="CreateInterface.php" hash="41d3011c099de9ae372f9bcf60c92053"/></dir><file name="Abstract.php" hash="c7c01b8094cda569501920b69921c287"/><file name="Interface.php" hash="887febfe4eafd98f285f9b6082462667"/></dir><dir name="Config"><file name="Abstract.php" hash="30b71035f384e350a2071e233e0d353c"/></dir><dir name="Source"><file name="PaymentAction.php" hash="d94d62d900aac83e8bba6fe5d3459a70"/><file name="SubscriptionPeriods.php" hash="fdab5f7c2fdbb5f389facf94b9dae123"/><file name="AgreementMethod.php" hash="56add32f8838ac9a169c64ed6baa3318"/><file name="OrderStatus.php" hash="8a84a227a49229162a0310d604529165"/><file name="EncryptorStorageType.php" hash="a44ee883c792f3c1af7e07d265ddb731"/><file name="CardType.php" hash="bd6a2cd7d4ed013b0a244d666291ca6f"/></dir><file name="Email.php" hash="e03cb77df1a3d0fec0da4ebe26af2221"/><file name="Versioning.php" hash="ccf112f9a2e0a0c70003895989d42752"/><file name="PaymentInfo.php" hash="9a4bf37468dc68b7f1300bdfd1f0080c"/><file name="Agreement.php" hash="f595fcd31730466fc8d11589d1e93f15"/><file name="Subscription.php" hash="0b8078fd132bd6290714aad293dfb332"/><file name="Transaction.php" hash="971544deae8e8cc4036e1f2fe9685435"/><file name="Encryptor.php" hash="47a3d09aa175bc6d1327c7763eca4815"/><file name="Cron.php" hash="26fe7436ec01dbbc989587f8315dc6bf"/><file name="Observer.php" hash="28c83f6de3c499407ba64a22286f06c3"/></dir><file name="changelog.txt" hash="07bd88ebb58159d98028f98008b9fca8"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ampersand_paymentgateway.xml" hash="3b70309300dfed71a62b73578869fc5d"/></dir><dir name="template"><dir name="ampersand_paymentgateway"><dir name="customer"><dir name="account"><file name="subscription.phtml" hash="73825035ff1e2b1bf17f85502317acc9"/></dir></dir><dir name="redirect"><file name="iframe.phtml" hash="129820e210e01662bab8afd5f24fac7d"/><file name="location.phtml" hash="aef0c86a5dea767c81b287b7ba8551d0"/><file name="form.phtml" hash="34118190ed5afa15cd4e9b3376239867"/></dir><dir name="payment"><dir name="form"><file name="billing-agreement-cv2.phtml" hash="f41a166c9d7b9b6cb780e0304890504b"/><file name="billing-agreement-checkbox.phtml" hash="57c5e2d3813acaaf6c054adb5cfd0d5f"/><file name="redirect.phtml" hash="1decc25cf3907d7ef05be8748aea6322"/></dir></dir><dir name="sales"><dir name="payment"><dir name="form"><dir name="billing"><file name="agreement.phtml" hash="fc256f93338c1a244efb0a74a27e11fb"/></dir></dir></dir></dir><dir name="checkout"><dir name="cart"><file name="subscription.phtml" hash="0bf84cb7a162e8b4936e261752b6c20e"/></dir><dir name="onepage"><dir name="review"><file name="subscription.phtml" hash="f3cc1076c65ee3ae0e959888b39b54c1"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="ampersand_paymentgateway.xml" hash="b7dfcf1a57cf6d79d261ad91d266db2e"/></dir><dir name="template"><dir name="ampersand_paymentgateway"><dir name="payment"><dir name="info"><file name="payment-info.phtml" hash="be724367a7a703c70e2024ab1d4b28fc"/></dir></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="3f10f63632a280153a96ec9f90784568"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ampersand_PaymentGateway.xml" hash="80480a17487715a70e009757cd3c3dfe"/><file name="Ampersand_BillingAgreementFix.xml" hash="1d213328275ec29e62a7f580b7926604"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="ampersand_paymentgateway"><file name="subscription_reminder.html" hash="79262315a694fcb63de89baf66ef6ce6"/><file name="notification.html" hash="dea93b8b048571ac1a527260838b15fd"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="ampersand_paymentgateway"><dir name="css"><file name="checkout.css" hash="dfa4f36777bb549531f550d32e25d96e"/><file name="cart.css" hash="65dc2c9e22a28242060f23871af9c38e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="ampersand_paymentgateway"><dir name="images"><file name="logo.gif" hash="098947bdb00786d3632235ff1cebb9c6"/></dir><dir name="css"><file name="styles.css" hash="476b0d182c430f90f8c3d887c45c3e91"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="ampersand_paymentgateway"><file name="validation.js" hash="33042d5bd59da47ea0ba00af24f86894"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ampersand_PaymentGateway</name>
4
+ <version>0.1.14</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Ampersand Payment Gateway framework from Ampersand Commerce.</summary>
10
  <description>Ampersand Payment Gateway framework from Ampersand Commerce.</description>
11
+ <notes>Ampersand_PaymentGateway v0.1.14</notes>
12
  <authors><author><name>AmpersandHQ</name><user>auto-converted</user><email>magento@ampersandcommerce.com</email></author></authors>
13
+ <date>2013-04-23</date>
14
+ <time>12:48:26</time>
15
+ <contents><target name="magelocal"><dir name="Ampersand"><dir name="BillingAgreementFix"><dir name="etc"><file name="config.xml" hash="182ff5f59378cb85f2e640dab93e1d91"/></dir><dir name="Rewrite"><dir name="Mage"><dir name="Sales"><dir name="Block"><dir name="Payment"><dir name="Form"><dir name="Billing"><file name="Agreement.php" hash="ba18d3e86edacc6455e84e682e100190"/></dir></dir></dir></dir><dir name="Model"><dir name="Billing"><file name="Agreement.php" hash="09122c7aad1b186ef87e9c79fee62940"/></dir></dir></dir><dir name="Paypal"><dir name="Helper"><file name="Data.php" hash="5eb5f7e6fcad4ff6e48e12c7d9517a7a"/></dir><dir name="Model"><dir name="Express"><file name="Checkout.php" hash="9572f6a8a94b851ea2b9f5f7caf1fee7"/></dir><dir name="Method"><file name="Agreement.php" hash="d35b02f584e0359fb12aa685b1bc94a1"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magecore"><dir name="Ampersand"><dir name="PaymentGateway"><dir name="Block"><dir name="Redirect"><file name="Iframe.php" hash="b896215490bb40fdbe3a50b45f73ec7b"/><file name="Form.php" hash="d27999a0f4f1263d11dff3b4d2894368"/><file name="Location.php" hash="aabfaf8543541d11a098145f83d3e294"/></dir><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="389f6fc34bb33b049a6372a68a0f52f7"/></dir></dir></dir><dir name="Subscription"><dir name="Order"><file name="Grid.php" hash="4c1df2f20be9af3c4a0754cb1761ba48"/></dir><dir name="Edit"><file name="Form.php" hash="e070aa1106a6efb043313e959ac06195"/></dir><file name="Order.php" hash="493baa23d6c205002f06f26f49b84852"/><file name="Edit.php" hash="0bc4ad5fa46cd02740fb64c027502eed"/><file name="Grid.php" hash="a64d41c912d31995f2fc0fef37922773"/></dir><file name="Subscription.php" hash="5820166cc7762b370644936a01d51530"/></dir><dir name="Checkout"><dir name="Onepage"><dir name="Review"><file name="Subscription.php" hash="888e9b4af5749dfa58f31087591eab18"/></dir></dir><dir name="Cart"><file name="Subscription.php" hash="aefee3bff9660b4a360d8a0928c7cc46"/></dir></dir><dir name="Payment"><dir name="Form"><file name="BillingAgreementCheckbox.php" hash="2057de4e06ca0c92ccfe149e39e4df11"/><file name="Subscription.php" hash="c0c27e0802aab6bf98e0e6dc60f598d7"/><file name="Redirect.php" hash="7a0db3f83604c4bae31e49694d14d362"/><file name="BillingAgreement.php" hash="f022d1358e33976ccbd97629535a3dbb"/><file name="BillingAgreementCv2.php" hash="d402e86f22f044bc2b438d0f8370106c"/></dir><dir name="Info"><file name="Redirect.php" hash="befe27b6d3a0bad1dd79d9698d15ea16"/></dir></dir><dir name="Customer"><dir name="Account"><file name="Subscription.php" hash="fa70122cb56980ccb5b1d2ccd12fc8a8"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="16c35ebeecaac1fdfb78b39fbfef8877"/><file name="config.xml" hash="9ee1bf63d8df32c9def99e66e2f5d3f2"/><file name="system.xml" hash="75b5da153055775011114c74881637df"/></dir><dir name="sql"><dir name="ampersand_paymentgateway_setup"><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="b96f410245acdab1bac40be098cdf4ce"/><file name="mysql4-upgrade-0.0.9-0.0.10.php" hash="38eef68653f1a67fde4a2052d7689026"/><file name="mysql4-upgrade-0.0.2-0.0.3.php" hash="cd17a587f66e754b93038ba15aedf3a6"/><file name="mysql4-upgrade-0.0.12-0.0.13.php" hash="518960f36caf0083ba21657a18e08ccf"/><file name="mysql4-upgrade-0.0.5-0.0.6.php" hash="10082a8a8f0c087de164e99cf98f0f57"/><file name="mysql4-upgrade-0.0.7-0.0.8.php" hash="2bd23a19b2f5f95c317422965fc28e47"/><file name="mysql4-upgrade-0.0.4-0.0.5.php" hash="1c86fbd3c84be59c3c04a74e6f7d52c2"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="dc0db40ddef773f24aca9dbf3ad39029"/><file name="mysql4-upgrade-0.0.8-0.0.9.php" hash="9e5e4daa4696083b1a2ce899c7b10a7c"/><file name="mysql4-install-0.0.1.php" hash="6496424212e5efd6e4cc5475b0daef07"/><file name="mysql4-upgrade-0.0.11-0.0.12.php" hash="d395b9cf9f98d8aeefd0d5817e3fd819"/><file name="mysql4-upgrade-0.0.10-0.0.11.php" hash="f29952c10a05f075d8afb73fd0d2468f"/><file name="mysql4-upgrade-0.0.3-0.0.4.php" hash="b43beea075582cfa471dd4ce2ec394ce"/><file name="mysql4-upgrade-0.0.6-0.0.7.php" hash="04f939ff1119ef282290256eb58229d9"/><file name="mysql4-upgrade-0.0.13-0.0.14.php" hash="a5bb6ff4cccb9e6302c6a0cd6ffd77e3"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="be5b9b7f8dd33f211ae7c16ee1028dce"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Subscription"><file name="OrderController.php" hash="ddf95460175eccc37243df6e735290bc"/></dir><file name="SubscriptionController.php" hash="07bd75822d2bb18b953fca59ea9fc597"/></dir><dir name="Checkout"><dir name="Cart"><file name="SubscriptionController.php" hash="a7f345974379aff4803449df8c8cbf70"/></dir><file name="OnepageController.php" hash="21b5e60937833c31bcb9e0a136ced557"/></dir><dir name="Customer"><dir name="Account"><file name="SubscriptionController.php" hash="0a42fdbb7fd147f39e89c1f30e95ffee"/></dir></dir><file name="RedirectController.php" hash="35364646b7e0575e4e8c94d20f64bbc5"/></dir><dir name="Helper"><file name="Subscription.php" hash="06d3654dff462fee526ef519b926814e"/><file name="Data.php" hash="86424bdae4e2f396757853e5418db5aa"/></dir><dir name="Model"><dir name="Exception"><file name="Error.php" hash="4ac369ee913575b427c6d15ff60ca27c"/><file name="DenyPayment.php" hash="b0c0b45291d220e490526ffd68e8dfc4"/></dir><dir name="Utility"><file name="Order.php" hash="47808179695d5896ec57e04cd64a7a9f"/><file name="Subscription.php" hash="d03077eaf0873032cc5380b4574aea5a"/><file name="Encryptor.php" hash="8f03d6b76461d3700fadb2ce312c2e47"/></dir><dir name="Resource"><dir name="Encryptor"><file name="Collection.php" hash="852cfd93886da3e76f3c45acde4595b5"/></dir><dir name="Subscription"><dir name="Order"><file name="Collection.php" hash="9794d1183d0ffc7ce313e74170330c07"/></dir><file name="Order.php" hash="2958956cff03a6358c648bf5ecea564e"/><file name="Collection.php" hash="d316d3cf47157d2b4cdf1e5d2873ac08"/></dir><dir name="Agreement"><file name="Collection.php" hash="8eb8fca6c042fe9bfd196cbbf64996f1"/></dir><dir name="Transaction"><file name="Collection.php" hash="8b7be054183ad76cfb9c6b7c27595fbc"/></dir><dir name="PaymentInfo"><file name="Collection.php" hash="023bad0d605c3fa8fc6e91d1b71f1711"/></dir><file name="PaymentInfo.php" hash="f093013cafdf4e90a373b465fb1e09ad"/><file name="Agreement.php" hash="dcfc1ec7df22bd0ce24b64d332021e5a"/><file name="Subscription.php" hash="f5f927e1793f44fa384eb2aead41ee81"/><file name="Transaction.php" hash="7ca37cc46a5b24faa7658a61e47633e2"/><file name="Encryptor.php" hash="3b1628a7ec59b5bd25280d9236ce94dc"/></dir><dir name="Compatibility"><dir name="Mage"><dir name="Sales"><dir name="Model"><dir name="Order"><file name="Payment.php" hash="25de73c00d619ec65c2696906b35dfad"/></dir></dir></dir></dir></dir><dir name="Service"><dir name="Redirect"><file name="AgreementAbstract.php" hash="81065a052aed054b6792426444ffe7f7"/></dir><dir name="Direct"><file name="AgreementAbstract.php" hash="c0e995f3eac27bcb9bca76b697b492c7"/></dir><file name="RedirectAbstract.php" hash="fc6a896415cbbad9a8b04b221b9d514e"/><file name="AgreementAbstract.php" hash="f41e4733179e2765d60822009abb4bfe"/><file name="Abstract.php" hash="93c2146fe9a5dea06d9f293c7e8c4dd6"/><file name="DirectAbstract.php" hash="541f1cbce88d781bed2e7f04f7453945"/></dir><dir name="Subscription"><file name="Order.php" hash="07c91afd16d567c6dcddee9374be97c8"/></dir><dir name="Method"><file name="RedirectAbstract.php" hash="fed166e8061a60c3730ace82612b343f"/><file name="AgreementAbstract.php" hash="73f51504d57b40de32a985e9c6d44465"/><file name="DirectAbstract.php" hash="e16672fad743df46f9c70e82ddb7d320"/></dir><dir name="Adapter"><dir name="Redirect"><file name="AuthCaptureInterface.php" hash="df746c0af2ebd7cec75393a7823395a6"/><file name="RefundInterface.php" hash="47b73ff9f4df8898169ceb6806e56e11"/><file name="PartialInterface.php" hash="0202182d017adcc232158f1d334963fa"/></dir><dir name="Direct"><file name="AuthCaptureInterface.php" hash="f4b252722efbd660bb51a81f6ddb89ba"/><file name="RefundInterface.php" hash="b9c08aaeff738595107db65b2b578644"/><file name="PartialInterface.php" hash="86782fa288b08fbaae0b15aaab314ad6"/></dir><dir name="Agreement"><file name="ManageInterface.php" hash="53f3aa3d00f7dfff4b799282204f4847"/><file name="CreateInterface.php" hash="41d3011c099de9ae372f9bcf60c92053"/></dir><file name="Abstract.php" hash="c7c01b8094cda569501920b69921c287"/><file name="Interface.php" hash="887febfe4eafd98f285f9b6082462667"/></dir><dir name="Config"><file name="Abstract.php" hash="30b71035f384e350a2071e233e0d353c"/></dir><dir name="Source"><file name="PaymentAction.php" hash="d94d62d900aac83e8bba6fe5d3459a70"/><file name="SubscriptionPeriods.php" hash="fdab5f7c2fdbb5f389facf94b9dae123"/><file name="AgreementMethod.php" hash="56add32f8838ac9a169c64ed6baa3318"/><file name="OrderStatus.php" hash="8a84a227a49229162a0310d604529165"/><file name="EncryptorStorageType.php" hash="a44ee883c792f3c1af7e07d265ddb731"/><file name="CardType.php" hash="c862f3b79f65bb496164ab83cccb9fa7"/></dir><file name="Email.php" hash="e03cb77df1a3d0fec0da4ebe26af2221"/><file name="Versioning.php" hash="ccf112f9a2e0a0c70003895989d42752"/><file name="PaymentInfo.php" hash="9a4bf37468dc68b7f1300bdfd1f0080c"/><file name="Agreement.php" hash="f595fcd31730466fc8d11589d1e93f15"/><file name="Subscription.php" hash="0b8078fd132bd6290714aad293dfb332"/><file name="Transaction.php" hash="971544deae8e8cc4036e1f2fe9685435"/><file name="Encryptor.php" hash="47a3d09aa175bc6d1327c7763eca4815"/><file name="Cron.php" hash="26fe7436ec01dbbc989587f8315dc6bf"/><file name="Observer.php" hash="45e7a6491ab4283208051674c019f259"/></dir><file name="changelog.txt" hash="8261e1764f448bab56a5a684145581d5"/></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ampersand_paymentgateway.xml" hash="3b70309300dfed71a62b73578869fc5d"/></dir><dir name="template"><dir name="ampersand_paymentgateway"><dir name="customer"><dir name="account"><file name="subscription.phtml" hash="73825035ff1e2b1bf17f85502317acc9"/></dir></dir><dir name="redirect"><file name="iframe.phtml" hash="129820e210e01662bab8afd5f24fac7d"/><file name="location.phtml" hash="aef0c86a5dea767c81b287b7ba8551d0"/><file name="form.phtml" hash="34118190ed5afa15cd4e9b3376239867"/></dir><dir name="payment"><dir name="form"><file name="billing-agreement-cv2.phtml" hash="f41a166c9d7b9b6cb780e0304890504b"/><file name="billing-agreement-checkbox.phtml" hash="57c5e2d3813acaaf6c054adb5cfd0d5f"/><file name="redirect.phtml" hash="1decc25cf3907d7ef05be8748aea6322"/></dir></dir><dir name="sales"><dir name="payment"><dir name="form"><dir name="billing"><file name="agreement.phtml" hash="fc256f93338c1a244efb0a74a27e11fb"/></dir></dir></dir></dir><dir name="checkout"><dir name="cart"><file name="subscription.phtml" hash="db155c792571cecca25746de6ed00665"/></dir><dir name="onepage"><dir name="review"><file name="subscription.phtml" hash="f3cc1076c65ee3ae0e959888b39b54c1"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><file name="ampersand_paymentgateway.xml" hash="b7dfcf1a57cf6d79d261ad91d266db2e"/></dir><dir name="template"><dir name="ampersand_paymentgateway"><dir name="payment"><dir name="info"><file name="payment-info.phtml" hash="be724367a7a703c70e2024ab1d4b28fc"/></dir></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="3f10f63632a280153a96ec9f90784568"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ampersand_PaymentGateway.xml" hash="80480a17487715a70e009757cd3c3dfe"/><file name="Ampersand_BillingAgreementFix.xml" hash="1d213328275ec29e62a7f580b7926604"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="ampersand_paymentgateway"><file name="subscription_reminder.html" hash="79262315a694fcb63de89baf66ef6ce6"/><file name="notification.html" hash="dea93b8b048571ac1a527260838b15fd"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="ampersand_paymentgateway"><dir name="css"><file name="checkout.css" hash="dfa4f36777bb549531f550d32e25d96e"/><file name="cart.css" hash="65dc2c9e22a28242060f23871af9c38e"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="ampersand_paymentgateway"><dir name="images"><file name="logo.gif" hash="098947bdb00786d3632235ff1cebb9c6"/></dir><dir name="css"><file name="styles.css" hash="476b0d182c430f90f8c3d887c45c3e91"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="ampersand_paymentgateway"><file name="validation.js" hash="c5c6ba4c549e0be9e38f29c26eb20773"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>