Version Notes
Stable Release
Download this release
Release Info
Developer | Kristian Büsch |
Extension | BillSAFE_3 |
Version | 14.03.27 |
Comparing to | |
See all releases |
Code changes from version 13.12.13 to 14.03.27
- app/code/community/Netresearch/Billsafe/Helper/Customer.php +15 -17
- app/code/community/Netresearch/Billsafe/Helper/Order.php +18 -30
- app/code/community/Netresearch/Billsafe/Model/Adminhtml/System/Config/Source/Gender.php +25 -0
- app/code/community/Netresearch/Billsafe/Model/Client/Base.php +6 -1
- app/code/community/Netresearch/Billsafe/Model/Config.php +20 -1
- app/code/community/Netresearch/Billsafe/Model/Config/Abstract.php +23 -0
- app/code/community/Netresearch/Billsafe/Model/Config/Maxamount.php +19 -2
- app/code/community/Netresearch/Billsafe/Model/Config/Maxfee.php +23 -5
- app/code/community/Netresearch/Billsafe/Model/Observer.php +15 -2
- app/code/community/Netresearch/Billsafe/Model/Payment.php +122 -86
- app/code/community/Netresearch/Billsafe/Model/Pdf/Engine/Invoice/Default.php +48 -0
- app/code/community/Netresearch/Billsafe/Test/Block/Customer/Widget/DobTest.php +30 -0
- app/code/community/Netresearch/Billsafe/Test/Controller/PaymentControllerTest.php +3 -0
- app/code/community/Netresearch/Billsafe/Test/Helper/CustomerTest.php +53 -23
- app/code/community/Netresearch/Billsafe/Test/Helper/OrderTest.php +19 -11
- app/code/community/Netresearch/Billsafe/Test/Model/ClientTest.php +128 -27
- app/code/community/Netresearch/Billsafe/Test/Model/ConfigTest.php +15 -2
- app/code/community/Netresearch/Billsafe/Test/Model/PaymentTest.php +223 -5
- app/code/community/Netresearch/Billsafe/controllers/PaymentController.php +2 -2
- app/code/community/Netresearch/Billsafe/etc/config.xml +18 -1
- app/code/community/Netresearch/Billsafe/etc/system.xml +11 -0
- app/locale/de_DE/Netresearch_Billsafe.csv +4 -1
- doc/Netresearch_Billsafe/ChangeLog.pdf +186 -23
- doc/Netresearch_Billsafe/README.pdf +83 -66
- package.xml +1 -1
app/code/community/Netresearch/Billsafe/Helper/Customer.php
CHANGED
@@ -36,26 +36,24 @@ class Netresearch_Billsafe_Helper_Customer extends Mage_Customer_Helper_Data
|
|
36 |
* @param Mage_Customer_Model_Address $address
|
37 |
* @param Mage_Sales_Model_Order $order
|
38 |
* @param Mage_Customer_Model_Customer $customer
|
39 |
-
* @return
|
40 |
*/
|
41 |
public function getCustomerGender($address, $order, $customer)
|
42 |
{
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
$this->getGenderText($customer, 'gender'),
|
47 |
-
$address->getPrefix(),
|
48 |
-
$order->getCustomerPrefix(),
|
49 |
-
$customer->getPrefix()
|
50 |
-
));
|
51 |
-
if (in_array($prefix,
|
52 |
-
array('mrs.', 'mrs', 'frau', 'fr.', 'fr', 'fräulein', 'frau dr.',
|
53 |
-
'female'))) {
|
54 |
-
return 'f';
|
55 |
}
|
56 |
-
return 'm';
|
57 |
-
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
|
61 |
/**
|
@@ -82,13 +80,13 @@ class Netresearch_Billsafe_Helper_Customer extends Mage_Customer_Helper_Data
|
|
82 |
|
83 |
|
84 |
/**
|
85 |
-
*
|
86 |
*
|
87 |
* @param Mage_Core_Model_Abstract $entity
|
88 |
* @param string $attributeCode
|
89 |
* @return string
|
90 |
*/
|
91 |
-
|
92 |
{
|
93 |
return Mage::getSingleton('eav/config')
|
94 |
->getAttribute('customer', 'gender')
|
36 |
* @param Mage_Customer_Model_Address $address
|
37 |
* @param Mage_Sales_Model_Order $order
|
38 |
* @param Mage_Customer_Model_Customer $customer
|
39 |
+
* @return string
|
40 |
*/
|
41 |
public function getCustomerGender($address, $order, $customer)
|
42 |
{
|
43 |
+
if ($address->getCompany()) {
|
44 |
+
// B2B, no gender necessary
|
45 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
|
|
|
|
47 |
|
48 |
+
$gender = Mage::helper('billsafe/data')->coalesce(
|
49 |
+
$this->getGenderText($address, 'gender'),
|
50 |
+
$this->getGenderText($order, 'customer_gender'),
|
51 |
+
$this->getGenderText($customer, 'gender'),
|
52 |
+
Mage::getModel('billsafe/config')->getDefaultCustomerGender($order->getStoreId())
|
53 |
+
);
|
54 |
+
|
55 |
+
return ($gender === 'Female') ? 'f' : 'm';
|
56 |
+
}
|
57 |
|
58 |
|
59 |
/**
|
80 |
|
81 |
|
82 |
/**
|
83 |
+
* Retrieve text of gender attribute of given entity.
|
84 |
*
|
85 |
* @param Mage_Core_Model_Abstract $entity
|
86 |
* @param string $attributeCode
|
87 |
* @return string
|
88 |
*/
|
89 |
+
public function getGenderText($entity, $attributeCode)
|
90 |
{
|
91 |
return Mage::getSingleton('eav/config')
|
92 |
->getAttribute('customer', 'gender')
|
app/code/community/Netresearch/Billsafe/Helper/Order.php
CHANGED
@@ -85,7 +85,8 @@ class Netresearch_Billsafe_Helper_Order extends Mage_Payment_Helper_Data
|
|
85 |
* gets relevant parts from the customers address
|
86 |
*
|
87 |
* @param Mage_Sales_Model_Quote_Address $address
|
88 |
-
* @param bool $includeEmail
|
|
|
89 |
*
|
90 |
* @return array - the parts for billSAFE
|
91 |
*/
|
@@ -138,8 +139,12 @@ class Netresearch_Billsafe_Helper_Order extends Mage_Payment_Helper_Data
|
|
138 |
*/
|
139 |
public function prevalidateOrder($quote)
|
140 |
{
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
143 |
}
|
144 |
|
145 |
/**
|
@@ -164,7 +169,7 @@ class Netresearch_Billsafe_Helper_Order extends Mage_Payment_Helper_Data
|
|
164 |
'order' => $this->getOrderParamsForProcessOrder(
|
165 |
$quote, $order
|
166 |
),
|
167 |
-
'customer' => $this->
|
168 |
'articleList' => $this->buildArticleList($order, self::TYPE_PO),
|
169 |
'product' => 'invoice',
|
170 |
'sessionId' => md5(
|
@@ -184,7 +189,14 @@ class Netresearch_Billsafe_Helper_Order extends Mage_Payment_Helper_Data
|
|
184 |
return $params;
|
185 |
}
|
186 |
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
{
|
189 |
$customerData = $this->getCustomerData(
|
190 |
$quote->getBillingAddress(), true, true
|
@@ -666,15 +678,8 @@ class Netresearch_Billsafe_Helper_Order extends Mage_Payment_Helper_Data
|
|
666 |
$cancelUrl = Mage::getUrl('billsafe/payment/cancellation');
|
667 |
}
|
668 |
|
669 |
-
$customer = $order->getCustomer();
|
670 |
-
$address = $order->getBillingAddress();
|
671 |
-
$street = $address->getStreet();
|
672 |
$quote = Mage::getModel('checkout/cart')->getQuote();
|
673 |
|
674 |
-
$email = Mage::helper('billsafe/data')->coalesce(
|
675 |
-
$customer->getEmail(), $order->getCustomerEmail(), $quote->getCustomerEmail()
|
676 |
-
);
|
677 |
-
$customerHelper = Mage::helper('billsafe/customer');
|
678 |
$params = array(
|
679 |
'order' => array(
|
680 |
'number' => $order->getIncrementId(),
|
@@ -686,24 +691,7 @@ class Netresearch_Billsafe_Helper_Order extends Mage_Payment_Helper_Data
|
|
686 |
),
|
687 |
'currencyCode' => 'EUR',
|
688 |
),
|
689 |
-
'customer' =>
|
690 |
-
'company' => $address->getCompany(),
|
691 |
-
'gender' => $customerHelper->getCustomerGender(
|
692 |
-
$address, $order, $customer
|
693 |
-
),
|
694 |
-
'firstname' => $address->getFirstname(),
|
695 |
-
'lastname' => $address->getLastname(),
|
696 |
-
'street' => implode(' ', $street),
|
697 |
-
'houseNumber' => '',
|
698 |
-
'postcode' => $address->getPostcode(),
|
699 |
-
'city' => $address->getCity(),
|
700 |
-
'country' => 'DE',
|
701 |
-
'email' => $email,
|
702 |
-
'dateOfBirth' => $customerHelper->getCustomerDob(
|
703 |
-
$customer, $order
|
704 |
-
),
|
705 |
-
'phone' => $address->getTelephone(),
|
706 |
-
),
|
707 |
'articleList' => $this->buildArticleList($order, self::TYPE_PO),
|
708 |
'product' => 'invoice',
|
709 |
'url' => array(
|
85 |
* gets relevant parts from the customers address
|
86 |
*
|
87 |
* @param Mage_Sales_Model_Quote_Address $address
|
88 |
+
* @param bool $includeEmail - returned data contain customer's e-mail address if true
|
89 |
+
* @param bool $useNames - return data contains customer's first- and lastname if true
|
90 |
*
|
91 |
* @return array - the parts for billSAFE
|
92 |
*/
|
139 |
*/
|
140 |
public function prevalidateOrder($quote)
|
141 |
{
|
142 |
+
try {
|
143 |
+
$params = $this->prepareParamsForPrevalidateOrder($quote);
|
144 |
+
return Mage::getModel('billsafe/client')->prevalidateOrder($params);
|
145 |
+
} catch (Exception $e) {
|
146 |
+
return new stdClass();
|
147 |
+
}
|
148 |
}
|
149 |
|
150 |
/**
|
169 |
'order' => $this->getOrderParamsForProcessOrder(
|
170 |
$quote, $order
|
171 |
),
|
172 |
+
'customer' => $this->getFullCustomerData($quote),
|
173 |
'articleList' => $this->buildArticleList($order, self::TYPE_PO),
|
174 |
'product' => 'invoice',
|
175 |
'sessionId' => md5(
|
189 |
return $params;
|
190 |
}
|
191 |
|
192 |
+
/**
|
193 |
+
* retrieves the complete customer data for calls to BillSAFE
|
194 |
+
*
|
195 |
+
* @param Mage_Sales_Model_Quote $quote - the current quote
|
196 |
+
*
|
197 |
+
* @return array - the customer data including dob and gender
|
198 |
+
*/
|
199 |
+
protected function getFullCustomerData(Mage_Sales_Model_Quote $quote)
|
200 |
{
|
201 |
$customerData = $this->getCustomerData(
|
202 |
$quote->getBillingAddress(), true, true
|
678 |
$cancelUrl = Mage::getUrl('billsafe/payment/cancellation');
|
679 |
}
|
680 |
|
|
|
|
|
|
|
681 |
$quote = Mage::getModel('checkout/cart')->getQuote();
|
682 |
|
|
|
|
|
|
|
|
|
683 |
$params = array(
|
684 |
'order' => array(
|
685 |
'number' => $order->getIncrementId(),
|
691 |
),
|
692 |
'currencyCode' => 'EUR',
|
693 |
),
|
694 |
+
'customer' => $this->getFullCustomerData($quote),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
'articleList' => $this->buildArticleList($order, self::TYPE_PO),
|
696 |
'product' => 'invoice',
|
697 |
'url' => array(
|
app/code/community/Netresearch/Billsafe/Model/Adminhtml/System/Config/Source/Gender.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Netresearch_Billsafe_Model_Adminhtml_System_Config_Source_Gender
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Query genders from customer eav source.
|
7 |
+
*
|
8 |
+
* @return array
|
9 |
+
*/
|
10 |
+
public function toOptionArray()
|
11 |
+
{
|
12 |
+
$options = array();
|
13 |
+
|
14 |
+
$genders = Mage::getSingleton('eav/config')
|
15 |
+
->getAttribute('customer', 'gender')
|
16 |
+
->getSource()
|
17 |
+
->getAllOptions(false);
|
18 |
+
|
19 |
+
foreach ($genders as $gender) {
|
20 |
+
$options[$gender['label']] = Mage::helper('billsafe/data')->__($gender['label']);
|
21 |
+
}
|
22 |
+
|
23 |
+
return $options;
|
24 |
+
}
|
25 |
+
}
|
app/code/community/Netresearch/Billsafe/Model/Client/Base.php
CHANGED
@@ -16,7 +16,12 @@ class Netresearch_Billsafe_Model_Client_Base extends Zend_Soap_Client
|
|
16 |
$helper = Mage::helper('billsafe');
|
17 |
|
18 |
try {
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
20 |
} catch (Exception $e) {
|
21 |
$helper->log($e->getMessage());
|
22 |
$msg = $helper->__(
|
16 |
$helper = Mage::helper('billsafe');
|
17 |
|
18 |
try {
|
19 |
+
// Check if WSDL is available before SoapClient raises an uncatchable PHP fatal error.
|
20 |
+
if (get_headers($this->getWsdl())) {
|
21 |
+
$response = parent::__call($name, $arguments);
|
22 |
+
} else {
|
23 |
+
Mage::throwException("WSDL is currently not available.");
|
24 |
+
}
|
25 |
} catch (Exception $e) {
|
26 |
$helper->log($e->getMessage());
|
27 |
$msg = $helper->__(
|
app/code/community/Netresearch/Billsafe/Model/Config.php
CHANGED
@@ -121,6 +121,12 @@ class Netresearch_Billsafe_Model_Config extends Varien_Object
|
|
121 |
*/
|
122 |
const CONFIG_PATH_BILLSAFE_PUBLIC_KEY = 'payment/billsafe/merchant_public_key';
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
/**
|
125 |
* getter for billsafe exeeding min fee amount
|
126 |
*
|
@@ -392,7 +398,7 @@ class Netresearch_Billsafe_Model_Config extends Varien_Object
|
|
392 |
*
|
393 |
* @param int $storeId - the store which confing should be used
|
394 |
*
|
395 |
-
* @
|
396 |
*/
|
397 |
public function getPublicKey($storeId = null)
|
398 |
{
|
@@ -401,6 +407,19 @@ class Netresearch_Billsafe_Model_Config extends Varien_Object
|
|
401 |
);
|
402 |
}
|
403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
/**
|
405 |
* Fetches and returns handling charges (payment fee)
|
406 |
*
|
121 |
*/
|
122 |
const CONFIG_PATH_BILLSAFE_PUBLIC_KEY = 'payment/billsafe/merchant_public_key';
|
123 |
|
124 |
+
/**
|
125 |
+
* BillSAFE default customer gender config path
|
126 |
+
* @var string
|
127 |
+
*/
|
128 |
+
const CONFIG_PATH_BILLSAFE_CUSTOMER_GENDER = 'payment/billsafe/default_gender';
|
129 |
+
|
130 |
/**
|
131 |
* getter for billsafe exeeding min fee amount
|
132 |
*
|
398 |
*
|
399 |
* @param int $storeId - the store which confing should be used
|
400 |
*
|
401 |
+
* @return string - the merchants public key
|
402 |
*/
|
403 |
public function getPublicKey($storeId = null)
|
404 |
{
|
407 |
);
|
408 |
}
|
409 |
|
410 |
+
/**
|
411 |
+
* Return default gender as set in module configuration.
|
412 |
+
*
|
413 |
+
* @param mixed $storeId
|
414 |
+
* @return string Gender label
|
415 |
+
*/
|
416 |
+
public function getDefaultCustomerGender($storeId = null)
|
417 |
+
{
|
418 |
+
return Mage::getStoreConfig(
|
419 |
+
self::CONFIG_PATH_BILLSAFE_CUSTOMER_GENDER, $storeId
|
420 |
+
);
|
421 |
+
}
|
422 |
+
|
423 |
/**
|
424 |
* Fetches and returns handling charges (payment fee)
|
425 |
*
|
app/code/community/Netresearch/Billsafe/Model/Config/Abstract.php
CHANGED
@@ -7,6 +7,29 @@
|
|
7 |
*/
|
8 |
class Netresearch_Billsafe_Model_Config_Abstract extends Mage_Core_Model_Config_Data
|
9 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
protected $_realConfigData = array();
|
11 |
|
12 |
/**
|
7 |
*/
|
8 |
class Netresearch_Billsafe_Model_Config_Abstract extends Mage_Core_Model_Config_Data
|
9 |
{
|
10 |
+
protected $dataHelper = null;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param null $dataHelper
|
14 |
+
*/
|
15 |
+
public function setDataHelper($dataHelper)
|
16 |
+
{
|
17 |
+
$this->dataHelper = $dataHelper;
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @return null
|
22 |
+
*/
|
23 |
+
public function getDataHelper()
|
24 |
+
{
|
25 |
+
if (null === $this->dataHelper) {
|
26 |
+
$this->dataHelper = Mage::helper('billsafe/data');
|
27 |
+
}
|
28 |
+
return $this->dataHelper;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
protected $_realConfigData = array();
|
34 |
|
35 |
/**
|
app/code/community/Netresearch/Billsafe/Model/Config/Maxamount.php
CHANGED
@@ -18,7 +18,7 @@ class Netresearch_Billsafe_Model_Config_Maxamount
|
|
18 |
$storeId = Mage::app()->getStore()->getId();
|
19 |
$config = $this->getTempConfig();
|
20 |
if ($config->isPaymentFeeEnabled($storeId)) {
|
21 |
-
$max =
|
22 |
if ($max < $this->getValue()) {
|
23 |
$this->setValue($max);
|
24 |
}
|
@@ -49,7 +49,7 @@ class Netresearch_Billsafe_Model_Config_Maxamount
|
|
49 |
$msg = 'Maximum order amount is a required entry!';
|
50 |
throw new Exception(Mage::helper('billsafe')->__($msg));
|
51 |
}
|
52 |
-
$max =
|
53 |
if (is_null($max)) {
|
54 |
throw new Exception(Mage::helper('billsafe')->__(
|
55 |
'No connection to BillSAFE. Please check your credentials.'
|
@@ -68,4 +68,21 @@ class Netresearch_Billsafe_Model_Config_Maxamount
|
|
68 |
|
69 |
parent::_beforeSave();
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
18 |
$storeId = Mage::app()->getStore()->getId();
|
19 |
$config = $this->getTempConfig();
|
20 |
if ($config->isPaymentFeeEnabled($storeId)) {
|
21 |
+
$max = $this->getMax();
|
22 |
if ($max < $this->getValue()) {
|
23 |
$this->setValue($max);
|
24 |
}
|
49 |
$msg = 'Maximum order amount is a required entry!';
|
50 |
throw new Exception(Mage::helper('billsafe')->__($msg));
|
51 |
}
|
52 |
+
$max = $this->getMax();
|
53 |
if (is_null($max)) {
|
54 |
throw new Exception(Mage::helper('billsafe')->__(
|
55 |
'No connection to BillSAFE. Please check your credentials.'
|
68 |
|
69 |
parent::_beforeSave();
|
70 |
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* gets the max amount for the payment fee from BillSAFE
|
74 |
+
*
|
75 |
+
* @return float - the maximum amount of the payment fee or null if it couldn't be obtained
|
76 |
+
*/
|
77 |
+
protected function getMax()
|
78 |
+
{
|
79 |
+
$max = null;
|
80 |
+
try {
|
81 |
+
$max = Mage::getModel('billsafe/config')->getFeeMaxAmount();
|
82 |
+
} catch (Exception $e) {
|
83 |
+
$this->getDataHelper()->log('error obtaining the max fee amount ' . $e->getMessage());
|
84 |
+
Mage::logException($e);
|
85 |
+
}
|
86 |
+
return $max;
|
87 |
+
}
|
88 |
}
|
app/code/community/Netresearch/Billsafe/Model/Config/Maxfee.php
CHANGED
@@ -20,7 +20,7 @@ class Netresearch_Billsafe_Model_Config_Maxfee
|
|
20 |
$storeId = Mage::app()->getStore()->getId();
|
21 |
$config = $this->getTempConfig();
|
22 |
if ($config->isPaymentFeeEnabled($storeId)) {
|
23 |
-
$max =
|
24 |
if ($max < $this->getValue()) {
|
25 |
$this->setValue($max);
|
26 |
}
|
@@ -43,20 +43,21 @@ class Netresearch_Billsafe_Model_Config_Maxfee
|
|
43 |
&& strlen($config->getMerchantId($storeId))
|
44 |
&& strlen($config->getMerchantLicense($storeId))
|
45 |
) {
|
|
|
46 |
if ($this->getValue() == '') {
|
47 |
$msg = 'Maximum/Default fee is required entry!';
|
48 |
-
throw new Exception(
|
49 |
}
|
50 |
-
$max =
|
51 |
if (is_null($max)) {
|
52 |
-
throw new Exception(
|
53 |
'No connection to BillSAFE. Please check your credentials.'
|
54 |
));
|
55 |
}
|
56 |
if ($max < $this->getValue()) {
|
57 |
$msg
|
58 |
= 'Maximum/Default fee %s exceeded the allowed maximum by BillSAFE of %s.';
|
59 |
-
throw new Exception(
|
60 |
$msg, $this->getValue(), $max
|
61 |
));
|
62 |
}
|
@@ -65,4 +66,21 @@ class Netresearch_Billsafe_Model_Config_Maxfee
|
|
65 |
|
66 |
parent::_beforeSave();
|
67 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
20 |
$storeId = Mage::app()->getStore()->getId();
|
21 |
$config = $this->getTempConfig();
|
22 |
if ($config->isPaymentFeeEnabled($storeId)) {
|
23 |
+
$max = $this->getMaxFee();
|
24 |
if ($max < $this->getValue()) {
|
25 |
$this->setValue($max);
|
26 |
}
|
43 |
&& strlen($config->getMerchantId($storeId))
|
44 |
&& strlen($config->getMerchantLicense($storeId))
|
45 |
) {
|
46 |
+
$dataHelper = $this->getDataHelper();
|
47 |
if ($this->getValue() == '') {
|
48 |
$msg = 'Maximum/Default fee is required entry!';
|
49 |
+
throw new Exception($dataHelper->__($msg));
|
50 |
}
|
51 |
+
$max = $this->getMaxFee();
|
52 |
if (is_null($max)) {
|
53 |
+
throw new Exception($dataHelper->__(
|
54 |
'No connection to BillSAFE. Please check your credentials.'
|
55 |
));
|
56 |
}
|
57 |
if ($max < $this->getValue()) {
|
58 |
$msg
|
59 |
= 'Maximum/Default fee %s exceeded the allowed maximum by BillSAFE of %s.';
|
60 |
+
throw new Exception($dataHelper->__(
|
61 |
$msg, $this->getValue(), $max
|
62 |
));
|
63 |
}
|
66 |
|
67 |
parent::_beforeSave();
|
68 |
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* gets the payment fee from BillSAFE
|
72 |
+
*
|
73 |
+
* @return float the amount for the payment fee, null if it couldn't be obtained
|
74 |
+
*/
|
75 |
+
protected function getMaxFee()
|
76 |
+
{
|
77 |
+
$max = null;
|
78 |
+
try {
|
79 |
+
$max = Mage::getModel('billsafe/config')->getMaxFee();
|
80 |
+
} catch (Exception $e) {
|
81 |
+
$this->getDataHelper()->log('error obtaining the max fee ' . $e->getMessage());
|
82 |
+
Mage::logException($e);
|
83 |
+
}
|
84 |
+
return $max;
|
85 |
+
}
|
86 |
}
|
app/code/community/Netresearch/Billsafe/Model/Observer.php
CHANGED
@@ -99,7 +99,6 @@ class Netresearch_Billsafe_Model_Observer
|
|
99 |
return Mage::getSingleton('checkout/type_onepage');
|
100 |
}
|
101 |
|
102 |
-
|
103 |
public function cleanUpSession($observer)
|
104 |
{
|
105 |
if (Mage::getSingleton('customer/session')->getData(
|
@@ -127,5 +126,19 @@ class Netresearch_Billsafe_Model_Observer
|
|
127 |
$dob = $observer->getEvent()->getInput()->getDob();
|
128 |
Mage::getSingleton('checkout/session')->setData('customer_dob', $dob);
|
129 |
}
|
130 |
-
}
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
return Mage::getSingleton('checkout/type_onepage');
|
100 |
}
|
101 |
|
|
|
102 |
public function cleanUpSession($observer)
|
103 |
{
|
104 |
if (Mage::getSingleton('customer/session')->getData(
|
126 |
$dob = $observer->getEvent()->getInput()->getDob();
|
127 |
Mage::getSingleton('checkout/session')->setData('customer_dob', $dob);
|
128 |
}
|
|
|
129 |
|
130 |
+
/**
|
131 |
+
* Adds the billsafe payment and legal notes to the invoice notes
|
132 |
+
*/
|
133 |
+
public function firegentoPdfInvoiceInsertNotice(Varien_Event_Observer $observer)
|
134 |
+
{
|
135 |
+
$order = $observer->getEvent()->getOrder();
|
136 |
+
$result = $observer->getEvent()->getResult();
|
137 |
+
if ($order->getPayment()->getMethod() == Netresearch_Billsafe_Model_Payment::CODE) {
|
138 |
+
$notes = $result->getNotes();
|
139 |
+
$infoText = Mage::helper('payment')->getInfoBlock($order->getPayment())->toMrgPdf() . "\n";
|
140 |
+
$notes = array_merge($notes, explode("\n", $infoText));
|
141 |
+
$result->setNotes($notes);
|
142 |
+
}
|
143 |
+
}
|
144 |
+
}
|
app/code/community/Netresearch/Billsafe/Model/Payment.php
CHANGED
@@ -52,6 +52,28 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
52 |
return $this->_config;
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
/**
|
56 |
* Check if payment method is available for current order
|
57 |
*
|
@@ -61,14 +83,11 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
61 |
*/
|
62 |
public function isAvailable($quote = null)
|
63 |
{
|
64 |
-
if (Mage::getModel('billsafe/config')->isBillsafeDirectEnabled()
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
Mage::getSingleton('customer/session')->getData(
|
70 |
-
'billsafe_billingAddrHash'
|
71 |
-
)
|
72 |
) {
|
73 |
return false;
|
74 |
}
|
@@ -85,26 +104,16 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
85 |
if ($quote) {
|
86 |
// total amount must fit between min and max amount
|
87 |
$total = (float) $quote->getGrandTotal();
|
88 |
-
$minAmount = $this->getConfig()->getBillSafeMinAmount(
|
89 |
-
|
90 |
-
);
|
91 |
-
$maxAmount = $this->getConfig()->getBillSafeMaxAmount(
|
92 |
-
$quote->getStoreId()
|
93 |
-
);
|
94 |
if ($total < $minAmount || $total > $maxAmount) {
|
95 |
return false;
|
96 |
}
|
97 |
// Check Min and Fax of Fee
|
98 |
-
if (Mage::getModel('billsafe/config')->isPaymentFeeEnabled(
|
99 |
-
|
100 |
-
)
|
101 |
-
|
102 |
-
$feeProduct = Mage::helper('paymentfee/data')
|
103 |
-
->getUpdatedFeeProduct();
|
104 |
-
$avoidOverMax = $this->getConfig()
|
105 |
-
->isBillsafeExeedingMaxFeeAmount($quote->getStoreId());
|
106 |
-
$avoidBelowMin = $this->getConfig()
|
107 |
-
->isBillsafeExeedingMinFeeAmount($quote->getStoreId());
|
108 |
|
109 |
if ($avoidOverMax && $feeProduct->getExceedsMaxAmount()) {
|
110 |
return false;
|
@@ -125,16 +134,21 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
125 |
$shippingAddress = $quote->getShippingAddress();
|
126 |
if (false == $shippingAddress->getSameAsBilling()) {
|
127 |
$shippingData = $this->serializeAddress($shippingAddress);
|
128 |
-
$billingData = $this->serializeAddress(
|
129 |
-
$quote->getBillingAddress()
|
130 |
-
);
|
131 |
|
132 |
if (0 != strcmp($shippingData, $billingData)) {
|
133 |
return false;
|
134 |
}
|
135 |
}
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
139 |
|
140 |
return true;
|
@@ -167,26 +181,39 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
167 |
return $result;
|
168 |
}
|
169 |
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
{
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
$
|
181 |
-
|
|
|
|
|
|
|
|
|
182 |
}
|
183 |
-
$this->_availableCheck = false;
|
184 |
-
return false;
|
185 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
-
$this->_availableCheck = true;
|
188 |
-
$this->_unavailableMessage = '';
|
189 |
-
return true;
|
190 |
}
|
191 |
|
192 |
/**
|
@@ -265,37 +292,30 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
265 |
{
|
266 |
|
267 |
parent::authorize($payment, $amount);
|
|
|
|
|
|
|
268 |
if (true == Mage::getModel('billsafe/config')->isBillSafeDirectEnabled()
|
269 |
) {
|
270 |
-
|
271 |
-
$order = $this->getInfoInstance()->getOrder();
|
272 |
$quote = $order->getQuote();
|
273 |
$result = array();
|
274 |
-
|
275 |
-
|
276 |
-
Mage_Sales_Model_Order_Address) || 0 == strlen($order->getShippingAddress()->getPostcode())
|
277 |
-
) {
|
278 |
-
$section = 'billing';
|
279 |
-
}
|
280 |
-
$buyerMessage = "Please select another payment method!";
|
281 |
try {
|
282 |
-
$result = Mage::helper('billsafe/order')->processOrder(
|
283 |
-
|
284 |
-
)
|
285 |
-
Mage::helper('billsafe/data')->log(
|
286 |
-
'result ' . Zend_Json::encode($result)
|
287 |
-
);
|
288 |
-
if (!array_key_exists('success', $result) || $result['success'] === false
|
289 |
-
) {
|
290 |
if (array_key_exists('buyerMessage', $result)) {
|
291 |
$buyerMessage = $result['buyerMessage'];
|
292 |
Mage::getSingleton('customer/session')->setData(
|
293 |
-
'authorize_failed',
|
|
|
294 |
);
|
295 |
$addressHash = Mage::helper('billsafe/order')
|
296 |
->generateAddressHash($quote->getBillingAddress());
|
297 |
Mage::getSingleton('customer/session')->setData(
|
298 |
-
'billsafe_billingAddrHash',
|
|
|
299 |
);
|
300 |
}
|
301 |
Mage::getSingleton('checkout/type_onepage')->getCheckout()
|
@@ -309,7 +329,7 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
309 |
->setIsTransactionPending(false)
|
310 |
->setIsTransactionClosed(false)
|
311 |
->setPreparedMessage(
|
312 |
-
$this->
|
313 |
'Payment registered at Billsafe'
|
314 |
)
|
315 |
)
|
@@ -321,12 +341,9 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
321 |
$state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
322 |
}
|
323 |
|
324 |
-
$text
|
325 |
-
= 'Successful BillSAFE payment.<br/>Transaction ID: ' .
|
326 |
'%d.<br/>BillSAFE Transaction Status: ACCEPTED.';
|
327 |
-
$notice =
|
328 |
-
$text, $result['transactionId']
|
329 |
-
);
|
330 |
Mage::helper('billsafe/order')->getPaymentInstruction($order);
|
331 |
$order->setState($state, true, $notice)->save();
|
332 |
}
|
@@ -338,42 +355,44 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
338 |
$this->cancel($payment);
|
339 |
}
|
340 |
} catch (Exception $e) {
|
341 |
-
$this->
|
342 |
}
|
343 |
Mage::getSingleton('checkout/type_onepage')->getCheckout()
|
344 |
->setGotoSection($section);
|
345 |
Mage::throwException(
|
346 |
sprintf(
|
347 |
-
'%s',
|
|
|
348 |
)
|
349 |
);
|
350 |
}
|
351 |
} else {
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
|
|
|
|
|
|
357 |
if (!$token) {
|
358 |
-
|
|
|
359 |
}
|
360 |
Mage::register(
|
361 |
-
Netresearch_Billsafe_Model_Config::TOKEN_REGISTRY_KEY,
|
|
|
362 |
);
|
363 |
$payment
|
364 |
->setIsTransactionPending(true)
|
365 |
->setIsTransactionClosed(false)
|
366 |
->setPreparedMessage(
|
367 |
-
$this->
|
368 |
)
|
369 |
->setTransactionId($token);
|
370 |
}
|
371 |
}
|
372 |
|
373 |
-
public function getHelper()
|
374 |
-
{
|
375 |
-
return Mage::helper('billsafe/data');
|
376 |
-
}
|
377 |
|
378 |
/**
|
379 |
* Capture
|
@@ -386,7 +405,7 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
386 |
public function capture(Varien_Object $payment, $amount)
|
387 |
{
|
388 |
if (!$this->areAllCaptureItemsSent($payment)) {
|
389 |
-
throw new Mage_Core_Exception($this->
|
390 |
'Count of items to invoice does not match sent items count. ' .
|
391 |
'Please change to items to be invoiced to match shipped items!'
|
392 |
));
|
@@ -407,7 +426,7 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
407 |
*/
|
408 |
protected function areAllCaptureItemsSent($payment)
|
409 |
{
|
410 |
-
if ($this->
|
411 |
) {
|
412 |
return true;
|
413 |
}
|
@@ -511,4 +530,21 @@ class Netresearch_Billsafe_Model_Payment extends Mage_Payment_Model_Method_Abstr
|
|
511 |
{
|
512 |
return $this->_unavailableMessage;
|
513 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
}
|
52 |
return $this->_config;
|
53 |
}
|
54 |
|
55 |
+
/**
|
56 |
+
* @param null $dataHelper
|
57 |
+
*/
|
58 |
+
public function setDataHelper(Netresearch_Billsafe_Helper_Data $dataHelper)
|
59 |
+
{
|
60 |
+
$this->dataHelper = $dataHelper;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @return Netresearch_Billsafe_Helper_Data
|
65 |
+
*/
|
66 |
+
public function getDataHelper()
|
67 |
+
{
|
68 |
+
if (null == $this->dataHelper) {
|
69 |
+
$this->dataHelper = Mage::helper('billsafe/data');
|
70 |
+
}
|
71 |
+
return $this->dataHelper;
|
72 |
+
}
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
/**
|
78 |
* Check if payment method is available for current order
|
79 |
*
|
83 |
*/
|
84 |
public function isAvailable($quote = null)
|
85 |
{
|
86 |
+
if (Mage::getModel('billsafe/config')->isBillsafeDirectEnabled()
|
87 |
+
&& true === Mage::getSingleton('customer/session')->getData('authorize_failed')
|
88 |
+
&& $quote instanceof Mage_Sales_Model_Quote
|
89 |
+
&& Mage::helper('billsafe/order')->generateAddressHash($quote->getBillingAddress())
|
90 |
+
== Mage::getSingleton('customer/session')->getData('billsafe_billingAddrHash')
|
|
|
|
|
|
|
91 |
) {
|
92 |
return false;
|
93 |
}
|
104 |
if ($quote) {
|
105 |
// total amount must fit between min and max amount
|
106 |
$total = (float) $quote->getGrandTotal();
|
107 |
+
$minAmount = $this->getConfig()->getBillSafeMinAmount($quote->getStoreId());
|
108 |
+
$maxAmount = $this->getConfig()->getBillSafeMaxAmount($quote->getStoreId());
|
|
|
|
|
|
|
|
|
109 |
if ($total < $minAmount || $total > $maxAmount) {
|
110 |
return false;
|
111 |
}
|
112 |
// Check Min and Fax of Fee
|
113 |
+
if (Mage::getModel('billsafe/config')->isPaymentFeeEnabled($quote->getStoreId())) {
|
114 |
+
$feeProduct = Mage::helper('paymentfee/data')->getUpdatedFeeProduct();
|
115 |
+
$avoidOverMax = $this->getConfig()->isBillsafeExeedingMaxFeeAmount($quote->getStoreId());
|
116 |
+
$avoidBelowMin = $this->getConfig()->isBillsafeExeedingMinFeeAmount($quote->getStoreId());
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
if ($avoidOverMax && $feeProduct->getExceedsMaxAmount()) {
|
119 |
return false;
|
134 |
$shippingAddress = $quote->getShippingAddress();
|
135 |
if (false == $shippingAddress->getSameAsBilling()) {
|
136 |
$shippingData = $this->serializeAddress($shippingAddress);
|
137 |
+
$billingData = $this->serializeAddress($quote->getBillingAddress());
|
|
|
|
|
138 |
|
139 |
if (0 != strcmp($shippingData, $billingData)) {
|
140 |
return false;
|
141 |
}
|
142 |
}
|
143 |
+
/*
|
144 |
+
* in cases the quote couldn't be handled by BillSAFE isAvailable return true in order to display a
|
145 |
+
* detailed message to the customer, technical errors leads to unavailbilty of BillSAFE payment method
|
146 |
+
*/
|
147 |
+
try {
|
148 |
+
$this->prevalidateOrder($quote);
|
149 |
+
} catch (Mage_Core_Exception $e) {
|
150 |
+
return false;
|
151 |
+
}
|
152 |
}
|
153 |
|
154 |
return true;
|
181 |
return $result;
|
182 |
}
|
183 |
|
184 |
+
/**
|
185 |
+
* executes prevalidateOrder call and evaluates the result
|
186 |
+
*
|
187 |
+
* @param Mage_Sales_Model_Quote $quote - the quote which needs to be checked for BillSAFe payment
|
188 |
+
*
|
189 |
+
* @return bool - true if the quote is valid for billSAFE payment, false otherwise
|
190 |
+
*/
|
191 |
+
public function prevalidateOrder(Mage_Sales_Model_Quote $quote)
|
192 |
{
|
193 |
+
try {
|
194 |
+
if ($quote->getBillingAddress() instanceof Mage_Sales_Model_Quote_Address
|
195 |
+
&& 0 < strlen($quote->getBillingAddress()->getPostcode())) {
|
196 |
+
$prevalidateResult = Mage::helper('billsafe/order')->prevalidateOrder($quote);
|
197 |
+
if (strtolower(trim($prevalidateResult->ack)) != 'ok' ||
|
198 |
+
(property_exists($prevalidateResult, 'invoice') &&
|
199 |
+
(bool) $prevalidateResult->invoice->isAvailable == false)
|
200 |
+
) {
|
201 |
+
if (property_exists($prevalidateResult, 'invoice')) {
|
202 |
+
$this->_unavailableMessage
|
203 |
+
= $prevalidateResult->invoice->message;
|
204 |
+
}
|
205 |
+
$this->_availableCheck = false;
|
206 |
+
return false;
|
207 |
}
|
|
|
|
|
208 |
}
|
209 |
+
$this->_availableCheck = true;
|
210 |
+
$this->_unavailableMessage = '';
|
211 |
+
return true;
|
212 |
+
} catch (Exception $e) {
|
213 |
+
$this->getDataHelper()->log('Exception during prevalidateOrder call ' . $e->getMessage());
|
214 |
+
$this->_availableCheck = false;
|
215 |
+
Mage::throwException($e);
|
216 |
}
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
/**
|
292 |
{
|
293 |
|
294 |
parent::authorize($payment, $amount);
|
295 |
+
$order = $this->getInfoInstance()->getOrder();
|
296 |
+
$section = $this->getCheckoutSection($order);
|
297 |
+
$buyerMessage = "Please select another payment method!";
|
298 |
if (true == Mage::getModel('billsafe/config')->isBillSafeDirectEnabled()
|
299 |
) {
|
|
|
|
|
300 |
$quote = $order->getQuote();
|
301 |
$result = array();
|
302 |
+
|
303 |
+
|
|
|
|
|
|
|
|
|
|
|
304 |
try {
|
305 |
+
$result = Mage::helper('billsafe/order')->processOrder($quote, $order);
|
306 |
+
Mage::helper('billsafe/data')->log('result ' . Zend_Json::encode($result));
|
307 |
+
if (!array_key_exists('success', $result) || $result['success'] === false) {
|
|
|
|
|
|
|
|
|
|
|
308 |
if (array_key_exists('buyerMessage', $result)) {
|
309 |
$buyerMessage = $result['buyerMessage'];
|
310 |
Mage::getSingleton('customer/session')->setData(
|
311 |
+
'authorize_failed',
|
312 |
+
true
|
313 |
);
|
314 |
$addressHash = Mage::helper('billsafe/order')
|
315 |
->generateAddressHash($quote->getBillingAddress());
|
316 |
Mage::getSingleton('customer/session')->setData(
|
317 |
+
'billsafe_billingAddrHash',
|
318 |
+
$addressHash
|
319 |
);
|
320 |
}
|
321 |
Mage::getSingleton('checkout/type_onepage')->getCheckout()
|
329 |
->setIsTransactionPending(false)
|
330 |
->setIsTransactionClosed(false)
|
331 |
->setPreparedMessage(
|
332 |
+
$this->getDataHelper()->__(
|
333 |
'Payment registered at Billsafe'
|
334 |
)
|
335 |
)
|
341 |
$state = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
|
342 |
}
|
343 |
|
344 |
+
$text = 'Successful BillSAFE payment.<br/>Transaction ID: ' .
|
|
|
345 |
'%d.<br/>BillSAFE Transaction Status: ACCEPTED.';
|
346 |
+
$notice = $this->getDataHelper()->__($text, $result['transactionId']);
|
|
|
|
|
347 |
Mage::helper('billsafe/order')->getPaymentInstruction($order);
|
348 |
$order->setState($state, true, $notice)->save();
|
349 |
}
|
355 |
$this->cancel($payment);
|
356 |
}
|
357 |
} catch (Exception $e) {
|
358 |
+
$this->getDataHelper()->log($e->getMessage());
|
359 |
}
|
360 |
Mage::getSingleton('checkout/type_onepage')->getCheckout()
|
361 |
->setGotoSection($section);
|
362 |
Mage::throwException(
|
363 |
sprintf(
|
364 |
+
'%s',
|
365 |
+
Mage::helper('billsafe/data')->__($buyerMessage)
|
366 |
)
|
367 |
);
|
368 |
}
|
369 |
} else {
|
370 |
+
$token = null;
|
371 |
+
try {
|
372 |
+
$token = $this->getClient()
|
373 |
+
->prepareOrder($this->getInfoInstance()->getOrder())
|
374 |
+
->getResponseToken();
|
375 |
+
} catch (Exception $e) {
|
376 |
+
$this->getDataHelper()->log('error getting the token ' . $e->getMessage());
|
377 |
+
}
|
378 |
if (!$token) {
|
379 |
+
Mage::getSingleton('checkout/type_onepage')->getCheckout()->setGotoSection($section);
|
380 |
+
Mage::throwException($this->getDataHelper()->__($buyerMessage));
|
381 |
}
|
382 |
Mage::register(
|
383 |
+
Netresearch_Billsafe_Model_Config::TOKEN_REGISTRY_KEY,
|
384 |
+
$token
|
385 |
);
|
386 |
$payment
|
387 |
->setIsTransactionPending(true)
|
388 |
->setIsTransactionClosed(false)
|
389 |
->setPreparedMessage(
|
390 |
+
$this->getDataHelper()->__('Payment registered at Billsafe')
|
391 |
)
|
392 |
->setTransactionId($token);
|
393 |
}
|
394 |
}
|
395 |
|
|
|
|
|
|
|
|
|
396 |
|
397 |
/**
|
398 |
* Capture
|
405 |
public function capture(Varien_Object $payment, $amount)
|
406 |
{
|
407 |
if (!$this->areAllCaptureItemsSent($payment)) {
|
408 |
+
throw new Mage_Core_Exception($this->getDataHelper()->__(
|
409 |
'Count of items to invoice does not match sent items count. ' .
|
410 |
'Please change to items to be invoiced to match shipped items!'
|
411 |
));
|
426 |
*/
|
427 |
protected function areAllCaptureItemsSent($payment)
|
428 |
{
|
429 |
+
if ($this->getDataHelper()->isDoShipment() || $this->getDataHelper()->isCaptureOffline()
|
430 |
) {
|
431 |
return true;
|
432 |
}
|
530 |
{
|
531 |
return $this->_unavailableMessage;
|
532 |
}
|
533 |
+
|
534 |
+
/**
|
535 |
+
* gets the checkout section in case of errors
|
536 |
+
*
|
537 |
+
* @param $order
|
538 |
+
*
|
539 |
+
* @return string
|
540 |
+
*/
|
541 |
+
protected function getCheckoutSection($order)
|
542 |
+
{
|
543 |
+
$section = 'shipping_method';
|
544 |
+
if (false === ($order->getShippingAddress() instanceof Mage_Sales_Model_Order_Address)
|
545 |
+
|| 0 === strlen(trim($order->getShippingAddress()->getPostcode()))) {
|
546 |
+
$section = 'billing';
|
547 |
+
}
|
548 |
+
return $section;
|
549 |
+
}
|
550 |
}
|
app/code/community/Netresearch/Billsafe/Model/Pdf/Engine/Invoice/Default.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Netresearch_Billsafe_Model_Pdf_Engine_Invoice_Default
|
3 |
+
extends FireGento_Pdf_Model_Engine_Invoice_Default
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* Insert footer
|
7 |
+
*
|
8 |
+
* @param Zend_Pdf_Page $page Current page object of Zend_Pdf
|
9 |
+
* @return void
|
10 |
+
*/
|
11 |
+
protected function _insertFooter(&$page)
|
12 |
+
{
|
13 |
+
$page->setLineColor($this->colors['black']);
|
14 |
+
$page->setLineWidth(0.5);
|
15 |
+
$page->drawLine($this->margin['left'] - 20, $this->y - 5, $this->margin['right'] + 30, $this->y - 5);
|
16 |
+
|
17 |
+
$this->Ln(15);
|
18 |
+
$this->_insertFooterAddress($page);
|
19 |
+
|
20 |
+
$fields = array(
|
21 |
+
'telephone' => Mage::helper('firegento_pdf')->__('Telephone:'),
|
22 |
+
'fax' => Mage::helper('firegento_pdf')->__('Fax:'),
|
23 |
+
'email' => Mage::helper('firegento_pdf')->__('E-Mail:'),
|
24 |
+
'web' => Mage::helper('firegento_pdf')->__('Web:'),
|
25 |
+
);
|
26 |
+
$this->_insertFooterBlock($page, $fields, 70, 40, 140);
|
27 |
+
|
28 |
+
if ($this->getOrder()->getPayment()->getMethod() != Netresearch_Billsafe_Model_Payment::CODE) {
|
29 |
+
$fields = array(
|
30 |
+
'bank_name' => Mage::helper('firegento_pdf')->__('Bank name:'),
|
31 |
+
'bank_account' => Mage::helper('firegento_pdf')->__('Account:'),
|
32 |
+
'bank_code_number' => Mage::helper('firegento_pdf')->__('Bank number:'),
|
33 |
+
'bank_account_owner' => Mage::helper('firegento_pdf')->__('Account owner:'),
|
34 |
+
'swift' => Mage::helper('firegento_pdf')->__('SWIFT:'),
|
35 |
+
'iban' => Mage::helper('firegento_pdf')->__('IBAN:'),
|
36 |
+
);
|
37 |
+
$this->_insertFooterBlock($page, $fields, 215, 50, 140);
|
38 |
+
}
|
39 |
+
|
40 |
+
$fields = array(
|
41 |
+
'tax_number' => Mage::helper('firegento_pdf')->__('Tax number:'),
|
42 |
+
'vat_id' => Mage::helper('firegento_pdf')->__('VAT-ID:'),
|
43 |
+
'register_number' => Mage::helper('firegento_pdf')->__('Register number:'),
|
44 |
+
'ceo' => Mage::helper('firegento_pdf')->__('CEO:'),
|
45 |
+
);
|
46 |
+
$this->_insertFooterBlock($page, $fields, 355, 60, $this->margin['right'] - 355 - 10);
|
47 |
+
}
|
48 |
+
}
|
app/code/community/Netresearch/Billsafe/Test/Block/Customer/Widget/DobTest.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Netresearch_Billsafe_Test_Block_Customer_Widget_DobTest
|
3 |
+
extends EcomDev_PHPUnit_Test_Case
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @test
|
7 |
+
*/
|
8 |
+
public function isRequired()
|
9 |
+
{
|
10 |
+
$storeId = Mage_Core_Model_App::DISTRO_STORE_ID;
|
11 |
+
$isDirectEnabled = true;
|
12 |
+
|
13 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
14 |
+
$dataHelperMock->expects($this->any())
|
15 |
+
->method('getStoreIdfromQuote')
|
16 |
+
->will($this->returnValue($storeId));
|
17 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
18 |
+
|
19 |
+
$configMock = $this->getModelMock('billsafe/config', array('isBillSafeDirectEnabled'));
|
20 |
+
$configMock->expects($this->any())
|
21 |
+
->method('isBillSafeDirectEnabled')
|
22 |
+
->will($this->returnValue($isDirectEnabled));
|
23 |
+
$this->replaceByMock('model', 'billsafe/config', $configMock);
|
24 |
+
|
25 |
+
/* @var $dobBlock Netresearch_Billsafe_Block_Customer_Widget_Dob */
|
26 |
+
$dobBlock = Mage::app()->getLayout()->createBlock('billsafe/customer_widget_dob');
|
27 |
+
$this->assertEquals($isDirectEnabled, $dobBlock->isRequired());
|
28 |
+
$this->assertStringStartsWith('billsafe', $dobBlock->getTemplate());
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Netresearch/Billsafe/Test/Controller/PaymentControllerTest.php
CHANGED
@@ -13,6 +13,9 @@ class Netresearch_Billsafe_Test_Controller_PaymentControllerTest
|
|
13 |
|
14 |
public function testVerifyActionRedirectsToCart()
|
15 |
{
|
|
|
|
|
|
|
16 |
$clientMock = $this->getModelMock('billsafe/client', array('isValid', 'isAccepted', 'getResponse', 'getTransactionResult'));
|
17 |
$clientMock->expects($this->any())
|
18 |
->method('isValid')
|
13 |
|
14 |
public function testVerifyActionRedirectsToCart()
|
15 |
{
|
16 |
+
$customerSessionMock = $this->getModelMock('checkout/session', array('init', 'save', 'addError', 'isLoggedIn'));
|
17 |
+
$this->replaceByMock('model', 'checkout/session', $customerSessionMock);
|
18 |
+
|
19 |
$clientMock = $this->getModelMock('billsafe/client', array('isValid', 'isAccepted', 'getResponse', 'getTransactionResult'));
|
20 |
$clientMock->expects($this->any())
|
21 |
->method('isValid')
|
app/code/community/Netresearch/Billsafe/Test/Helper/CustomerTest.php
CHANGED
@@ -10,8 +10,6 @@
|
|
10 |
class Netresearch_Billsafe_Test_Helper_CustomerTest
|
11 |
extends EcomDev_PHPUnit_Test_Case
|
12 |
{
|
13 |
-
|
14 |
-
|
15 |
public function testGetCustomerDob()
|
16 |
{
|
17 |
$helper = Mage::helper('billsafe/customer');
|
@@ -44,28 +42,60 @@ class Netresearch_Billsafe_Test_Helper_CustomerTest
|
|
44 |
$address = new Varien_Object();
|
45 |
$customer = new Varien_Object();
|
46 |
$order = new Varien_Object();
|
47 |
-
|
48 |
-
$
|
49 |
-
|
50 |
-
$this->
|
51 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
);
|
53 |
-
$
|
54 |
-
'fräulein', 'frau dr.', 'female');
|
55 |
-
foreach ($femaleValues as $femaleValue) {
|
56 |
-
$helperMock = $this->getMockedGenderTextHelper($femaleValue);
|
57 |
-
$this->assertEquals(
|
58 |
-
'f', $helperMock->getCustomerGender($address, $order, $customer)
|
59 |
-
);
|
60 |
-
}
|
61 |
-
$maleValues = array('mr.', 'mr', 'herr', 'herr dr.',
|
62 |
-
'male');
|
63 |
-
foreach ($maleValues as $maleValue) {
|
64 |
-
$helperMock = $this->getMockedGenderTextHelper($maleValue);
|
65 |
-
$this->assertEquals(
|
66 |
-
'm', $helperMock->getCustomerGender($address, $order, $customer)
|
67 |
-
);
|
68 |
-
}
|
69 |
}
|
70 |
|
71 |
public function testGetGenderText()
|
10 |
class Netresearch_Billsafe_Test_Helper_CustomerTest
|
11 |
extends EcomDev_PHPUnit_Test_Case
|
12 |
{
|
|
|
|
|
13 |
public function testGetCustomerDob()
|
14 |
{
|
15 |
$helper = Mage::helper('billsafe/customer');
|
42 |
$address = new Varien_Object();
|
43 |
$customer = new Varien_Object();
|
44 |
$order = new Varien_Object();
|
45 |
+
|
46 |
+
$defaultGender = 'Female';
|
47 |
+
|
48 |
+
$configMock = $this->getModelMock('billsafe/config', array(
|
49 |
+
'getDefaultCustomerGender',
|
50 |
+
));
|
51 |
+
$configMock->expects($this->any())
|
52 |
+
->method('getDefaultCustomerGender')
|
53 |
+
->will($this->returnValue($defaultGender));
|
54 |
+
$this->replaceByMock('model', 'billsafe/config', $configMock);
|
55 |
+
|
56 |
+
$helperMock = $this->getHelperMock(
|
57 |
+
'billsafe/customer', array('getGenderText')
|
58 |
+
);
|
59 |
+
$helperMock->expects($this->any())
|
60 |
+
->method('getGenderText')
|
61 |
+
->will($this->onConsecutiveCalls(
|
62 |
+
null, null, null,
|
63 |
+
null, null, 'MyCustomerGender',
|
64 |
+
null, 'MyOrderGender', null,
|
65 |
+
'MyAddressGender', null, null
|
66 |
+
));
|
67 |
+
$this->replaceByMock('helper', 'billsafe/customer', $helperMock);
|
68 |
+
|
69 |
+
// Fallback to default gender as configured (transformed)
|
70 |
+
$gender = Mage::helper('billsafe/customer')->getCustomerGender(
|
71 |
+
$address, $order, $customer
|
72 |
+
);
|
73 |
+
$this->assertEquals('f', $gender);
|
74 |
+
|
75 |
+
// Gender as given in customer account (transformed)
|
76 |
+
$gender = Mage::helper('billsafe/customer')->getCustomerGender(
|
77 |
+
$address, $order, $customer
|
78 |
+
);
|
79 |
+
$this->assertEquals('m', $gender);
|
80 |
+
|
81 |
+
// Gender as given in order (transformed)
|
82 |
+
$gender = Mage::helper('billsafe/customer')->getCustomerGender(
|
83 |
+
$address, $order, $customer
|
84 |
+
);
|
85 |
+
$this->assertEquals('m', $gender);
|
86 |
+
|
87 |
+
// Gender as given in address (transformed)
|
88 |
+
$gender = Mage::helper('billsafe/customer')->getCustomerGender(
|
89 |
+
$address, $order, $customer
|
90 |
+
);
|
91 |
+
$this->assertEquals('m', $gender);
|
92 |
+
|
93 |
+
// Gender not necessary with B2B orders
|
94 |
+
$address->setCompany('Foo AG');
|
95 |
+
$gender = Mage::helper('billsafe/customer')->getCustomerGender(
|
96 |
+
$address, $order, $customer
|
97 |
);
|
98 |
+
$this->assertEquals('', $gender);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
100 |
|
101 |
public function testGetGenderText()
|
app/code/community/Netresearch/Billsafe/Test/Helper/OrderTest.php
CHANGED
@@ -1029,6 +1029,9 @@ class Netresearch_Billsafe_Test_Helper_OrderTest
|
|
1029 |
*/
|
1030 |
public function testGetPreparedOrderParams()
|
1031 |
{
|
|
|
|
|
|
|
1032 |
$sessionMock = $this->getModelMockBuilder('checkout/session')
|
1033 |
->disableOriginalConstructor(
|
1034 |
) // This one removes session_start and other methods usage
|
@@ -1041,7 +1044,10 @@ class Netresearch_Billsafe_Test_Helper_OrderTest
|
|
1041 |
->getMock();
|
1042 |
$this->replaceByMock('singleton', 'core/session', $sessionMock);
|
1043 |
|
1044 |
-
$fakeQuote =
|
|
|
|
|
|
|
1045 |
$cartMock = $this->getModelMock('checkout/cart', array('getQuote'));
|
1046 |
$cartMock->expects($this->any())
|
1047 |
->method('getQuote')
|
@@ -1076,13 +1082,9 @@ class Netresearch_Billsafe_Test_Helper_OrderTest
|
|
1076 |
->method('buildArticleList')
|
1077 |
->will($this->returnValue(array('name' => 'item 1')));
|
1078 |
|
1079 |
-
$
|
1080 |
-
$customer = new Varien_Object();
|
1081 |
-
$customer->setEmail('a@b.com');
|
1082 |
$order->setCustomer($customer);
|
1083 |
|
1084 |
-
$billingAddress = $this->getBillingAddress();
|
1085 |
-
$order->setBillingAddress($billingAddress);
|
1086 |
$result = $orderHelperMock->getPreparedOrderParams($order);
|
1087 |
|
1088 |
$this->resultAssertions($result, $order, $dataHelperMock,
|
@@ -1131,16 +1133,18 @@ class Netresearch_Billsafe_Test_Helper_OrderTest
|
|
1131 |
implode(' ', $billingAddress->getStreet()),
|
1132 |
$result['customer']['street']
|
1133 |
);
|
1134 |
-
$this->assertEquals('', $result['customer']['houseNumber']);
|
1135 |
$this->assertEquals(
|
1136 |
$billingAddress->getPostcode(), $result['customer']['postcode']
|
1137 |
);
|
|
|
1138 |
$this->assertEquals(
|
1139 |
$billingAddress->getCity(), $result['customer']['city']
|
1140 |
);
|
1141 |
-
$this->assertEquals(
|
1142 |
$this->assertEquals('a@b.com', $result['customer']['email']);
|
1143 |
-
$
|
|
|
|
|
1144 |
$this->assertEquals(
|
1145 |
$billingAddress->getTelephone(), $result['customer']['phone']
|
1146 |
);
|
@@ -1164,9 +1168,13 @@ class Netresearch_Billsafe_Test_Helper_OrderTest
|
|
1164 |
$this->assertEquals('bar', $result['url']['cancel']);
|
1165 |
}
|
1166 |
|
1167 |
-
protected function getBillingAddress()
|
1168 |
{
|
1169 |
-
|
|
|
|
|
|
|
|
|
1170 |
$billingAddress->setStreet('Nonnenstr. 11');
|
1171 |
$billingAddress->setCompany('NR');
|
1172 |
$billingAddress->setFirstname('Net');
|
1029 |
*/
|
1030 |
public function testGetPreparedOrderParams()
|
1031 |
{
|
1032 |
+
$order = Mage::getModel('sales/order')->load(13);
|
1033 |
+
$billingAddress = $this->getBillingAddress();
|
1034 |
+
$order->setBillingAddress($billingAddress);
|
1035 |
$sessionMock = $this->getModelMockBuilder('checkout/session')
|
1036 |
->disableOriginalConstructor(
|
1037 |
) // This one removes session_start and other methods usage
|
1044 |
->getMock();
|
1045 |
$this->replaceByMock('singleton', 'core/session', $sessionMock);
|
1046 |
|
1047 |
+
$fakeQuote = Mage::getModel('sales/quote');
|
1048 |
+
$billingAddressQuote = $this->getBillingAddress(false);
|
1049 |
+
$billingAddressQuote->setEmail('a@b.com');
|
1050 |
+
$fakeQuote->setBillingAddress($billingAddressQuote);
|
1051 |
$cartMock = $this->getModelMock('checkout/cart', array('getQuote'));
|
1052 |
$cartMock->expects($this->any())
|
1053 |
->method('getQuote')
|
1082 |
->method('buildArticleList')
|
1083 |
->will($this->returnValue(array('name' => 'item 1')));
|
1084 |
|
1085 |
+
$customer = Mage::getModel('customer/customer');
|
|
|
|
|
1086 |
$order->setCustomer($customer);
|
1087 |
|
|
|
|
|
1088 |
$result = $orderHelperMock->getPreparedOrderParams($order);
|
1089 |
|
1090 |
$this->resultAssertions($result, $order, $dataHelperMock,
|
1133 |
implode(' ', $billingAddress->getStreet()),
|
1134 |
$result['customer']['street']
|
1135 |
);
|
|
|
1136 |
$this->assertEquals(
|
1137 |
$billingAddress->getPostcode(), $result['customer']['postcode']
|
1138 |
);
|
1139 |
+
|
1140 |
$this->assertEquals(
|
1141 |
$billingAddress->getCity(), $result['customer']['city']
|
1142 |
);
|
1143 |
+
$this->assertEquals($billingAddress->getCountry(), $result['customer']['country']);
|
1144 |
$this->assertEquals('a@b.com', $result['customer']['email']);
|
1145 |
+
if (0 === strlen(trim($billingAddress->getCompany()))) {
|
1146 |
+
$this->assertEquals('1981-01-01', $result['customer']['dateOfBirth']);
|
1147 |
+
}
|
1148 |
$this->assertEquals(
|
1149 |
$billingAddress->getTelephone(), $result['customer']['phone']
|
1150 |
);
|
1168 |
$this->assertEquals('bar', $result['url']['cancel']);
|
1169 |
}
|
1170 |
|
1171 |
+
protected function getBillingAddress($useForOrder = true)
|
1172 |
{
|
1173 |
+
if ($useForOrder) {
|
1174 |
+
$billingAddress = Mage::getModel('sales/order_address');
|
1175 |
+
} else {
|
1176 |
+
$billingAddress = Mage::getModel('sales/quote_address');
|
1177 |
+
}
|
1178 |
$billingAddress->setStreet('Nonnenstr. 11');
|
1179 |
$billingAddress->setCompany('NR');
|
1180 |
$billingAddress->setFirstname('Net');
|
app/code/community/Netresearch/Billsafe/Test/Model/ClientTest.php
CHANGED
@@ -32,6 +32,12 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
32 |
->will($this->returnValue($params));
|
33 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
$result = Mage::getModel('billsafe/client')->prevalidateOrder($params);
|
36 |
$this->assertTrue(is_array($result));
|
37 |
$this->assertArrayHasKey("ack", $result);
|
@@ -72,15 +78,20 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
72 |
->will($this->returnValue($response));
|
73 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
$orderHelperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
76 |
$orderHelperMock->expects($this->any())
|
77 |
->method('buildArticleList')
|
78 |
->will($this->returnValue(array()));
|
|
|
79 |
|
80 |
$this->setExpectedException('Mage_Exception');
|
81 |
Mage::getModel('billsafe/client')->updateArticleList($order, $context);
|
82 |
-
|
83 |
-
|
84 |
}
|
85 |
|
86 |
/**
|
@@ -106,17 +117,21 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
106 |
$baseClientMock->expects($this->any())
|
107 |
->method('updateArticleList')
|
108 |
->will($this->returnValue($response));
|
109 |
-
|
110 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
$orderHelperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
113 |
$orderHelperMock->expects($this->any())
|
114 |
->method('buildArticleList')
|
115 |
->will($this->returnValue(array('amount' => 10, 'tax_amount' => '11')));
|
116 |
$this->replaceByMock('helper', 'billsafe/order', $orderHelperMock);
|
117 |
-
$client = Mage::getModel('billsafe/client');
|
118 |
-
|
119 |
|
|
|
120 |
$result = $client->updateArticleList($order, $context);
|
121 |
Mage::unregister('current_creditmemo');
|
122 |
$this->assertEquals($client, $result);
|
@@ -142,9 +157,19 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
142 |
$baseClientMock->expects($this->any())
|
143 |
->method('updateArticleList')
|
144 |
->will($this->returnValue($response));
|
145 |
-
|
146 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
$orderHelperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
149 |
$orderHelperMock->expects($this->any())
|
150 |
->method('buildArticleList')
|
@@ -159,6 +184,13 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
159 |
|
160 |
public function testGetAgreedHandlingCharges()
|
161 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
$response = new stdClass();
|
163 |
$response->agreedCharge = null;
|
164 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getAgreedHandlingCharges'));
|
@@ -170,6 +202,7 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
170 |
$client = Mage::getModel('billsafe/client');
|
171 |
$this->assertEquals(null, $client->getAgreedHandlingCharges());
|
172 |
|
|
|
173 |
$response = new stdClass();
|
174 |
$response->agreedCharge = 200;
|
175 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getAgreedHandlingCharges'));
|
@@ -181,6 +214,7 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
181 |
$client = Mage::getModel('billsafe/client');
|
182 |
$this->assertEquals(200, $client->getAgreedHandlingCharges());
|
183 |
|
|
|
184 |
$response = new stdClass();
|
185 |
$response->agreedCharge = new stdClass();
|
186 |
$response->agreedCharge->foo = 300;
|
@@ -197,16 +231,24 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
197 |
|
198 |
public function testGetPaymentInstruction()
|
199 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
$response = new stdClass();
|
201 |
$response->ack = 'ERR';
|
202 |
$response->errorList = new stdClass();
|
203 |
$response->errorList->code = 302;
|
|
|
204 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getPaymentInstruction'));
|
205 |
$baseClientMock->expects($this->any())
|
206 |
->method('getPaymentInstruction')
|
207 |
->will($this->returnValue($response));
|
208 |
-
|
209 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
210 |
$client = Mage::getModel('billsafe/client');
|
211 |
$order = new Varien_Object();
|
212 |
$order->setIncrementId(1);
|
@@ -216,27 +258,30 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
216 |
$response = new stdClass();
|
217 |
$response->ack = 'OK';
|
218 |
$response->instruction = 'instruction';
|
|
|
219 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getPaymentInstruction'));
|
220 |
$baseClientMock->expects($this->any())
|
221 |
->method('getPaymentInstruction')
|
222 |
->will($this->returnValue($response));
|
223 |
-
|
224 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
225 |
$client = Mage::getModel('billsafe/client');
|
226 |
$order = new Varien_Object();
|
227 |
$order->setIncrementId(1);
|
228 |
$this->assertEquals('instruction', $client->getPaymentInstruction($order));
|
229 |
|
|
|
230 |
$response = new stdClass();
|
231 |
$response->ack = 'ERR';
|
232 |
$response->errorList = new stdClass();
|
233 |
$response->errorList->code = 303;
|
|
|
234 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getPaymentInstruction'));
|
235 |
$baseClientMock->expects($this->any())
|
236 |
->method('getPaymentInstruction')
|
237 |
->will($this->returnValue($response));
|
238 |
-
|
239 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
240 |
$client = Mage::getModel('billsafe/client');
|
241 |
$order = new Varien_Object();
|
242 |
$order->setIncrementId(1);
|
@@ -250,6 +295,12 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
250 |
|
251 |
public function testGetConfig()
|
252 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
$config = Mage::getModel('billsafe/client')->getConfig();
|
254 |
$this->assertInstanceOf('Netresearch_Billsafe_Model_Config', $config);
|
255 |
}
|
@@ -260,10 +311,16 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
260 |
$configMock->expects($this->any())
|
261 |
->method('getMerchantId')
|
262 |
->will($this->returnValue('12345'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
$model = Mage::getModel('billsafe/client');
|
264 |
$this->assertInstanceOf('Netresearch_Billsafe_Model_Client', $model->setConfig($configMock));
|
265 |
$this->assertEquals($configMock->getMerchantId(), $model->getConfig()->getMerchantId());
|
266 |
-
|
267 |
}
|
268 |
|
269 |
public function testGetOptions()
|
@@ -275,9 +332,14 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
275 |
$baseClientMock->expects($this->any())
|
276 |
->method('getConnectionTimeout')
|
277 |
->will($this->returnValue(30));
|
278 |
-
|
279 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
$result = Mage::getModel('billsafe/client')->getOptions();
|
282 |
$this->assertTrue(is_array($result));
|
283 |
$this->assertEquals(1, $result['merchantId']);
|
@@ -290,13 +352,19 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
290 |
$response = new stdClass();
|
291 |
$response->ack = 'OK';
|
292 |
$response->status = 'ACCEPTED';
|
293 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getTransactionResult'));
|
294 |
|
|
|
295 |
$baseClientMock->expects($this->any())
|
296 |
->method('getTransactionResult')
|
297 |
->will($this->returnValue($response));
|
298 |
-
|
299 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
$client = Mage::getModel('billsafe/client');
|
301 |
try {
|
302 |
$this->assertTrue($client->isValid());
|
@@ -325,16 +393,20 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
325 |
$response = new stdClass();
|
326 |
$response->ack = 'OK';
|
327 |
$response->status = 'ACCEPTED';
|
328 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('prepareOrder'));
|
329 |
-
|
330 |
$order = Mage::getModel('sales/order')->load(13);
|
331 |
|
|
|
332 |
$baseClientMock->expects($this->any())
|
333 |
->method('prepareOrder')
|
334 |
->will($this->returnValue($response));
|
335 |
-
|
336 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
337 |
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
$helperMock = $this->getHelperMock('billsafe/order', array('getPreparedOrderParams'));
|
339 |
$helperMock->expects($this->any())
|
340 |
->method('getPreparedOrderParams')
|
@@ -353,15 +425,20 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
353 |
$response = new stdClass();
|
354 |
$response->ack = 'OK';
|
355 |
$response->status = 'ACCEPTED';
|
356 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('reportShipment'));
|
357 |
-
|
358 |
$shipment = Mage::getModel('sales/order_shipment')->load(1);
|
|
|
|
|
359 |
$baseClientMock->expects($this->any())
|
360 |
->method('reportShipment')
|
361 |
->will($this->returnValue($response));
|
362 |
-
|
363 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
364 |
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
$helperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
366 |
$helperMock->expects($this->any())
|
367 |
->method('buildArticleList')
|
@@ -370,7 +447,6 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
370 |
|
371 |
$client = Mage::getModel('billsafe/client');
|
372 |
$this->assertEquals($client, $client->reportShipment($shipment));
|
373 |
-
|
374 |
}
|
375 |
|
376 |
/**
|
@@ -382,12 +458,18 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
382 |
$response = new stdClass();
|
383 |
$response->ack = 'NOK';
|
384 |
$response->status = 'NOT ACCEPTED';
|
385 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('reportShipment'));
|
386 |
|
387 |
-
$
|
388 |
$baseClientMock->expects($this->any())
|
389 |
->method('reportShipment')
|
390 |
->will($this->returnValue($response));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
|
392 |
$helperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
393 |
$helperMock->expects($this->any())
|
@@ -395,8 +477,6 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
395 |
->will($this->returnValue(array()));
|
396 |
$this->replaceByMock('helper', 'billsafe/order', $helperMock);
|
397 |
|
398 |
-
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
399 |
-
|
400 |
$client = Mage::getModel('billsafe/client');
|
401 |
try {
|
402 |
$client->reportShipment($shipment);
|
@@ -411,12 +491,19 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
411 |
$response->ack = 'OK';
|
412 |
$response->status = 'ACCEPTED';
|
413 |
$response->transactionId = '0815';
|
414 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('processOrder'));
|
415 |
|
|
|
416 |
$baseClientMock->expects($this->any())
|
417 |
->method('processOrder')
|
418 |
->will($this->returnValue($response));
|
419 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
$client = Mage::getModel('billsafe/client');
|
421 |
$result = $client->processOrder(array());
|
422 |
$this->assertTrue($result['success']);
|
@@ -430,12 +517,19 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
430 |
$response->status = 'DECLINED';
|
431 |
$response->declineReason = new stdClass();
|
432 |
$response->declineReason->buyerMessage = 'Du kommst hier net rein';
|
433 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('processOrder'));
|
434 |
|
|
|
435 |
$baseClientMock->expects($this->any())
|
436 |
->method('processOrder')
|
437 |
->will($this->returnValue($response));
|
438 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
$client = Mage::getModel('billsafe/client');
|
440 |
$result = $client->processOrder(array());
|
441 |
$this->assertFalse($result['success']);
|
@@ -448,12 +542,19 @@ class Netresearch_Billsafe_Test_Model_ClientTest extends EcomDev_PHPUnit_Test_Ca
|
|
448 |
$response->ack = 'NOK';
|
449 |
$response->errorList = new stdClass();
|
450 |
$response->errorList->message = 'Request failed';
|
451 |
-
$baseClientMock = $this->getModelMock('billsafe/client_base', array('processOrder'));
|
452 |
|
|
|
453 |
$baseClientMock->expects($this->any())
|
454 |
->method('processOrder')
|
455 |
->will($this->returnValue($response));
|
456 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
$client = Mage::getModel('billsafe/client');
|
458 |
$result = $client->processOrder(array());
|
459 |
$this->assertFalse($result['success']);
|
32 |
->will($this->returnValue($params));
|
33 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
34 |
|
35 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
36 |
+
$dataHelperMock->expects($this->any())
|
37 |
+
->method('getStoreIdfromQuote')
|
38 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
39 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
40 |
+
|
41 |
$result = Mage::getModel('billsafe/client')->prevalidateOrder($params);
|
42 |
$this->assertTrue(is_array($result));
|
43 |
$this->assertArrayHasKey("ack", $result);
|
78 |
->will($this->returnValue($response));
|
79 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
80 |
|
81 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
82 |
+
$dataHelperMock->expects($this->any())
|
83 |
+
->method('getStoreIdfromQuote')
|
84 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
85 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
86 |
+
|
87 |
$orderHelperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
88 |
$orderHelperMock->expects($this->any())
|
89 |
->method('buildArticleList')
|
90 |
->will($this->returnValue(array()));
|
91 |
+
$this->replaceByMock('helper', 'billsafe/order', $orderHelperMock);
|
92 |
|
93 |
$this->setExpectedException('Mage_Exception');
|
94 |
Mage::getModel('billsafe/client')->updateArticleList($order, $context);
|
|
|
|
|
95 |
}
|
96 |
|
97 |
/**
|
117 |
$baseClientMock->expects($this->any())
|
118 |
->method('updateArticleList')
|
119 |
->will($this->returnValue($response));
|
|
|
120 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
121 |
|
122 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
123 |
+
$dataHelperMock->expects($this->any())
|
124 |
+
->method('getStoreIdfromQuote')
|
125 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
126 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
127 |
+
|
128 |
$orderHelperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
129 |
$orderHelperMock->expects($this->any())
|
130 |
->method('buildArticleList')
|
131 |
->will($this->returnValue(array('amount' => 10, 'tax_amount' => '11')));
|
132 |
$this->replaceByMock('helper', 'billsafe/order', $orderHelperMock);
|
|
|
|
|
133 |
|
134 |
+
$client = Mage::getModel('billsafe/client');
|
135 |
$result = $client->updateArticleList($order, $context);
|
136 |
Mage::unregister('current_creditmemo');
|
137 |
$this->assertEquals($client, $result);
|
157 |
$baseClientMock->expects($this->any())
|
158 |
->method('updateArticleList')
|
159 |
->will($this->returnValue($response));
|
|
|
160 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
161 |
|
162 |
+
$response = new stdClass();
|
163 |
+
$response->ack = 'ERR';
|
164 |
+
$response->errorList = new stdClass();
|
165 |
+
$response->errorList->code = 302;
|
166 |
+
|
167 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
168 |
+
$dataHelperMock->expects($this->any())
|
169 |
+
->method('getStoreIdfromQuote')
|
170 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
171 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
172 |
+
|
173 |
$orderHelperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
174 |
$orderHelperMock->expects($this->any())
|
175 |
->method('buildArticleList')
|
184 |
|
185 |
public function testGetAgreedHandlingCharges()
|
186 |
{
|
187 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
188 |
+
$dataHelperMock->expects($this->any())
|
189 |
+
->method('getStoreIdfromQuote')
|
190 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
191 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
192 |
+
|
193 |
+
|
194 |
$response = new stdClass();
|
195 |
$response->agreedCharge = null;
|
196 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getAgreedHandlingCharges'));
|
202 |
$client = Mage::getModel('billsafe/client');
|
203 |
$this->assertEquals(null, $client->getAgreedHandlingCharges());
|
204 |
|
205 |
+
|
206 |
$response = new stdClass();
|
207 |
$response->agreedCharge = 200;
|
208 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getAgreedHandlingCharges'));
|
214 |
$client = Mage::getModel('billsafe/client');
|
215 |
$this->assertEquals(200, $client->getAgreedHandlingCharges());
|
216 |
|
217 |
+
|
218 |
$response = new stdClass();
|
219 |
$response->agreedCharge = new stdClass();
|
220 |
$response->agreedCharge->foo = 300;
|
231 |
|
232 |
public function testGetPaymentInstruction()
|
233 |
{
|
234 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
235 |
+
$dataHelperMock->expects($this->any())
|
236 |
+
->method('getStoreIdfromQuote')
|
237 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
238 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
239 |
+
|
240 |
+
|
241 |
$response = new stdClass();
|
242 |
$response->ack = 'ERR';
|
243 |
$response->errorList = new stdClass();
|
244 |
$response->errorList->code = 302;
|
245 |
+
|
246 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getPaymentInstruction'));
|
247 |
$baseClientMock->expects($this->any())
|
248 |
->method('getPaymentInstruction')
|
249 |
->will($this->returnValue($response));
|
|
|
250 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
251 |
+
|
252 |
$client = Mage::getModel('billsafe/client');
|
253 |
$order = new Varien_Object();
|
254 |
$order->setIncrementId(1);
|
258 |
$response = new stdClass();
|
259 |
$response->ack = 'OK';
|
260 |
$response->instruction = 'instruction';
|
261 |
+
|
262 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getPaymentInstruction'));
|
263 |
$baseClientMock->expects($this->any())
|
264 |
->method('getPaymentInstruction')
|
265 |
->will($this->returnValue($response));
|
|
|
266 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
267 |
+
|
268 |
$client = Mage::getModel('billsafe/client');
|
269 |
$order = new Varien_Object();
|
270 |
$order->setIncrementId(1);
|
271 |
$this->assertEquals('instruction', $client->getPaymentInstruction($order));
|
272 |
|
273 |
+
|
274 |
$response = new stdClass();
|
275 |
$response->ack = 'ERR';
|
276 |
$response->errorList = new stdClass();
|
277 |
$response->errorList->code = 303;
|
278 |
+
|
279 |
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getPaymentInstruction'));
|
280 |
$baseClientMock->expects($this->any())
|
281 |
->method('getPaymentInstruction')
|
282 |
->will($this->returnValue($response));
|
|
|
283 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
284 |
+
|
285 |
$client = Mage::getModel('billsafe/client');
|
286 |
$order = new Varien_Object();
|
287 |
$order->setIncrementId(1);
|
295 |
|
296 |
public function testGetConfig()
|
297 |
{
|
298 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
299 |
+
$dataHelperMock->expects($this->any())
|
300 |
+
->method('getStoreIdfromQuote')
|
301 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
302 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
303 |
+
|
304 |
$config = Mage::getModel('billsafe/client')->getConfig();
|
305 |
$this->assertInstanceOf('Netresearch_Billsafe_Model_Config', $config);
|
306 |
}
|
311 |
$configMock->expects($this->any())
|
312 |
->method('getMerchantId')
|
313 |
->will($this->returnValue('12345'));
|
314 |
+
|
315 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
316 |
+
$dataHelperMock->expects($this->any())
|
317 |
+
->method('getStoreIdfromQuote')
|
318 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
319 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
320 |
+
|
321 |
$model = Mage::getModel('billsafe/client');
|
322 |
$this->assertInstanceOf('Netresearch_Billsafe_Model_Client', $model->setConfig($configMock));
|
323 |
$this->assertEquals($configMock->getMerchantId(), $model->getConfig()->getMerchantId());
|
|
|
324 |
}
|
325 |
|
326 |
public function testGetOptions()
|
332 |
$baseClientMock->expects($this->any())
|
333 |
->method('getConnectionTimeout')
|
334 |
->will($this->returnValue(30));
|
|
|
335 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
336 |
|
337 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
338 |
+
$dataHelperMock->expects($this->any())
|
339 |
+
->method('getStoreIdfromQuote')
|
340 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
341 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
342 |
+
|
343 |
$result = Mage::getModel('billsafe/client')->getOptions();
|
344 |
$this->assertTrue(is_array($result));
|
345 |
$this->assertEquals(1, $result['merchantId']);
|
352 |
$response = new stdClass();
|
353 |
$response->ack = 'OK';
|
354 |
$response->status = 'ACCEPTED';
|
|
|
355 |
|
356 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('getTransactionResult'));
|
357 |
$baseClientMock->expects($this->any())
|
358 |
->method('getTransactionResult')
|
359 |
->will($this->returnValue($response));
|
|
|
360 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
361 |
+
|
362 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
363 |
+
$dataHelperMock->expects($this->any())
|
364 |
+
->method('getStoreIdfromQuote')
|
365 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
366 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
367 |
+
|
368 |
$client = Mage::getModel('billsafe/client');
|
369 |
try {
|
370 |
$this->assertTrue($client->isValid());
|
393 |
$response = new stdClass();
|
394 |
$response->ack = 'OK';
|
395 |
$response->status = 'ACCEPTED';
|
|
|
|
|
396 |
$order = Mage::getModel('sales/order')->load(13);
|
397 |
|
398 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('prepareOrder'));
|
399 |
$baseClientMock->expects($this->any())
|
400 |
->method('prepareOrder')
|
401 |
->will($this->returnValue($response));
|
|
|
402 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
403 |
|
404 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
405 |
+
$dataHelperMock->expects($this->any())
|
406 |
+
->method('getStoreIdfromQuote')
|
407 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
408 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
409 |
+
|
410 |
$helperMock = $this->getHelperMock('billsafe/order', array('getPreparedOrderParams'));
|
411 |
$helperMock->expects($this->any())
|
412 |
->method('getPreparedOrderParams')
|
425 |
$response = new stdClass();
|
426 |
$response->ack = 'OK';
|
427 |
$response->status = 'ACCEPTED';
|
|
|
|
|
428 |
$shipment = Mage::getModel('sales/order_shipment')->load(1);
|
429 |
+
|
430 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('reportShipment'));
|
431 |
$baseClientMock->expects($this->any())
|
432 |
->method('reportShipment')
|
433 |
->will($this->returnValue($response));
|
|
|
434 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
435 |
|
436 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
437 |
+
$dataHelperMock->expects($this->any())
|
438 |
+
->method('getStoreIdfromQuote')
|
439 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
440 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
441 |
+
|
442 |
$helperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
443 |
$helperMock->expects($this->any())
|
444 |
->method('buildArticleList')
|
447 |
|
448 |
$client = Mage::getModel('billsafe/client');
|
449 |
$this->assertEquals($client, $client->reportShipment($shipment));
|
|
|
450 |
}
|
451 |
|
452 |
/**
|
458 |
$response = new stdClass();
|
459 |
$response->ack = 'NOK';
|
460 |
$response->status = 'NOT ACCEPTED';
|
|
|
461 |
|
462 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('reportShipment'));
|
463 |
$baseClientMock->expects($this->any())
|
464 |
->method('reportShipment')
|
465 |
->will($this->returnValue($response));
|
466 |
+
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
467 |
+
|
468 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
469 |
+
$dataHelperMock->expects($this->any())
|
470 |
+
->method('getStoreIdfromQuote')
|
471 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
472 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
473 |
|
474 |
$helperMock = $this->getHelperMock('billsafe/order', array('buildArticleList'));
|
475 |
$helperMock->expects($this->any())
|
477 |
->will($this->returnValue(array()));
|
478 |
$this->replaceByMock('helper', 'billsafe/order', $helperMock);
|
479 |
|
|
|
|
|
480 |
$client = Mage::getModel('billsafe/client');
|
481 |
try {
|
482 |
$client->reportShipment($shipment);
|
491 |
$response->ack = 'OK';
|
492 |
$response->status = 'ACCEPTED';
|
493 |
$response->transactionId = '0815';
|
|
|
494 |
|
495 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('processOrder'));
|
496 |
$baseClientMock->expects($this->any())
|
497 |
->method('processOrder')
|
498 |
->will($this->returnValue($response));
|
499 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
500 |
+
|
501 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
502 |
+
$dataHelperMock->expects($this->any())
|
503 |
+
->method('getStoreIdfromQuote')
|
504 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
505 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
506 |
+
|
507 |
$client = Mage::getModel('billsafe/client');
|
508 |
$result = $client->processOrder(array());
|
509 |
$this->assertTrue($result['success']);
|
517 |
$response->status = 'DECLINED';
|
518 |
$response->declineReason = new stdClass();
|
519 |
$response->declineReason->buyerMessage = 'Du kommst hier net rein';
|
|
|
520 |
|
521 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('processOrder'));
|
522 |
$baseClientMock->expects($this->any())
|
523 |
->method('processOrder')
|
524 |
->will($this->returnValue($response));
|
525 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
526 |
+
|
527 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
528 |
+
$dataHelperMock->expects($this->any())
|
529 |
+
->method('getStoreIdfromQuote')
|
530 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
531 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
532 |
+
|
533 |
$client = Mage::getModel('billsafe/client');
|
534 |
$result = $client->processOrder(array());
|
535 |
$this->assertFalse($result['success']);
|
542 |
$response->ack = 'NOK';
|
543 |
$response->errorList = new stdClass();
|
544 |
$response->errorList->message = 'Request failed';
|
|
|
545 |
|
546 |
+
$baseClientMock = $this->getModelMock('billsafe/client_base', array('processOrder'));
|
547 |
$baseClientMock->expects($this->any())
|
548 |
->method('processOrder')
|
549 |
->will($this->returnValue($response));
|
550 |
$this->replaceByMock('model', 'billsafe/client_base', $baseClientMock);
|
551 |
+
|
552 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
553 |
+
$dataHelperMock->expects($this->any())
|
554 |
+
->method('getStoreIdfromQuote')
|
555 |
+
->will($this->returnValue(Mage::app()->getStore()->getId()));
|
556 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
557 |
+
|
558 |
$client = Mage::getModel('billsafe/client');
|
559 |
$result = $client->processOrder(array());
|
560 |
$this->assertFalse($result['success']);
|
app/code/community/Netresearch/Billsafe/Test/Model/ConfigTest.php
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
class Netresearch_Billsafe_Test_Model_ConfigTest
|
4 |
extends EcomDev_PHPUnit_Test_Case
|
5 |
{
|
|
|
|
|
|
|
|
|
6 |
|
7 |
public function setUp()
|
8 |
{
|
@@ -478,8 +482,7 @@ class Netresearch_Billsafe_Test_Model_ConfigTest
|
|
478 |
|
479 |
public function testGetMerchantPublicKey()
|
480 |
{
|
481 |
-
$path
|
482 |
-
= Netresearch_Billsafe_Model_Config::CONFIG_PATH_BILLSAFE_PUBLIC_KEY;
|
483 |
$storeFirst = Mage::app()->getStore(0)->load(0);
|
484 |
|
485 |
$storeFirst->setConfig($path, 'default public key');
|
@@ -498,6 +501,16 @@ class Netresearch_Billsafe_Test_Model_ConfigTest
|
|
498 |
*/
|
499 |
}
|
500 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
public function testGetMaxFee()
|
502 |
{
|
503 |
$sessionMock = $this->getModelMockBuilder('checkout/session')
|
3 |
class Netresearch_Billsafe_Test_Model_ConfigTest
|
4 |
extends EcomDev_PHPUnit_Test_Case
|
5 |
{
|
6 |
+
/**
|
7 |
+
* @var Netresearch_Billsafe_Model_Config
|
8 |
+
*/
|
9 |
+
protected $config;
|
10 |
|
11 |
public function setUp()
|
12 |
{
|
482 |
|
483 |
public function testGetMerchantPublicKey()
|
484 |
{
|
485 |
+
$path = Netresearch_Billsafe_Model_Config::CONFIG_PATH_BILLSAFE_PUBLIC_KEY;
|
|
|
486 |
$storeFirst = Mage::app()->getStore(0)->load(0);
|
487 |
|
488 |
$storeFirst->setConfig($path, 'default public key');
|
501 |
*/
|
502 |
}
|
503 |
|
504 |
+
public function testGetDefaultCustomerGender()
|
505 |
+
{
|
506 |
+
$defaultGender = 'Female';
|
507 |
+
$path = Netresearch_Billsafe_Model_Config::CONFIG_PATH_BILLSAFE_CUSTOMER_GENDER;
|
508 |
+
|
509 |
+
$code = Mage_Core_Model_Store::DEFAULT_CODE;
|
510 |
+
Mage::app()->getStore($code)->setConfig($path, $defaultGender);
|
511 |
+
$this->assertEquals($this->config->getDefaultCustomerGender($code), $defaultGender);
|
512 |
+
}
|
513 |
+
|
514 |
public function testGetMaxFee()
|
515 |
{
|
516 |
$sessionMock = $this->getModelMockBuilder('checkout/session')
|
app/code/community/Netresearch/Billsafe/Test/Model/PaymentTest.php
CHANGED
@@ -56,6 +56,32 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
56 |
$this->assertEquals('foo', $model->getUnavailableMessage());
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
/**
|
60 |
* @loadFixture ../../../var/fixtures/orders.yaml
|
61 |
*/
|
@@ -201,6 +227,92 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
201 |
$this->assertEquals(Mage_Sales_Model_Order::STATE_PROCESSING, $order->getState());
|
202 |
}
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
/**
|
205 |
* @loadFixture ../../../var/fixtures/orders.yaml
|
206 |
*/
|
@@ -365,10 +477,13 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
365 |
->will($this->returnValue(10));
|
366 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
367 |
|
368 |
-
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData'));
|
369 |
$paymentModelMock->expects($this->any())
|
370 |
->method('getConfigData')
|
371 |
->will($this->returnValue(true));
|
|
|
|
|
|
|
372 |
$this->assertFalse($paymentModelMock->isAvailable($quote));
|
373 |
}
|
374 |
|
@@ -410,10 +525,13 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
410 |
|
411 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
412 |
|
413 |
-
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData'));
|
414 |
$paymentModelMock->expects($this->any())
|
415 |
->method('getConfigData')
|
416 |
->will($this->returnValue(true));
|
|
|
|
|
|
|
417 |
|
418 |
$feeProduct = new Varien_Object();
|
419 |
$feeProduct->setExceedsMaxAmount(true);
|
@@ -470,10 +588,13 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
470 |
|
471 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
472 |
|
473 |
-
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData'));
|
474 |
$paymentModelMock->expects($this->any())
|
475 |
->method('getConfigData')
|
476 |
->will($this->returnValue(true));
|
|
|
|
|
|
|
477 |
|
478 |
$feeProduct = new Varien_Object();
|
479 |
$feeProduct->setExceedsMaxAmount(false);
|
@@ -521,11 +642,15 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
521 |
|
522 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
523 |
|
524 |
-
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData'));
|
525 |
$paymentModelMock->expects($this->any())
|
526 |
->method('getConfigData')
|
527 |
->will($this->returnValue(true));
|
528 |
|
|
|
|
|
|
|
|
|
529 |
$feeProduct = new Varien_Object();
|
530 |
|
531 |
$feeDataHelperMock = $this->getHelperMock('paymentfee/data', array('getUpdatedFeeProduct'));
|
@@ -579,7 +704,8 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
579 |
|
580 |
$paymentModelMock = $this->getModelMock('billsafe/payment', array(
|
581 |
'getConfigData',
|
582 |
-
'checkIfAllItemsAreVirtual'
|
|
|
583 |
)
|
584 |
);
|
585 |
$paymentModelMock->expects($this->any())
|
@@ -599,6 +725,76 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
599 |
$this->replaceByMock('helper', 'paymentfee/data', $feeDataHelperMock);
|
600 |
|
601 |
$this->assertTrue($paymentModelMock->isAvailable($quote));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
}
|
603 |
|
604 |
/**
|
@@ -761,4 +957,26 @@ class Netresearch_Billsafe_Test_Model_PaymentTest extends EcomDev_PHPUnit_Test_C
|
|
761 |
->will($this->returnValue($client));
|
762 |
$this->assertEquals('', $paymentModelMock->getOrderPlaceRedirectUrl());
|
763 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
}
|
56 |
$this->assertEquals('foo', $model->getUnavailableMessage());
|
57 |
}
|
58 |
|
59 |
+
/**
|
60 |
+
* @loadFixture ../../../var/fixtures/orders.yaml
|
61 |
+
* @expectedException Mage_Core_Exception
|
62 |
+
*/
|
63 |
+
public function testPrevalidateOrderWithException()
|
64 |
+
{
|
65 |
+
$quote = Mage::getModel('sales/quote')->load(1);
|
66 |
+
$fakeCheckoutSession = $this->getModelMock('checkout/session', array('init', 'save'));
|
67 |
+
$this->replaceByMock('model', 'checkout/session', $fakeCheckoutSession);
|
68 |
+
$fakeCustomerSession = $this->getModelMock('customer/session', array('init', 'save'));
|
69 |
+
$this->replaceByMock('model', 'customer/session', $fakeCustomerSession);
|
70 |
+
$fakeResponse = new stdClass();
|
71 |
+
$fakeResponse->ack = 'OK';
|
72 |
+
$invoice = new stdClass();
|
73 |
+
$invoice->isAvailable = true;
|
74 |
+
$fakeResponse->invoice = $invoice;
|
75 |
+
|
76 |
+
$helperMock = $this->getHelperMock('billsafe/order', array('prevalidateOrder'));
|
77 |
+
$helperMock->expects($this->any())
|
78 |
+
->method('prevalidateOrder')
|
79 |
+
->will($this->throwException(new Exception()));
|
80 |
+
$this->replaceByMock('helper', 'billsafe/order', $helperMock);
|
81 |
+
$model = Mage::getModel('billsafe/payment');
|
82 |
+
$model->prevalidateOrder($quote);
|
83 |
+
}
|
84 |
+
|
85 |
/**
|
86 |
* @loadFixture ../../../var/fixtures/orders.yaml
|
87 |
*/
|
227 |
$this->assertEquals(Mage_Sales_Model_Order::STATE_PROCESSING, $order->getState());
|
228 |
}
|
229 |
|
230 |
+
/**
|
231 |
+
* @loadFixture ../../../var/fixtures/orders.yaml
|
232 |
+
*/
|
233 |
+
public function testAuthorizeWithToken()
|
234 |
+
{
|
235 |
+
$this->mockSessions();
|
236 |
+
$this->mockDataHelperForQuote();
|
237 |
+
|
238 |
+
$order = Mage::getModel('sales/order')->load(11);
|
239 |
+
$payment = $order->getPayment();
|
240 |
+
$amount = $order->getBaseGrandTotal();
|
241 |
+
$infoInstance = new Varien_Object();
|
242 |
+
$infoInstance->setOrder($order);
|
243 |
+
|
244 |
+
$configMock = $this->getModelMock('billsafe/config', array(
|
245 |
+
'isBillSafeDirectEnabled',
|
246 |
+
'getBillSafeOrderStatus'
|
247 |
+
)
|
248 |
+
);
|
249 |
+
$configMock->expects($this->any())
|
250 |
+
->method('isBillSafeDirectEnabled')
|
251 |
+
->will($this->returnValue(false));
|
252 |
+
|
253 |
+
$configMock->expects($this->any())
|
254 |
+
->method('getBillSafeOrderStatus')
|
255 |
+
->will($this->returnValue('pending'));
|
256 |
+
$this->replaceByMock('model', 'billsafe/config', $configMock);
|
257 |
+
|
258 |
+
$fakeResponse = new Varien_Object();
|
259 |
+
$fakeResponse->setResponseToken('token');
|
260 |
+
$clientMock = $this->getModelMock('billsafe/client', array('prepareOrder'));
|
261 |
+
$clientMock->expects($this->once())
|
262 |
+
->method('prepareOrder')
|
263 |
+
->will($this->returnValue($fakeResponse));
|
264 |
+
$this->replaceByMock('model', 'billsafe/client', $clientMock);
|
265 |
+
|
266 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getInfoInstance', 'cancel'));
|
267 |
+
$paymentModelMock->expects($this->any())
|
268 |
+
->method('getInfoInstance')
|
269 |
+
->will($this->returnValue($infoInstance));
|
270 |
+
$paymentModelMock->expects($this->any())
|
271 |
+
->method('cancel')
|
272 |
+
->will($this->returnValue(null));
|
273 |
+
$paymentModelMock->authorize($payment, $amount);
|
274 |
+
$this->assertEquals('token', Mage::registry(Netresearch_Billsafe_Model_Config::TOKEN_REGISTRY_KEY));
|
275 |
+
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* @loadFixture ../../../var/fixtures/orders.yaml
|
280 |
+
* @expectedException Mage_Core_Exception
|
281 |
+
*/
|
282 |
+
public function testAuthorizeWithTokenFails()
|
283 |
+
{
|
284 |
+
$this->mockSessions();
|
285 |
+
$this->mockDataHelperForQuote();
|
286 |
+
|
287 |
+
$order = Mage::getModel('sales/order')->load(11);
|
288 |
+
;
|
289 |
+
$infoInstance = new Varien_Object();
|
290 |
+
$infoInstance->setOrder($order);
|
291 |
+
|
292 |
+
$configMock = $this->getModelMock('billsafe/config', array(
|
293 |
+
'isBillSafeDirectEnabled',
|
294 |
+
)
|
295 |
+
);
|
296 |
+
$configMock->expects($this->any())
|
297 |
+
->method('isBillSafeDirectEnabled')
|
298 |
+
->will($this->returnValue(false));
|
299 |
+
|
300 |
+
$clientMock = $this->getModelMock('billsafe/client', array('prepareOrder'));
|
301 |
+
$clientMock->expects($this->once())
|
302 |
+
->method('prepareOrder')
|
303 |
+
->will($this->throwException(new Exception('catch me')));
|
304 |
+
$this->replaceByMock('model', 'billsafe/client', $clientMock);
|
305 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getInfoInstance', 'cancel'));
|
306 |
+
$paymentModelMock->expects($this->any())
|
307 |
+
->method('getInfoInstance')
|
308 |
+
->will($this->returnValue($infoInstance));
|
309 |
+
$paymentModelMock->expects($this->any())
|
310 |
+
->method('cancel')
|
311 |
+
->will($this->returnValue(null));
|
312 |
+
$paymentModelMock->authorize($order->getPayment(), $order->getBaseGrandTotal());
|
313 |
+
|
314 |
+
}
|
315 |
+
|
316 |
/**
|
317 |
* @loadFixture ../../../var/fixtures/orders.yaml
|
318 |
*/
|
477 |
->will($this->returnValue(10));
|
478 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
479 |
|
480 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData', 'checkIfAllItemsAreVirtual'));
|
481 |
$paymentModelMock->expects($this->any())
|
482 |
->method('getConfigData')
|
483 |
->will($this->returnValue(true));
|
484 |
+
$paymentModelMock->expects($this->any())
|
485 |
+
->method('checkIfAllItemsAreVirtual')
|
486 |
+
->will($this->returnValue(false));
|
487 |
$this->assertFalse($paymentModelMock->isAvailable($quote));
|
488 |
}
|
489 |
|
525 |
|
526 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
527 |
|
528 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData', 'checkIfAllItemsAreVirtual'));
|
529 |
$paymentModelMock->expects($this->any())
|
530 |
->method('getConfigData')
|
531 |
->will($this->returnValue(true));
|
532 |
+
$paymentModelMock->expects($this->any())
|
533 |
+
->method('checkIfAllItemsAreVirtual')
|
534 |
+
->will($this->returnValue(false));
|
535 |
|
536 |
$feeProduct = new Varien_Object();
|
537 |
$feeProduct->setExceedsMaxAmount(true);
|
588 |
|
589 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
590 |
|
591 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData', 'checkIfAllItemsAreVirtual'));
|
592 |
$paymentModelMock->expects($this->any())
|
593 |
->method('getConfigData')
|
594 |
->will($this->returnValue(true));
|
595 |
+
$paymentModelMock->expects($this->any())
|
596 |
+
->method('checkIfAllItemsAreVirtual')
|
597 |
+
->will($this->returnValue(false));
|
598 |
|
599 |
$feeProduct = new Varien_Object();
|
600 |
$feeProduct->setExceedsMaxAmount(false);
|
642 |
|
643 |
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
644 |
|
645 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array('getConfigData', 'checkIfAllItemsAreVirtual'));
|
646 |
$paymentModelMock->expects($this->any())
|
647 |
->method('getConfigData')
|
648 |
->will($this->returnValue(true));
|
649 |
|
650 |
+
$paymentModelMock->expects($this->any())
|
651 |
+
->method('checkIfAllItemsAreVirtual')
|
652 |
+
->will($this->returnValue(false));
|
653 |
+
|
654 |
$feeProduct = new Varien_Object();
|
655 |
|
656 |
$feeDataHelperMock = $this->getHelperMock('paymentfee/data', array('getUpdatedFeeProduct'));
|
704 |
|
705 |
$paymentModelMock = $this->getModelMock('billsafe/payment', array(
|
706 |
'getConfigData',
|
707 |
+
'checkIfAllItemsAreVirtual',
|
708 |
+
'prevalidateOrder'
|
709 |
)
|
710 |
);
|
711 |
$paymentModelMock->expects($this->any())
|
725 |
$this->replaceByMock('helper', 'paymentfee/data', $feeDataHelperMock);
|
726 |
|
727 |
$this->assertTrue($paymentModelMock->isAvailable($quote));
|
728 |
+
$quote->getShippingAddress()->setStreet('not equal anymore');
|
729 |
+
$this->assertFalse($paymentModelMock->isAvailable($quote));
|
730 |
+
}
|
731 |
+
|
732 |
+
/**
|
733 |
+
* @loadFixture ../../../var/fixtures/orders.yaml
|
734 |
+
*/
|
735 |
+
public function testIsAvailableReturnsFalseIfPrevalidateOrdercheckFails()
|
736 |
+
{
|
737 |
+
|
738 |
+
$tax = new Varien_Object();
|
739 |
+
$tax->setValue(10);
|
740 |
+
$quote = $this->getModelMock('sales/quote', array('getTotals'));
|
741 |
+
$quote->expects($this->any())
|
742 |
+
->method('getTotals')
|
743 |
+
->will($this->returnValue(array('tax' => $tax)));
|
744 |
+
|
745 |
+
$quote->setGrandTotal(110);
|
746 |
+
|
747 |
+
$sessionMock = $this->getModelMockBuilder('customer/session', array('getCustomer'))
|
748 |
+
->disableOriginalConstructor() // This one removes session_start and other methods usage
|
749 |
+
->getMock();
|
750 |
+
$customer = Mage::getModel('customer/customer');
|
751 |
+
$customer->setGroupId(1);
|
752 |
+
$sessionMock->expects($this->any())
|
753 |
+
->method('getCustomer')
|
754 |
+
->will($this->returnValue($customer));
|
755 |
+
$this->replaceByMock('singleton', 'customer/session', $sessionMock);
|
756 |
+
|
757 |
+
$configModelMock = $this->getModelMock('billsafe/config', array(
|
758 |
+
'getBillSafeMinAmount',
|
759 |
+
'getBillSafeMaxAmount',
|
760 |
+
)
|
761 |
+
);
|
762 |
+
$configModelMock->expects($this->any())
|
763 |
+
->method('getBillSafeMinAmount')
|
764 |
+
->will($this->returnValue(15));
|
765 |
+
|
766 |
+
$configModelMock->expects($this->any())
|
767 |
+
->method('getBillSafeMaxAmount')
|
768 |
+
->will($this->returnValue(999));
|
769 |
+
|
770 |
+
$this->replaceByMock('model', 'billsafe/config', $configModelMock);
|
771 |
+
|
772 |
+
$paymentModelMock = $this->getModelMock('billsafe/payment', array(
|
773 |
+
'getConfigData',
|
774 |
+
'checkIfAllItemsAreVirtual',
|
775 |
+
'prevalidateOrder'
|
776 |
+
)
|
777 |
+
);
|
778 |
+
$paymentModelMock->expects($this->any())
|
779 |
+
->method('checkIfAllItemsAreVirtual')
|
780 |
+
->will($this->returnValue(false));
|
781 |
+
|
782 |
+
$paymentModelMock->expects($this->any())
|
783 |
+
->method('getConfigData')
|
784 |
+
->will($this->returnValue(true));
|
785 |
+
$paymentModelMock->expects($this->any())
|
786 |
+
->method('prevalidateOrder')
|
787 |
+
->will($this->throwException(new Mage_Core_Exception('test exception')));
|
788 |
+
|
789 |
+
$feeProduct = new Varien_Object();
|
790 |
+
|
791 |
+
$feeDataHelperMock = $this->getHelperMock('paymentfee/data', array('getUpdatedFeeProduct'));
|
792 |
+
$feeDataHelperMock->expects($this->any())
|
793 |
+
->method('getUpdatedFeeProduct')
|
794 |
+
->will($this->returnValue($feeProduct));
|
795 |
+
$this->replaceByMock('helper', 'paymentfee/data', $feeDataHelperMock);
|
796 |
+
|
797 |
+
$this->assertFalse($paymentModelMock->isAvailable($quote));
|
798 |
}
|
799 |
|
800 |
/**
|
957 |
->will($this->returnValue($client));
|
958 |
$this->assertEquals('', $paymentModelMock->getOrderPlaceRedirectUrl());
|
959 |
}
|
960 |
+
|
961 |
+
protected function mockSessions()
|
962 |
+
{
|
963 |
+
$sessionMock = $this->getModelMockBuilder('checkout/session')
|
964 |
+
->disableOriginalConstructor() // This one removes session_start and other methods usage
|
965 |
+
->getMock();
|
966 |
+
$this->replaceByMock('singleton', 'checkout/session', $sessionMock);
|
967 |
+
|
968 |
+
$sessionMock = $this->getModelMockBuilder('customer/session')
|
969 |
+
->disableOriginalConstructor() // This one removes session_start and other methods usage
|
970 |
+
->getMock();
|
971 |
+
$this->replaceByMock('singleton', 'customer/session', $sessionMock);
|
972 |
+
}
|
973 |
+
|
974 |
+
protected function mockDataHelperForQuote()
|
975 |
+
{
|
976 |
+
$dataHelperMock = $this->getHelperMock('billsafe/data', array('getStoreIdfromQuote'));
|
977 |
+
$dataHelperMock->expects($this->any())
|
978 |
+
->method('getStoreIdfromQuote')
|
979 |
+
->will($this->returnValue(null));
|
980 |
+
$this->replaceByMock('helper', 'billsafe/data', $dataHelperMock);
|
981 |
+
}
|
982 |
}
|
app/code/community/Netresearch/Billsafe/controllers/PaymentController.php
CHANGED
@@ -18,7 +18,7 @@ class Netresearch_Billsafe_PaymentController extends Mage_Core_Controller_Front_
|
|
18 |
if (property_exists($response, 'declineReason') && property_exists($response->declineReason, 'buyerMessage')) {
|
19 |
$msg = $response->declineReason->buyerMessage;
|
20 |
}
|
21 |
-
Mage::getSingleton('
|
22 |
|
23 |
return $this->_redirect('checkout/cart');
|
24 |
}
|
@@ -58,7 +58,7 @@ class Netresearch_Billsafe_PaymentController extends Mage_Core_Controller_Front_
|
|
58 |
$this->cancelLastOrderAndRestoreCart();
|
59 |
// Set flash message
|
60 |
$msg = 'Billsafe payment has been cancelled';
|
61 |
-
Mage::getSingleton('
|
62 |
|
63 |
return $this->_redirect('checkout/cart');
|
64 |
}
|
18 |
if (property_exists($response, 'declineReason') && property_exists($response->declineReason, 'buyerMessage')) {
|
19 |
$msg = $response->declineReason->buyerMessage;
|
20 |
}
|
21 |
+
Mage::getSingleton('checkout/session')->addError(Mage::helper('billsafe')->__($msg));
|
22 |
|
23 |
return $this->_redirect('checkout/cart');
|
24 |
}
|
58 |
$this->cancelLastOrderAndRestoreCart();
|
59 |
// Set flash message
|
60 |
$msg = 'Billsafe payment has been cancelled';
|
61 |
+
Mage::getSingleton('checkout/session')->addNotice($this->getHelper()->__($msg));
|
62 |
|
63 |
return $this->_redirect('checkout/cart');
|
64 |
}
|
app/code/community/Netresearch/Billsafe/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Netresearch_Billsafe>
|
5 |
-
<version>
|
6 |
</Netresearch_Billsafe>
|
7 |
</modules>
|
8 |
|
@@ -27,6 +27,7 @@
|
|
27 |
<timeout>5</timeout>
|
28 |
<allowspecific>1</allowspecific>
|
29 |
<specificcountry>DE</specificcountry>
|
|
|
30 |
</billsafe>
|
31 |
</payment>
|
32 |
<payment_services>
|
@@ -43,11 +44,18 @@
|
|
43 |
<billsafe>
|
44 |
<class>Netresearch_Billsafe_Model</class>
|
45 |
</billsafe>
|
|
|
46 |
<invoicepdf>
|
47 |
<rewrite>
|
48 |
<pdf_items_invoice_info>Netresearch_Billsafe_Model_Pdf_Items_Invoice_Info</pdf_items_invoice_info>
|
49 |
</rewrite>
|
50 |
</invoicepdf>
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
</models>
|
52 |
<helpers>
|
53 |
<billsafe>
|
@@ -94,6 +102,15 @@
|
|
94 |
</billsafe_observer>
|
95 |
</observers>
|
96 |
</sales_order_invoice_load_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
</events>
|
98 |
</global>
|
99 |
<adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Netresearch_Billsafe>
|
5 |
+
<version>14.03.27</version>
|
6 |
</Netresearch_Billsafe>
|
7 |
</modules>
|
8 |
|
27 |
<timeout>5</timeout>
|
28 |
<allowspecific>1</allowspecific>
|
29 |
<specificcountry>DE</specificcountry>
|
30 |
+
<default_gender>Male</default_gender>
|
31 |
</billsafe>
|
32 |
</payment>
|
33 |
<payment_services>
|
44 |
<billsafe>
|
45 |
<class>Netresearch_Billsafe_Model</class>
|
46 |
</billsafe>
|
47 |
+
<!-- Symmetrics_InvoicePdf -->
|
48 |
<invoicepdf>
|
49 |
<rewrite>
|
50 |
<pdf_items_invoice_info>Netresearch_Billsafe_Model_Pdf_Items_Invoice_Info</pdf_items_invoice_info>
|
51 |
</rewrite>
|
52 |
</invoicepdf>
|
53 |
+
<!-- FireGento_Pdf -->
|
54 |
+
<firegento_pdf>
|
55 |
+
<rewrite>
|
56 |
+
<engine_invoice_default>Netresearch_Billsafe_Model_Pdf_Engine_Invoice_Default</engine_invoice_default>
|
57 |
+
</rewrite>
|
58 |
+
</firegento_pdf>
|
59 |
</models>
|
60 |
<helpers>
|
61 |
<billsafe>
|
102 |
</billsafe_observer>
|
103 |
</observers>
|
104 |
</sales_order_invoice_load_after>
|
105 |
+
<firegento_pdf_invoice_insert_note>
|
106 |
+
<observers>
|
107 |
+
<billsafe_observer>
|
108 |
+
<type>singleton</type>
|
109 |
+
<class>billsafe/observer</class>
|
110 |
+
<method>firegentoPdfInvoiceInsertNotice</method>
|
111 |
+
</billsafe_observer>
|
112 |
+
</observers>
|
113 |
+
</firegento_pdf_invoice_insert_note>
|
114 |
</events>
|
115 |
</global>
|
116 |
<adminhtml>
|
app/code/community/Netresearch/Billsafe/etc/system.xml
CHANGED
@@ -299,6 +299,17 @@
|
|
299 |
<active>1</active>
|
300 |
</depends>
|
301 |
</specificcountry>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
</fields>
|
303 |
</billsafe>
|
304 |
</groups>
|
299 |
<active>1</active>
|
300 |
</depends>
|
301 |
</specificcountry>
|
302 |
+
|
303 |
+
<default_gender>
|
304 |
+
<label>Default Customer Gender</label>
|
305 |
+
<comment>If customer gender cannot be determined from account data, use this as default value.</comment>
|
306 |
+
<frontend_type>select</frontend_type>
|
307 |
+
<sort_order>130</sort_order>
|
308 |
+
<source_model>billsafe/adminhtml_system_config_source_gender</source_model>
|
309 |
+
<show_in_default>1</show_in_default>
|
310 |
+
<show_in_website>1</show_in_website>
|
311 |
+
<show_in_store>1</show_in_store>
|
312 |
+
</default_gender>
|
313 |
</fields>
|
314 |
</billsafe>
|
315 |
</groups>
|
app/locale/de_DE/Netresearch_Billsafe.csv
CHANGED
@@ -67,4 +67,7 @@
|
|
67 |
"I agree with the <a href=""%s"" target=""_blank"">privacy policy</a>, the <a href=""%s"" target=""_blank"">credit check</a> of <a href=""%s"" target=""_blank"">Paypal</a>.", "Ich stimme den <a href=""%s"" target=""_blank"">Datenschutzgrundsätzen</a> und der <a href=""%s"" target=""_blank"">Bonitätsprüfung</a> von <a href=""%s"" target=""_blank"">PayPal</a> zu."
|
68 |
"The <a href=""%s"" target=""_blank"">BillSAFE terms and conditions</a> are applied.", "Es gelten die <a href=""%s"" target=""_blank"">Allgemeinen Geschäftsbedingungen</a> für den Rechnungskauf."
|
69 |
"Please select another payment method!", "Bitte wählen Sie eine andere Zahlungsart!"
|
70 |
-
|
|
|
|
|
|
67 |
"I agree with the <a href=""%s"" target=""_blank"">privacy policy</a>, the <a href=""%s"" target=""_blank"">credit check</a> of <a href=""%s"" target=""_blank"">Paypal</a>.", "Ich stimme den <a href=""%s"" target=""_blank"">Datenschutzgrundsätzen</a> und der <a href=""%s"" target=""_blank"">Bonitätsprüfung</a> von <a href=""%s"" target=""_blank"">PayPal</a> zu."
|
68 |
"The <a href=""%s"" target=""_blank"">BillSAFE terms and conditions</a> are applied.", "Es gelten die <a href=""%s"" target=""_blank"">Allgemeinen Geschäftsbedingungen</a> für den Rechnungskauf."
|
69 |
"Please select another payment method!", "Bitte wählen Sie eine andere Zahlungsart!"
|
70 |
+
"Default Customer Gender","Standardwert für Geschlecht"
|
71 |
+
"If customer gender cannot be determined from account data, use this as default value.","Dieser Wert wird genutzt wenn keine Angaben in den Kundendaten gefunden werden konnten."
|
72 |
+
"Male","männlich"
|
73 |
+
"Female","weiblich"
|
doc/Netresearch_Billsafe/ChangeLog.pdf
CHANGED
@@ -71,7 +71,7 @@ endobj
|
|
71 |
% 'R7': class PDFInfo
|
72 |
7 0 obj
|
73 |
<< /Author ()
|
74 |
-
/CreationDate (D:
|
75 |
/Keywords ()
|
76 |
/Producer (ReportLab http://www.reportlab.com)
|
77 |
/Subject (\(unspecified\))
|
@@ -87,7 +87,7 @@ endobj
|
|
87 |
% 'R9': class PDFStream
|
88 |
9 0 obj
|
89 |
% page stream
|
90 |
-
<< /Length
|
91 |
stream
|
92 |
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
|
93 |
q
|
@@ -108,23 +108,25 @@ q
|
|
108 |
1 0 0 1 62.69291 638.3307 cm
|
109 |
Q
|
110 |
q
|
111 |
-
1 0 0 1 62.69291
|
112 |
1 1 1 rg
|
113 |
-
n 0
|
114 |
.878431 .878431 .878431 rg
|
115 |
-
n 0
|
116 |
1 1 1 rg
|
117 |
-
n 0
|
118 |
.878431 .878431 .878431 rg
|
119 |
-
n 0
|
120 |
1 1 1 rg
|
|
|
|
|
121 |
n 0 36 469.8898 -36 re f*
|
122 |
.960784 .960784 .862745 rg
|
123 |
-
n 0
|
124 |
0 .533333 .603922 rg
|
125 |
BT /F1 10 Tf 12 TL ET
|
126 |
q
|
127 |
-
1 0 0 1 6
|
128 |
q
|
129 |
.960784 .960784 .862745 rg
|
130 |
n 0 0 46.73622 12 re f*
|
@@ -135,7 +137,7 @@ BT 1 0 0 1 0 4.82 Tm /F2 10 Tf 12 TL 2.52811 0 Td (Revision) Tj T* -2.52811 0 Td
|
|
135 |
Q
|
136 |
Q
|
137 |
q
|
138 |
-
1 0 0 1 64.73622
|
139 |
q
|
140 |
.960784 .960784 .862745 rg
|
141 |
n 0 0 46.73622 12 re f*
|
@@ -146,7 +148,7 @@ BT 1 0 0 1 0 4.82 Tm /F2 10 Tf 12 TL 12.53311 0 Td (Date) Tj T* -12.53311 0 Td E
|
|
146 |
Q
|
147 |
Q
|
148 |
q
|
149 |
-
1 0 0 1 123.4724
|
150 |
q
|
151 |
.960784 .960784 .862745 rg
|
152 |
n 0 0 340.4173 12 re f*
|
@@ -158,6 +160,166 @@ Q
|
|
158 |
Q
|
159 |
0 0 0 rg
|
160 |
q
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
1 0 0 1 6 249 cm
|
162 |
q
|
163 |
0 0 0 rg
|
@@ -523,23 +685,24 @@ q
|
|
523 |
1 j
|
524 |
0 0 0 RG
|
525 |
.25 w
|
|
|
526 |
n 0 264 m 469.8898 264 l S
|
527 |
n 0 144 m 469.8898 144 l S
|
528 |
n 0 90 m 469.8898 90 l S
|
529 |
n 0 36 m 469.8898 36 l S
|
530 |
-
n 58.73622 0 m 58.73622
|
531 |
-
n 117.4724 0 m 117.4724
|
532 |
-
n 0
|
533 |
n 0 0 m 469.8898 0 l S
|
534 |
-
n 0 0 m 0
|
535 |
-
n 469.8898 0 m 469.8898
|
536 |
Q
|
537 |
Q
|
538 |
q
|
539 |
-
1 0 0 1 62.69291
|
540 |
Q
|
541 |
q
|
542 |
-
1 0 0 1 62.69291
|
543 |
Q
|
544 |
q
|
545 |
1 0 0 1 426.3422 728.5039 cm
|
@@ -601,17 +764,17 @@ xref
|
|
601 |
0000018047 00000 n
|
602 |
0000018280 00000 n
|
603 |
0000018385 00000 n
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
trailer
|
608 |
<< /ID
|
609 |
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
|
610 |
-
[(\
|
611 |
|
612 |
/Info 7 0 R
|
613 |
/Root 6 0 R
|
614 |
/Size 13 >>
|
615 |
startxref
|
616 |
-
|
617 |
%%EOF
|
71 |
% 'R7': class PDFInfo
|
72 |
7 0 obj
|
73 |
<< /Author ()
|
74 |
+
/CreationDate (D:20140327143413-01'00')
|
75 |
/Keywords ()
|
76 |
/Producer (ReportLab http://www.reportlab.com)
|
77 |
/Subject (\(unspecified\))
|
87 |
% 'R9': class PDFStream
|
88 |
9 0 obj
|
89 |
% page stream
|
90 |
+
<< /Length 9701 >>
|
91 |
stream
|
92 |
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
|
93 |
q
|
108 |
1 0 0 1 62.69291 638.3307 cm
|
109 |
Q
|
110 |
q
|
111 |
+
1 0 0 1 62.69291 212.3307 cm
|
112 |
1 1 1 rg
|
113 |
+
n 0 426 469.8898 -18 re f*
|
114 |
.878431 .878431 .878431 rg
|
115 |
+
n 0 408 469.8898 -144 re f*
|
116 |
1 1 1 rg
|
117 |
+
n 0 264 469.8898 -120 re f*
|
118 |
.878431 .878431 .878431 rg
|
119 |
+
n 0 144 469.8898 -54 re f*
|
120 |
1 1 1 rg
|
121 |
+
n 0 90 469.8898 -54 re f*
|
122 |
+
.878431 .878431 .878431 rg
|
123 |
n 0 36 469.8898 -36 re f*
|
124 |
.960784 .960784 .862745 rg
|
125 |
+
n 0 426 469.8898 -18 re f*
|
126 |
0 .533333 .603922 rg
|
127 |
BT /F1 10 Tf 12 TL ET
|
128 |
q
|
129 |
+
1 0 0 1 6 411 cm
|
130 |
q
|
131 |
.960784 .960784 .862745 rg
|
132 |
n 0 0 46.73622 12 re f*
|
137 |
Q
|
138 |
Q
|
139 |
q
|
140 |
+
1 0 0 1 64.73622 411 cm
|
141 |
q
|
142 |
.960784 .960784 .862745 rg
|
143 |
n 0 0 46.73622 12 re f*
|
148 |
Q
|
149 |
Q
|
150 |
q
|
151 |
+
1 0 0 1 123.4724 411 cm
|
152 |
q
|
153 |
.960784 .960784 .862745 rg
|
154 |
n 0 0 340.4173 12 re f*
|
160 |
Q
|
161 |
0 0 0 rg
|
162 |
q
|
163 |
+
1 0 0 1 6 393 cm
|
164 |
+
q
|
165 |
+
0 0 0 rg
|
166 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (14.03.27) Tj T* ET
|
167 |
+
Q
|
168 |
+
Q
|
169 |
+
q
|
170 |
+
1 0 0 1 64.73622 393 cm
|
171 |
+
q
|
172 |
+
0 0 0 rg
|
173 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (2014-03-27) Tj T* ET
|
174 |
+
Q
|
175 |
+
Q
|
176 |
+
q
|
177 |
+
1 0 0 1 123.4724 393 cm
|
178 |
+
q
|
179 |
+
0 0 0 rg
|
180 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Features:) Tj T* ET
|
181 |
+
Q
|
182 |
+
Q
|
183 |
+
q
|
184 |
+
1 0 0 1 123.4724 387 cm
|
185 |
+
Q
|
186 |
+
q
|
187 |
+
1 0 0 1 123.4724 387 cm
|
188 |
+
Q
|
189 |
+
q
|
190 |
+
1 0 0 1 123.4724 375 cm
|
191 |
+
0 0 0 rg
|
192 |
+
BT /F1 10 Tf 12 TL ET
|
193 |
+
q
|
194 |
+
1 0 0 1 6 -3 cm
|
195 |
+
q
|
196 |
+
0 0 0 rg
|
197 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 10.5 0 Td (\177) Tj T* -10.5 0 Td ET
|
198 |
+
Q
|
199 |
+
Q
|
200 |
+
q
|
201 |
+
1 0 0 1 23 -3 cm
|
202 |
+
q
|
203 |
+
0 0 0 rg
|
204 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Configure customer default gender for API transmission) Tj T* ET
|
205 |
+
Q
|
206 |
+
Q
|
207 |
+
q
|
208 |
+
Q
|
209 |
+
Q
|
210 |
+
q
|
211 |
+
1 0 0 1 123.4724 369 cm
|
212 |
+
Q
|
213 |
+
q
|
214 |
+
1 0 0 1 123.4724 345 cm
|
215 |
+
0 0 0 rg
|
216 |
+
BT /F1 10 Tf 12 TL ET
|
217 |
+
q
|
218 |
+
1 0 0 1 6 9 cm
|
219 |
+
q
|
220 |
+
0 0 0 rg
|
221 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 10.5 0 Td (\177) Tj T* -10.5 0 Td ET
|
222 |
+
Q
|
223 |
+
Q
|
224 |
+
q
|
225 |
+
1 0 0 1 23 -3 cm
|
226 |
+
q
|
227 |
+
0 0 0 rg
|
228 |
+
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL 8.534554 Tw (Modify FireGento_Pdf invoice printing according to BillSAFE) Tj T* 0 Tw (requirements) Tj T* ET
|
229 |
+
Q
|
230 |
+
Q
|
231 |
+
q
|
232 |
+
Q
|
233 |
+
Q
|
234 |
+
q
|
235 |
+
1 0 0 1 123.4724 345 cm
|
236 |
+
Q
|
237 |
+
q
|
238 |
+
1 0 0 1 123.4724 333 cm
|
239 |
+
q
|
240 |
+
0 0 0 rg
|
241 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Improvements:) Tj T* ET
|
242 |
+
Q
|
243 |
+
Q
|
244 |
+
q
|
245 |
+
1 0 0 1 123.4724 327 cm
|
246 |
+
Q
|
247 |
+
q
|
248 |
+
1 0 0 1 123.4724 327 cm
|
249 |
+
Q
|
250 |
+
q
|
251 |
+
1 0 0 1 123.4724 303 cm
|
252 |
+
0 0 0 rg
|
253 |
+
BT /F1 10 Tf 12 TL ET
|
254 |
+
q
|
255 |
+
1 0 0 1 6 9 cm
|
256 |
+
q
|
257 |
+
0 0 0 rg
|
258 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 10.5 0 Td (\177) Tj T* -10.5 0 Td ET
|
259 |
+
Q
|
260 |
+
Q
|
261 |
+
q
|
262 |
+
1 0 0 1 23 -3 cm
|
263 |
+
q
|
264 |
+
0 0 0 rg
|
265 |
+
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL 3.921046 Tw (Obtain "Country Code" API parameter dynamically from customer) Tj T* 0 Tw (address) Tj T* ET
|
266 |
+
Q
|
267 |
+
Q
|
268 |
+
q
|
269 |
+
Q
|
270 |
+
Q
|
271 |
+
q
|
272 |
+
1 0 0 1 123.4724 297 cm
|
273 |
+
Q
|
274 |
+
q
|
275 |
+
1 0 0 1 123.4724 285 cm
|
276 |
+
0 0 0 rg
|
277 |
+
BT /F1 10 Tf 12 TL ET
|
278 |
+
q
|
279 |
+
1 0 0 1 6 -3 cm
|
280 |
+
q
|
281 |
+
0 0 0 rg
|
282 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 10.5 0 Td (\177) Tj T* -10.5 0 Td ET
|
283 |
+
Q
|
284 |
+
Q
|
285 |
+
q
|
286 |
+
1 0 0 1 23 -3 cm
|
287 |
+
q
|
288 |
+
0 0 0 rg
|
289 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Display API error messages in customer session) Tj T* ET
|
290 |
+
Q
|
291 |
+
Q
|
292 |
+
q
|
293 |
+
Q
|
294 |
+
Q
|
295 |
+
q
|
296 |
+
1 0 0 1 123.4724 279 cm
|
297 |
+
Q
|
298 |
+
q
|
299 |
+
1 0 0 1 123.4724 267 cm
|
300 |
+
0 0 0 rg
|
301 |
+
BT /F1 10 Tf 12 TL ET
|
302 |
+
q
|
303 |
+
1 0 0 1 6 -3 cm
|
304 |
+
q
|
305 |
+
0 0 0 rg
|
306 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL 10.5 0 Td (\177) Tj T* -10.5 0 Td ET
|
307 |
+
Q
|
308 |
+
Q
|
309 |
+
q
|
310 |
+
1 0 0 1 23 -3 cm
|
311 |
+
q
|
312 |
+
0 0 0 rg
|
313 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Handle unavailable BillSAFE API) Tj T* ET
|
314 |
+
Q
|
315 |
+
Q
|
316 |
+
q
|
317 |
+
Q
|
318 |
+
Q
|
319 |
+
q
|
320 |
+
1 0 0 1 123.4724 267 cm
|
321 |
+
Q
|
322 |
+
q
|
323 |
1 0 0 1 6 249 cm
|
324 |
q
|
325 |
0 0 0 rg
|
685 |
1 j
|
686 |
0 0 0 RG
|
687 |
.25 w
|
688 |
+
n 0 408 m 469.8898 408 l S
|
689 |
n 0 264 m 469.8898 264 l S
|
690 |
n 0 144 m 469.8898 144 l S
|
691 |
n 0 90 m 469.8898 90 l S
|
692 |
n 0 36 m 469.8898 36 l S
|
693 |
+
n 58.73622 0 m 58.73622 426 l S
|
694 |
+
n 117.4724 0 m 117.4724 426 l S
|
695 |
+
n 0 426 m 469.8898 426 l S
|
696 |
n 0 0 m 469.8898 0 l S
|
697 |
+
n 0 0 m 0 426 l S
|
698 |
+
n 469.8898 0 m 469.8898 426 l S
|
699 |
Q
|
700 |
Q
|
701 |
q
|
702 |
+
1 0 0 1 62.69291 212.3307 cm
|
703 |
Q
|
704 |
q
|
705 |
+
1 0 0 1 62.69291 212.3307 cm
|
706 |
Q
|
707 |
q
|
708 |
1 0 0 1 426.3422 728.5039 cm
|
764 |
0000018047 00000 n
|
765 |
0000018280 00000 n
|
766 |
0000018385 00000 n
|
767 |
+
0000028188 00000 n
|
768 |
+
0000028271 00000 n
|
769 |
+
0000028364 00000 n
|
770 |
trailer
|
771 |
<< /ID
|
772 |
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
|
773 |
+
[(\254rg\303\376\005\273\343\242\013\256\235]\010]P) (\254rg\303\376\005\273\343\242\013\256\235]\010]P)]
|
774 |
|
775 |
/Info 7 0 R
|
776 |
/Root 6 0 R
|
777 |
/Size 13 >>
|
778 |
startxref
|
779 |
+
28411
|
780 |
%%EOF
|
doc/Netresearch_Billsafe/README.pdf
CHANGED
@@ -1339,7 +1339,7 @@ endobj
|
|
1339 |
% 'R77': class PDFInfo
|
1340 |
77 0 obj
|
1341 |
<< /Author ()
|
1342 |
-
/CreationDate (D:
|
1343 |
/Keywords ()
|
1344 |
/Producer (ReportLab http://www.reportlab.com)
|
1345 |
/Subject (\(unspecified\))
|
@@ -2307,174 +2307,191 @@ endobj
|
|
2307 |
% 'R97': class PDFStream
|
2308 |
97 0 obj
|
2309 |
% page stream
|
2310 |
-
<< /Length
|
2311 |
stream
|
2312 |
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
|
2313 |
q
|
2314 |
-
1 0 0 1 62.69291
|
2315 |
1 1 1 rg
|
2316 |
-
n 0
|
2317 |
.878431 .878431 .878431 rg
|
2318 |
-
n 0
|
2319 |
1 1 1 rg
|
2320 |
-
n 0
|
2321 |
.878431 .878431 .878431 rg
|
2322 |
-
n 0
|
2323 |
1 1 1 rg
|
2324 |
-
n 0
|
2325 |
.878431 .878431 .878431 rg
|
2326 |
-
n 0
|
2327 |
1 1 1 rg
|
2328 |
-
n 0
|
2329 |
.878431 .878431 .878431 rg
|
2330 |
-
n 0
|
|
|
|
|
2331 |
0 0 0 rg
|
2332 |
BT /F1 10 Tf 12 TL ET
|
2333 |
q
|
2334 |
-
1 0 0 1 6
|
2335 |
q
|
2336 |
0 0 0 rg
|
2337 |
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL (Produkt-SKU) Tj T* (Zahlungsartenaufschlag) Tj T* ET
|
2338 |
Q
|
2339 |
Q
|
2340 |
q
|
2341 |
-
1 0 0 1 162.6299
|
2342 |
q
|
2343 |
0 0 0 rg
|
2344 |
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Falls Sie einen Aufschlag auf BillSAFE-Zahlungen vom Kunden) Tj T* (verlangen m\366chten, geben Sie hier die SKU des Produktes an,) Tj T* (welches f\374r den Zahlungsartenaufschlag verwendet werden soll. Im) Tj T* (Folgenden wird dies genauer beschrieben.) Tj T* ET
|
2345 |
Q
|
2346 |
Q
|
2347 |
q
|
2348 |
-
1 0 0 1 6
|
2349 |
q
|
2350 |
0 0 0 rg
|
2351 |
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Zahlungsart deaktivieren, wenn) Tj T* (der maximale) Tj T* (Zahlartenaufschlag \374berstiegen) Tj T* (wird) Tj T* ET
|
2352 |
Q
|
2353 |
Q
|
2354 |
q
|
2355 |
-
1 0 0 1 162.6299
|
2356 |
q
|
2357 |
0 0 0 rg
|
2358 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Wenn diese Option aktiviert ist, steht BillSAFE nicht zur Auswahl,) Tj T* (falls der Warenkorbwert \(inkl. Versand, ohne Zahlartenaufschlag\),) Tj T* (die festgelegte Obergrenze \374bersteigt.) Tj T* ET
|
2359 |
Q
|
2360 |
Q
|
2361 |
q
|
2362 |
-
1 0 0 1 6
|
2363 |
q
|
2364 |
0 0 0 rg
|
2365 |
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Zahlungsart deaktivieren, wenn) Tj T* (der minimale) Tj T* (Zahlartenaufschlag) Tj T* (unterschritten wird) Tj T* ET
|
2366 |
Q
|
2367 |
Q
|
2368 |
q
|
2369 |
-
1 0 0 1 162.6299
|
2370 |
q
|
2371 |
0 0 0 rg
|
2372 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Wenn diese Option aktiviert ist, steht BillSAFE nicht zur Auswahl,) Tj T* (falls der Warenkorbwert \(inkl. Versand, ohne Zahlartenaufschlag\),) Tj T* (die festgelegte Untergrenze unterschreitet.) Tj T* ET
|
2373 |
Q
|
2374 |
Q
|
2375 |
q
|
2376 |
-
1 0 0 1 6
|
2377 |
q
|
2378 |
0 0 0 rg
|
2379 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Maximal-/Standard-Aufschlag) Tj T* ET
|
2380 |
Q
|
2381 |
Q
|
2382 |
q
|
2383 |
-
1 0 0 1 162.6299
|
2384 |
q
|
2385 |
0 0 0 rg
|
2386 |
BT 1 0 0 1 0 64.82 Tm /F1 10 Tf 12 TL (Maximal- und zugleich Standardwert f\374r den Zahlartenaufschlag.) Tj T* (Dieser Wert sollte den in der BillSAFE-Konfiguration eingestellten) Tj T* (Wert nicht \374berschreiten, andernfalls erh\344lt man eine) Tj T* (Fehlermeldung. Wird der Wert in der BillSAFE-Konfiguration) Tj T* (ge\344ndert, so muss die Konfiguration der Zahlungsart im Magento) Tj T* (neu gespeichert werden, damit der Abgleich der Werte erfolgt.) Tj T* ET
|
2387 |
Q
|
2388 |
Q
|
2389 |
q
|
2390 |
-
1 0 0 1 6
|
2391 |
q
|
2392 |
0 0 0 rg
|
2393 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Minimaler Zahlartenaufschlag) Tj T* ET
|
2394 |
Q
|
2395 |
Q
|
2396 |
q
|
2397 |
-
1 0 0 1 162.6299
|
2398 |
q
|
2399 |
0 0 0 rg
|
2400 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Minimaler Wert f\374r den Zahlartenaufschlag. Muss nur eingestellt) Tj T* (werden, wenn ein prozentualer Zahlartenaufschlag angegeben) Tj T* (wurde.) Tj T* ET
|
2401 |
Q
|
2402 |
Q
|
2403 |
q
|
2404 |
-
1 0 0 1 6
|
2405 |
q
|
2406 |
0 0 0 rg
|
2407 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Prozentualer Zahlartenaufschlag) Tj T* ET
|
2408 |
Q
|
2409 |
Q
|
2410 |
q
|
2411 |
-
1 0 0 1 162.6299
|
2412 |
q
|
2413 |
0 0 0 rg
|
2414 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Prozent vom Warenwert zzgl. Versand. Wird dieses Feld leer) Tj T* (gelassen, so gilt der Maximal-/Standard-Aufschlag f\374r jede Zahlung) Tj T* (mit BillSAFE.) Tj T* ET
|
2415 |
Q
|
2416 |
Q
|
2417 |
q
|
2418 |
-
1 0 0 1 6
|
2419 |
q
|
2420 |
0 0 0 rg
|
2421 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Fehlerprotokollierung aktivieren) Tj T* ET
|
2422 |
Q
|
2423 |
Q
|
2424 |
q
|
2425 |
-
1 0 0 1 162.6299
|
2426 |
q
|
2427 |
BT 1 0 0 1 0 88.82 Tm 12 TL /F1 10 Tf 0 0 0 rg (Wenn dieser Wert auf "Ja" gesetzt ist, werden alle API-Aufrufe an) Tj T* (BillSAFE in eine separate ) Tj /F3 10 Tf (billsafe.log) Tj /F1 10 Tf (-Datei geschrieben. Die) Tj T* (Log-Eintr\344ge enthalten alle Parameter des Requests und die) Tj T* (entsprechenden BillSAFE-Antwort \(Response\). Die entsprechende) Tj T* (Datei findet sich im Normalfall im ) Tj /F3 10 Tf (/var/log) Tj /F1 10 Tf (-Verzeichnis der) Tj T* (Magento-Installation. Diese Einstellung sollte genau wie der) Tj T* (Testmodus nur zu Test- und Debug-Zwecken, sowie w\344hrend der) Tj T* (Entwicklung, aktiviert werden.) Tj T* ET
|
2428 |
Q
|
2429 |
Q
|
2430 |
q
|
2431 |
-
1 0 0 1 6
|
2432 |
q
|
2433 |
0 0 0 rg
|
2434 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Reihenfolge) Tj T* ET
|
2435 |
Q
|
2436 |
Q
|
2437 |
q
|
2438 |
-
1 0 0 1 162.6299
|
2439 |
q
|
2440 |
0 0 0 rg
|
2441 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Die Stelle in der Liste m\366glicher Zahlungsmethoden im Checkout) Tj T* (auf dem diese Zahlart auf der Auswahlseite erscheint. Je kleiner die) Tj T* (Zahl, desto weiter oben erscheint diese.) Tj T* ET
|
2442 |
Q
|
2443 |
Q
|
2444 |
q
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2445 |
1 J
|
2446 |
1 j
|
2447 |
0 0 0 RG
|
2448 |
.25 w
|
|
|
2449 |
n 0 468 m 469.8898 468 l S
|
2450 |
n 0 414 m 469.8898 414 l S
|
2451 |
n 0 360 m 469.8898 360 l S
|
2452 |
-
n 0
|
2453 |
-
n 0
|
2454 |
-
n 0
|
2455 |
-
n 0
|
2456 |
-
n 0
|
2457 |
-
n 156.6299 0 m 156.6299
|
2458 |
-
n 0 0 m 0
|
2459 |
-
n 469.8898 0 m 469.8898
|
2460 |
n 0 0 m 469.8898 0 l S
|
2461 |
Q
|
2462 |
Q
|
2463 |
q
|
2464 |
-
1 0 0 1 62.69291
|
2465 |
Q
|
2466 |
q
|
2467 |
-
1 0 0 1 62.69291
|
2468 |
q
|
2469 |
0 0 0 rg
|
2470 |
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL .945814 Tw (Bei der Verwendung von Market Ready Germany sind die folgenden Einstellungen vorzunehmen, damit) Tj T* 0 Tw (die BillSAFE Rechnungsinformationen auf dem Ausdruck erscheinen:) Tj T* ET
|
2471 |
Q
|
2472 |
Q
|
2473 |
q
|
2474 |
-
1 0 0 1 62.69291
|
2475 |
Q
|
2476 |
q
|
2477 |
-
1 0 0 1 62.69291
|
2478 |
0 0 0 rg
|
2479 |
BT /F1 10 Tf 12 TL ET
|
2480 |
BT 1 0 0 1 0 2 Tm T* ET
|
@@ -2534,10 +2551,10 @@ q
|
|
2534 |
Q
|
2535 |
Q
|
2536 |
q
|
2537 |
-
1 0 0 1 62.69291
|
2538 |
Q
|
2539 |
q
|
2540 |
-
1 0 0 1 62.69291
|
2541 |
Q
|
2542 |
q
|
2543 |
1 0 0 1 426.3422 728.5039 cm
|
@@ -3621,37 +3638,37 @@ xref
|
|
3621 |
0000623262 00000 n
|
3622 |
0000624718 00000 n
|
3623 |
0000632549 00000 n
|
3624 |
-
|
3625 |
-
|
3626 |
-
|
3627 |
-
|
3628 |
-
|
3629 |
-
|
3630 |
-
|
3631 |
-
|
3632 |
-
|
3633 |
-
|
3634 |
-
|
3635 |
-
|
3636 |
-
|
3637 |
-
|
3638 |
-
|
3639 |
-
|
3640 |
-
|
3641 |
-
|
3642 |
-
|
3643 |
-
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
trailer
|
3648 |
<< /ID
|
3649 |
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
|
3650 |
-
[(
|
3651 |
|
3652 |
/Info 77 0 R
|
3653 |
/Root 76 0 R
|
3654 |
/Size 121 >>
|
3655 |
startxref
|
3656 |
-
|
3657 |
%%EOF
|
1339 |
% 'R77': class PDFInfo
|
1340 |
77 0 obj
|
1341 |
<< /Author ()
|
1342 |
+
/CreationDate (D:20140327143410-01'00')
|
1343 |
/Keywords ()
|
1344 |
/Producer (ReportLab http://www.reportlab.com)
|
1345 |
/Subject (\(unspecified\))
|
2307 |
% 'R97': class PDFStream
|
2308 |
97 0 obj
|
2309 |
% page stream
|
2310 |
+
<< /Length 7258 >>
|
2311 |
stream
|
2312 |
1 0 0 1 0 0 cm BT /F1 12 Tf 14.4 TL ET
|
2313 |
q
|
2314 |
+
1 0 0 1 62.69291 186.3307 cm
|
2315 |
1 1 1 rg
|
2316 |
+
n 0 522 469.8898 -54 re f*
|
2317 |
.878431 .878431 .878431 rg
|
2318 |
+
n 0 468 469.8898 -54 re f*
|
2319 |
1 1 1 rg
|
2320 |
+
n 0 414 469.8898 -54 re f*
|
2321 |
.878431 .878431 .878431 rg
|
2322 |
+
n 0 360 469.8898 -78 re f*
|
2323 |
1 1 1 rg
|
2324 |
+
n 0 282 469.8898 -42 re f*
|
2325 |
.878431 .878431 .878431 rg
|
2326 |
+
n 0 240 469.8898 -42 re f*
|
2327 |
1 1 1 rg
|
2328 |
+
n 0 198 469.8898 -102 re f*
|
2329 |
.878431 .878431 .878431 rg
|
2330 |
+
n 0 96 469.8898 -42 re f*
|
2331 |
+
1 1 1 rg
|
2332 |
+
n 0 54 469.8898 -54 re f*
|
2333 |
0 0 0 rg
|
2334 |
BT /F1 10 Tf 12 TL ET
|
2335 |
q
|
2336 |
+
1 0 0 1 6 495 cm
|
2337 |
q
|
2338 |
0 0 0 rg
|
2339 |
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL (Produkt-SKU) Tj T* (Zahlungsartenaufschlag) Tj T* ET
|
2340 |
Q
|
2341 |
Q
|
2342 |
q
|
2343 |
+
1 0 0 1 162.6299 471 cm
|
2344 |
q
|
2345 |
0 0 0 rg
|
2346 |
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Falls Sie einen Aufschlag auf BillSAFE-Zahlungen vom Kunden) Tj T* (verlangen m\366chten, geben Sie hier die SKU des Produktes an,) Tj T* (welches f\374r den Zahlungsartenaufschlag verwendet werden soll. Im) Tj T* (Folgenden wird dies genauer beschrieben.) Tj T* ET
|
2347 |
Q
|
2348 |
Q
|
2349 |
q
|
2350 |
+
1 0 0 1 6 417 cm
|
2351 |
q
|
2352 |
0 0 0 rg
|
2353 |
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Zahlungsart deaktivieren, wenn) Tj T* (der maximale) Tj T* (Zahlartenaufschlag \374berstiegen) Tj T* (wird) Tj T* ET
|
2354 |
Q
|
2355 |
Q
|
2356 |
q
|
2357 |
+
1 0 0 1 162.6299 429 cm
|
2358 |
q
|
2359 |
0 0 0 rg
|
2360 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Wenn diese Option aktiviert ist, steht BillSAFE nicht zur Auswahl,) Tj T* (falls der Warenkorbwert \(inkl. Versand, ohne Zahlartenaufschlag\),) Tj T* (die festgelegte Obergrenze \374bersteigt.) Tj T* ET
|
2361 |
Q
|
2362 |
Q
|
2363 |
q
|
2364 |
+
1 0 0 1 6 363 cm
|
2365 |
q
|
2366 |
0 0 0 rg
|
2367 |
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Zahlungsart deaktivieren, wenn) Tj T* (der minimale) Tj T* (Zahlartenaufschlag) Tj T* (unterschritten wird) Tj T* ET
|
2368 |
Q
|
2369 |
Q
|
2370 |
q
|
2371 |
+
1 0 0 1 162.6299 375 cm
|
2372 |
q
|
2373 |
0 0 0 rg
|
2374 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Wenn diese Option aktiviert ist, steht BillSAFE nicht zur Auswahl,) Tj T* (falls der Warenkorbwert \(inkl. Versand, ohne Zahlartenaufschlag\),) Tj T* (die festgelegte Untergrenze unterschreitet.) Tj T* ET
|
2375 |
Q
|
2376 |
Q
|
2377 |
q
|
2378 |
+
1 0 0 1 6 345 cm
|
2379 |
q
|
2380 |
0 0 0 rg
|
2381 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Maximal-/Standard-Aufschlag) Tj T* ET
|
2382 |
Q
|
2383 |
Q
|
2384 |
q
|
2385 |
+
1 0 0 1 162.6299 285 cm
|
2386 |
q
|
2387 |
0 0 0 rg
|
2388 |
BT 1 0 0 1 0 64.82 Tm /F1 10 Tf 12 TL (Maximal- und zugleich Standardwert f\374r den Zahlartenaufschlag.) Tj T* (Dieser Wert sollte den in der BillSAFE-Konfiguration eingestellten) Tj T* (Wert nicht \374berschreiten, andernfalls erh\344lt man eine) Tj T* (Fehlermeldung. Wird der Wert in der BillSAFE-Konfiguration) Tj T* (ge\344ndert, so muss die Konfiguration der Zahlungsart im Magento) Tj T* (neu gespeichert werden, damit der Abgleich der Werte erfolgt.) Tj T* ET
|
2389 |
Q
|
2390 |
Q
|
2391 |
q
|
2392 |
+
1 0 0 1 6 267 cm
|
2393 |
q
|
2394 |
0 0 0 rg
|
2395 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Minimaler Zahlartenaufschlag) Tj T* ET
|
2396 |
Q
|
2397 |
Q
|
2398 |
q
|
2399 |
+
1 0 0 1 162.6299 243 cm
|
2400 |
q
|
2401 |
0 0 0 rg
|
2402 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Minimaler Wert f\374r den Zahlartenaufschlag. Muss nur eingestellt) Tj T* (werden, wenn ein prozentualer Zahlartenaufschlag angegeben) Tj T* (wurde.) Tj T* ET
|
2403 |
Q
|
2404 |
Q
|
2405 |
q
|
2406 |
+
1 0 0 1 6 225 cm
|
2407 |
q
|
2408 |
0 0 0 rg
|
2409 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Prozentualer Zahlartenaufschlag) Tj T* ET
|
2410 |
Q
|
2411 |
Q
|
2412 |
q
|
2413 |
+
1 0 0 1 162.6299 201 cm
|
2414 |
q
|
2415 |
0 0 0 rg
|
2416 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Prozent vom Warenwert zzgl. Versand. Wird dieses Feld leer) Tj T* (gelassen, so gilt der Maximal-/Standard-Aufschlag f\374r jede Zahlung) Tj T* (mit BillSAFE.) Tj T* ET
|
2417 |
Q
|
2418 |
Q
|
2419 |
q
|
2420 |
+
1 0 0 1 6 183 cm
|
2421 |
q
|
2422 |
0 0 0 rg
|
2423 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Fehlerprotokollierung aktivieren) Tj T* ET
|
2424 |
Q
|
2425 |
Q
|
2426 |
q
|
2427 |
+
1 0 0 1 162.6299 99 cm
|
2428 |
q
|
2429 |
BT 1 0 0 1 0 88.82 Tm 12 TL /F1 10 Tf 0 0 0 rg (Wenn dieser Wert auf "Ja" gesetzt ist, werden alle API-Aufrufe an) Tj T* (BillSAFE in eine separate ) Tj /F3 10 Tf (billsafe.log) Tj /F1 10 Tf (-Datei geschrieben. Die) Tj T* (Log-Eintr\344ge enthalten alle Parameter des Requests und die) Tj T* (entsprechenden BillSAFE-Antwort \(Response\). Die entsprechende) Tj T* (Datei findet sich im Normalfall im ) Tj /F3 10 Tf (/var/log) Tj /F1 10 Tf (-Verzeichnis der) Tj T* (Magento-Installation. Diese Einstellung sollte genau wie der) Tj T* (Testmodus nur zu Test- und Debug-Zwecken, sowie w\344hrend der) Tj T* (Entwicklung, aktiviert werden.) Tj T* ET
|
2430 |
Q
|
2431 |
Q
|
2432 |
q
|
2433 |
+
1 0 0 1 6 81 cm
|
2434 |
q
|
2435 |
0 0 0 rg
|
2436 |
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Reihenfolge) Tj T* ET
|
2437 |
Q
|
2438 |
Q
|
2439 |
q
|
2440 |
+
1 0 0 1 162.6299 57 cm
|
2441 |
q
|
2442 |
0 0 0 rg
|
2443 |
BT 1 0 0 1 0 28.82 Tm /F1 10 Tf 12 TL (Die Stelle in der Liste m\366glicher Zahlungsmethoden im Checkout) Tj T* (auf dem diese Zahlart auf der Auswahlseite erscheint. Je kleiner die) Tj T* (Zahl, desto weiter oben erscheint diese.) Tj T* ET
|
2444 |
Q
|
2445 |
Q
|
2446 |
q
|
2447 |
+
1 0 0 1 6 39 cm
|
2448 |
+
q
|
2449 |
+
0 0 0 rg
|
2450 |
+
BT 1 0 0 1 0 4.82 Tm /F1 10 Tf 12 TL (Geschlecht) Tj T* ET
|
2451 |
+
Q
|
2452 |
+
Q
|
2453 |
+
q
|
2454 |
+
1 0 0 1 162.6299 3 cm
|
2455 |
+
q
|
2456 |
+
0 0 0 rg
|
2457 |
+
BT 1 0 0 1 0 40.82 Tm /F1 10 Tf 12 TL (Es ist erforderlich, das Geschlecht des Kunden an BillSAFE zu) Tj T* (\374bertragen. Ist diese Information weder an der Bestellung noch an) Tj T* (der Kundenadresse oder im Kundenaccount verf\374gbar, wird der hier) Tj T* (konfigurierte Standardwert f\374r die \334bertragung herangezogen.) Tj T* ET
|
2458 |
+
Q
|
2459 |
+
Q
|
2460 |
+
q
|
2461 |
1 J
|
2462 |
1 j
|
2463 |
0 0 0 RG
|
2464 |
.25 w
|
2465 |
+
n 0 522 m 469.8898 522 l S
|
2466 |
n 0 468 m 469.8898 468 l S
|
2467 |
n 0 414 m 469.8898 414 l S
|
2468 |
n 0 360 m 469.8898 360 l S
|
2469 |
+
n 0 282 m 469.8898 282 l S
|
2470 |
+
n 0 240 m 469.8898 240 l S
|
2471 |
+
n 0 198 m 469.8898 198 l S
|
2472 |
+
n 0 96 m 469.8898 96 l S
|
2473 |
+
n 0 54 m 469.8898 54 l S
|
2474 |
+
n 156.6299 0 m 156.6299 522 l S
|
2475 |
+
n 0 0 m 0 522 l S
|
2476 |
+
n 469.8898 0 m 469.8898 522 l S
|
2477 |
n 0 0 m 469.8898 0 l S
|
2478 |
Q
|
2479 |
Q
|
2480 |
q
|
2481 |
+
1 0 0 1 62.69291 186.3307 cm
|
2482 |
Q
|
2483 |
q
|
2484 |
+
1 0 0 1 62.69291 156.3307 cm
|
2485 |
q
|
2486 |
0 0 0 rg
|
2487 |
BT 1 0 0 1 0 16.82 Tm /F1 10 Tf 12 TL .945814 Tw (Bei der Verwendung von Market Ready Germany sind die folgenden Einstellungen vorzunehmen, damit) Tj T* 0 Tw (die BillSAFE Rechnungsinformationen auf dem Ausdruck erscheinen:) Tj T* ET
|
2488 |
Q
|
2489 |
Q
|
2490 |
q
|
2491 |
+
1 0 0 1 62.69291 150.3307 cm
|
2492 |
Q
|
2493 |
q
|
2494 |
+
1 0 0 1 62.69291 114.3307 cm
|
2495 |
0 0 0 rg
|
2496 |
BT /F1 10 Tf 12 TL ET
|
2497 |
BT 1 0 0 1 0 2 Tm T* ET
|
2551 |
Q
|
2552 |
Q
|
2553 |
q
|
2554 |
+
1 0 0 1 62.69291 114.3307 cm
|
2555 |
Q
|
2556 |
q
|
2557 |
+
1 0 0 1 62.69291 114.3307 cm
|
2558 |
Q
|
2559 |
q
|
2560 |
1 0 0 1 426.3422 728.5039 cm
|
3638 |
0000623262 00000 n
|
3639 |
0000624718 00000 n
|
3640 |
0000632549 00000 n
|
3641 |
+
0000639908 00000 n
|
3642 |
+
0000643621 00000 n
|
3643 |
+
0000646464 00000 n
|
3644 |
+
0000648856 00000 n
|
3645 |
+
0000650178 00000 n
|
3646 |
+
0000654973 00000 n
|
3647 |
+
0000657978 00000 n
|
3648 |
+
0000662247 00000 n
|
3649 |
+
0000663312 00000 n
|
3650 |
+
0000663594 00000 n
|
3651 |
+
0000663673 00000 n
|
3652 |
+
0000663752 00000 n
|
3653 |
+
0000663831 00000 n
|
3654 |
+
0000663910 00000 n
|
3655 |
+
0000663989 00000 n
|
3656 |
+
0000664068 00000 n
|
3657 |
+
0000664147 00000 n
|
3658 |
+
0000664226 00000 n
|
3659 |
+
0000664305 00000 n
|
3660 |
+
0000664385 00000 n
|
3661 |
+
0000664465 00000 n
|
3662 |
+
0000664545 00000 n
|
3663 |
+
0000664625 00000 n
|
3664 |
trailer
|
3665 |
<< /ID
|
3666 |
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
|
3667 |
+
[(\003!\011u\311k\030\212\272\314\212C|\014\2265) (\003!\011u\311k\030\212\272\314\212C|\014\2265)]
|
3668 |
|
3669 |
/Info 77 0 R
|
3670 |
/Root 76 0 R
|
3671 |
/Size 121 >>
|
3672 |
startxref
|
3673 |
+
664674
|
3674 |
%%EOF
|
package.xml
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package><name>BillSAFE_3</name><version>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>BillSAFE_3</name><version>14.03.27</version><stability>stable</stability><license>OSL3</license><channel>community</channel><extends></extends><summary>Billsafe Extension</summary><description>Billsafe Extension</description><notes>Stable Release</notes><authors><author><name>Kristian Büsch</name><user>kbuesch</user><email>kbuesch@paypal.com</email></author></authors><date>2014-03-27</date><time>6:34:13</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="doc"><dir name="Netresearch_Billsafe"><file name="ChangeLog.pdf" hash="b502a63b3a29004ea6bbb9909994729b"/><file name="README.pdf" hash="f3ddee3c586bf3ad4e11148e2468511d"/></dir></dir><dir name="skin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="billsafe.css" hash="30652ade50b6207cfd38fa0d86230ba0"/></dir></dir></dir></dir></dir><dir name="app"><dir name="locale"><dir name="de_DE"><file name="Netresearch_Billsafe.csv" hash="1784e93b821ea46bd32bc92c2f449bae"/><file name="Netresearch_PaymentFee.csv" hash="ee08fa2cb6ed0a660db7df18696f5e17"/></dir><dir name="en_US"><file name="Netresearch_PaymentFee.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="billsafe"><file name="info.phtml" hash="229d7e88ed38ba2a413c9323e12c1aa0"/><dir name="customer"><dir name="widget"><file name="dob.phtml" hash="c394734c5a350a2e47c143f2398935cb"/></dir></dir><dir name="payment"><file name="form.phtml" hash="ca6ec537cfc8c0434341757c9ec286d5"/></dir></dir></dir><dir name="layout"><file name="billsafe.xml" hash="7ba46fd84f8faa378ab61e32dfa9ceac"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="billsafe"><file name="info.phtml" hash="8183491543dcffc7f66af9fb06740e80"/><dir name="pdf"><file name="info.phtml" hash="125e58bd1eb021106ad45c0e9b960f01"/><file name="mrg.phtml" hash="68c1f430c50cdb9d413369a7defa6a03"/></dir><dir name="system"><dir name="config"><file name="paymentfeecheck.phtml" hash="cd5cfb1357c3885965dcfaf9b3da4eaa"/></dir></dir></dir></dir><dir name="layout"><file name="billsafe.xml" hash="53acc9efc6bd47aefacee3162e7b9995"/></dir></dir></dir></dir></dir><dir name="code"><dir name="community"><dir name="Netresearch"><dir name="PaymentFee"><dir name="Test"><dir name="Model"><file name="ObserverTest.php" hash="32ba1f9b3fb8e8a9372da43f8fc9368e"/></dir><dir name="Config"><file name="ConfigTest.php" hash="cf41bf5d7cb77e4d9a4de4dbb5186512"/></dir></dir><dir name="Helper"><file name="Data.php" hash="41ca5369190288ea1eb14e2a591b6d97"/></dir><dir name="Model"><file name="Observer.php" hash="2e4d2b0faaf6af72e209c7fb40b81b51"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Payment"><file name="Methods.php" hash="5e49ffdd605a2b9dcc21c351c3afb075"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="FeeController.php" hash="5763a58bfd3f11b3ae41d5949724f0e8"/></dir></dir><dir name="etc"><file name="config.xml" hash="6beccc3c342a85000f0f454fc43b8503"/><file name="system.xml" hash="32ac7aabae936ec08aefb6b112f88b26"/></dir></dir><dir name="Billsafe"><dir name="sql"><dir name="billsafe_setup"><file name="mysql4-install-0.1.0.php" hash="9906e49a293cc8511f2ce53be301b3d3"/><file name="mysql4-upgrade-11.09.14-11.11.07.php" hash="f74406fe3e100c69a020bca556ad1ce3"/></dir></dir><dir name="Test"><dir name="Controller"><file name="PaymentControllerTest.php" hash="1825fe25aa4b82523aadd10a53074747"/></dir><dir name="Helper"><file name="CustomerTest.php" hash="d06fbac6ee3a1c19133367ebee38818a"/><file name="DataTest.php" hash="8e5d93c8a4dd94b65cac266944aee474"/><file name="OrderTest.php" hash="4a4c95b8dd473647275be83b90959e75"/><dir name="OrderTest"><dir name="fixtures"><file name="orders.yaml" hash="14e05b7bda0018f195e61f8bb596f160"/></dir></dir></dir><dir name="Model"><file name="ClientTest.php" hash="8d9eb45c6bf9e6da59e698e82ba96d69"/><file name="ConfigTest.php" hash="e5e74426f5a04ed24b2acc81a10a93f7"/><file name="ObserverTest.php" hash="2d2dcdd46f2b4f5c4d9bef41271a23e1"/><file name="PaymentTest.php" hash="e53abb917874dc1f719bd6e4c1a2422a"/></dir><dir name="Block"><file name="InfoTest.php" hash="7d1973a3d3e71f2d543484c8e873f3d8"/><dir name="Payment"><file name="FormTest.php" hash="53a4a81423abd719cd1c41203a582f8f"/></dir><dir name="Customer"><dir name="Widget"><file name="DobTest.php" hash="279ab2bebbef665ebb1a44c8ef93327a"/></dir></dir></dir><dir name="var"><dir name="fixtures"><file name="orders.yaml" hash="fa584305dffb6954f37ea98d398175cc"/></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="82a236b4d0c8c7335cb49e8b26794eea"/><file name="Data.php" hash="b215a1f328ba65dc801a7b3cb9effe9c"/><file name="Order.php" hash="65a34cd5871a732344410233df189807"/></dir><dir name="Model"><file name="Client.php" hash="ba10a42551a612663fbdf97426e276c5"/><file name="Config.php" hash="6bd396ea4d4d339d2419e8fdfa1bec33"/><file name="Observer.php" hash="8ef95cb35694c3552bb38e3c44538c53"/><file name="Payment.php" hash="96225dca07957f3aedc060fa8e505794"/><dir name="Pdf"><dir name="Engine"><dir name="Invoice"><file name="Default.php" hash="463521a517d8cc7ef027d7373c2375cd"/></dir></dir><dir name="Items"><dir name="Invoice"><file name="Info.php" hash="b8d7c058b38ebfd786b570dcd626347c"/></dir></dir></dir><dir name="Client"><file name="Base.php" hash="16fbeffcc20585f6e43fda3b0c083d57"/></dir><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Gender.php" hash="df8f8d18e152cce92297c797262b3671"/></dir></dir></dir></dir><dir name="Config"><file name="Abstract.php" hash="ba80caef00c09f165720fa9f9036024a"/><file name="Maxamount.php" hash="698d7e25b131a3b9dbdee12c4b88e620"/><file name="Maxfee.php" hash="0bdefd9ca9a666719760279b55c86c2d"/></dir></dir><dir name="controllers"><file name="PaymentController.php" hash="299ecad019a40491d7835a7247b72108"/></dir><dir name="Block"><file name="Info.php" hash="fcdafba1b69989b09535c9ae414ba180"/><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Totalbar.php" hash="db5c1edc70c1fe25e3852785c4c3f0b8"/></dir></dir><dir name="System"><dir name="Config"><file name="Paymentfeecheck.php" hash="fdace6ddea9c5c2fac8b264df834012e"/></dir></dir></dir><dir name="Payment"><file name="Form.php" hash="c69c723d686a2f2d6b8f90dbb212f3d1"/></dir><dir name="Customer"><dir name="Widget"><file name="Dob.php" hash="26a34b88060d80e5b1f1e6412b1eb7d4"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="1030f0162d916f21a7ff22f44c5b8fd0"/><file name="system.xml" hash="2f37ec7440fde44699363ae80975a159"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Netresearch_Billsafe.xml" hash="8d4f15dddfcc1034a78b4e9782db7770"/><file name="Netresearch_PaymentFee.xml" hash="66173a1777313e72fbee83b510f9d59d"/></dir></dir></dir></target></contents></package>
|