-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from paymill/shopware_five
Shopware five port
- Loading branch information
Showing
75 changed files
with
1,950 additions
and
1,845 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
#Release Notes | ||
|
||
##1.5.2 | ||
- added controller and action check to onCheckoutConfirm event handler #2 | ||
|
||
##1.5.1 | ||
- removed transactionId in checkout | ||
|
||
##1.5.0 | ||
- added webhooks for refunds | ||
|
||
##1.4.7 | ||
- fixed refund | ||
|
||
##1.4.6 | ||
- fixed sepa/elv for shopware 4.1.4 | ||
|
||
##1.4.5 | ||
- improved SQL Statements for CSV-Reader | ||
|
||
##1.4.4 | ||
- Blocked multiple clicks on the "Pay" Button. | ||
- Set Customer/Preauthorization/Transaction max. Description length to 128 chars | ||
- Fixed a Bug with wrong Prenotification Date, when "Days to Debit" is set to 0 | ||
- improved SQL Statements | ||
|
||
##1.4.3 | ||
- Hotfix: fixed overwriting of email templates | ||
|
||
##1.4.2 | ||
- fixed Update bug from version 1.3.0 or higher to 1.4.1 | ||
|
||
##1.4.1 | ||
- added improved update-method | ||
|
||
##1.4.0 | ||
- united SEPA and regular ELV forms | ||
- added backend option to show credit card logos in frontend | ||
- added prenotification in order mail for direct debit | ||
|
||
##1.3.1 | ||
- Fixed Translation Bug for mainshop | ||
|
||
##1.3.0 | ||
- Added Support for Conexco Responsive Template | ||
- Added improved iban validation | ||
- Added support for various languages | ||
- Added improved early pan detection | ||
|
||
##1.2.0 | ||
- Added additional validation to the fast checkout process | ||
- Implemented optional SEPA direct debit form. Only payments from germany are supported | ||
|
||
##1.1.4 | ||
- Fixed a bug keeping unregistered users from changing the Supplier country in the shopping cart | ||
- Fixed a bug causing crashes on language changes in the shopping cart | ||
|
||
##1.1.3 | ||
- Fixed a bug causing the first Payment attempt for new customers to crash under some circumstances | ||
|
||
##1.1.2 | ||
- Fixed a bug causing crashes during checkout | ||
|
||
##1.1.1 | ||
- Updated Lib | ||
- Updated README.md files | ||
- Added CHANGELOG.md | ||
- Implemented improved error feedback | ||
- Added Snippets to support the improved feedback | ||
- Fixed a bug causing the cvc tooltip to be english in all languages | ||
- Removed logging for successful installations and updates | ||
|
||
##1.1.0 | ||
- Lib has been updated | ||
- Checkout Form is now always being displayed, showing masked customer information if there is fast checkout data. This allows customers to change their credit card or bank details after the data has been saved. | ||
- Improved the CVC tool-tip in the checkout form | ||
- Customers will now get identified on their first usage of a PAYMILL payment mean and will now always use the same id, even if fast checkout is not enabled. | ||
- Added pre authorization as a plug-in option: If active, credit card transactions will be authorized during checkout and can be captured from a new tab in the order detail view | ||
- Added refund option from the detail tab. Any transaction booked after the update can be completely refunded at will | ||
- Implemented special handling for Maestro cards during the checkout: cards without CVC are now supported | ||
- Improved the translation routine to prepare the support for different languages in the frontend. | ||
- Added status updates for PAYMILL transactions. | ||
- Improved the log to allow search | ||
- Fixed a bug causing the debug option not to work | ||
- Added translations for the payment names. | ||
- Improved update routine: from this version onwards the Shopware update function will be completely functional with this module | ||
- Improved code readability | ||
|
||
##1.0.6 | ||
- Added dynamic cc-brands | ||
- Added supplier, updated link and support in the plugin description | ||
|
||
##1.0.5 | ||
- Added translation of payment names as a paragraph to the readme file | ||
- Added Translation of payment method displaynames section to the readme file | ||
|
||
##1.0.4 | ||
- Fixed a bug causing crashes if no shop with english language is available | ||
- Adjusted description for shopware community store | ||
- Added trim for used keys | ||
- Checking GTC before creating a token. | ||
- Update readme file with supported versions | ||
- Added source parameter | ||
- Improved translation handling | ||
|
||
##1.0.3 | ||
- Added snippets and translations | ||
|
||
##1.0.2 | ||
- Rewrote Plugin from scratch | ||
|
||
##1.0.1 | ||
- Updated Lib to v2 | ||
- Added ELV as a payment mean | ||
|
||
##1.0.0 | ||
- Initial release |
110 changes: 110 additions & 0 deletions
110
Frontend/PaymPaymentCreditcard/Components/Checkout/Form/PrefillData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?php | ||
require_once dirname(__FILE__) . '/../../../lib/Services/Paymill/Payments.php'; | ||
|
||
class Shopware_Plugins_Frontend_PaymPaymentCreditcard_Components_Checkout_Form_PrefillData | ||
{ | ||
/** | ||
* @var Shopware_Plugins_Frontend_PaymPaymentCreditcard_Components_ModelHelper | ||
*/ | ||
private $modelHelper; | ||
|
||
/** | ||
* @var Services_Paymill_Payments | ||
*/ | ||
private $servicePayments; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $apiUrl = "https://api.paymill.com/v2/"; | ||
|
||
/** | ||
* Creates an instance for this class | ||
*/ | ||
public function __construct() | ||
{ | ||
$swConfig = Shopware()->Plugins()->Frontend()->PaymPaymentCreditcard()->Config(); | ||
$this->modelHelper = new Shopware_Plugins_Frontend_PaymPaymentCreditcard_Components_ModelHelper(); | ||
$this->privateKey = trim($swConfig->get("privateKey")); | ||
$this->servicePayments = new Services_Paymill_Payments(trim($swConfig->get("privateKey")), $this->apiUrl); | ||
} | ||
|
||
public function isDataAvailable($paymentName, $userId){ | ||
return $this->modelHelper->getPaymillPaymentId($paymentName, $userId); | ||
} | ||
|
||
/** | ||
* Returns the prefill data for creditcard and directdebit | ||
* | ||
* @param array $userData | ||
* @return array | ||
*/ | ||
public function prefill($userData){ | ||
$userId = 0; | ||
$userFullName = ''; | ||
if(array_key_exists('billingaddress', $userData)){ | ||
if(array_key_exists('userID', $userData['billingaddress'])){ | ||
$userId = $userData['billingaddress']['userID']; | ||
} | ||
if(array_key_exists('firstname', $userData['billingaddress']) && array_key_exists('lastname', $userData['billingaddress'])){ | ||
$userFullName = $userData['billingaddress']['firstname'] . " " . $userData['billingaddress']['lastname']; | ||
} | ||
} | ||
|
||
$creditcardData = $this->prefillCreditcard($userId, $userFullName); | ||
$directdebitData = $this->prefillDirectdebit($userId, $userFullName); | ||
return array_merge($creditcardData, $directdebitData); | ||
} | ||
|
||
/** | ||
* Returns the prefilldata for creditcard | ||
* | ||
* @param integer $userId | ||
* @param string $userFullName | ||
* @return array | ||
*/ | ||
private function prefillCreditcard($userId, $userFullName){ | ||
$prefillData = array( | ||
'paymillCardHolder' => $userFullName, | ||
'paymillCardNumber' => '', | ||
'paymillCvc' => '', | ||
'paymillMonth' => '', | ||
'paymillYear' => '' | ||
); | ||
|
||
$paymentId = $this->modelHelper->getPaymillPaymentId('cc', $userId); | ||
if ($paymentId != "") { | ||
$paymentObject = $this->servicePayments->getOne($paymentId); | ||
$prefillData['paymillCardNumber'] = "..." . $paymentObject['last4']; | ||
$prefillData['paymillCvc'] = "***"; | ||
$prefillData['paymillMonth'] = $paymentObject['expire_month']; | ||
$prefillData['paymillYear'] = $paymentObject['expire_year']; | ||
$prefillData['paymillCardHolder'] = $paymentObject['card_holder']; | ||
$prefillData['paymillBrand'] = $paymentObject['card_type']; | ||
} | ||
return $prefillData; | ||
} | ||
|
||
/** | ||
* Returns the prefilldata for directdebit | ||
* | ||
* @param integer $userId | ||
* @return array | ||
*/ | ||
private function prefillDirectdebit($userId, $userFullName){ | ||
$prefillData = array( | ||
'paymillAccountholder' => $userFullName, | ||
'paymillAccountNumber' => '', | ||
'paymillBankCode' => '' | ||
); | ||
|
||
$paymentId = $this->modelHelper->getPaymillPaymentId('elv', $userId); | ||
if ($paymentId != "") { | ||
$paymentObject = $this->servicePayments->getOne($paymentId); | ||
$prefillData['paymillAccountHolder'] = $paymentObject['holder'] != null ? $paymentObject['holder'] : $userFullName; | ||
$prefillData['paymillAccountNumber'] = $paymentObject['iban'] != null ? $paymentObject['iban'] : $paymentObject['account']; | ||
$prefillData['paymillBankCode'] = $paymentObject['bic'] != null ? $paymentObject['bic'] : $paymentObject['code']; | ||
} | ||
return $prefillData; | ||
} | ||
} |
102 changes: 0 additions & 102 deletions
102
Frontend/PaymPaymentCreditcard/Components/ConfigHelper.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.