Skip to content

Commit 3db9a51

Browse files
committed
Merge branch 'fixes/no-manual-form-fields'
2 parents 0380629 + e27d640 commit 3db9a51

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

code/GatewayFieldsFactory.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ public function getCardFields() {
7676
->setMaxLength(5),
7777
"issueNumber" => TextField::create('issueNumber', _t("PaymentForm.ISSUENUMBER", "Issue Number"))
7878
);
79-
//assumption: no credit card fields are ever required for off-site gateways by default
80-
$defaults = GatewayInfo::is_offsite($this->gateway) ?
81-
array() :
82-
array('name', 'number', 'expiryMonth', 'expiryYear', 'cvv');
83-
$this->cullForGateway($fields, $defaults);
79+
80+
$this->cullForGateway($fields);
8481
//optionally group date fields
8582
if ($this->groupdatefields) {
8683
if (isset($fields['startMonth']) && isset($fields['startYear'])) {

code/model/GatewayInfo.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public static function is_offsite($gateway) {
7272

7373
/**
7474
* Check for special 'manual' payment type.
75-
* @param string $gateway [description]
76-
* @return boolean [description]
75+
* @param string $gateway
76+
* @return boolean
7777
*/
7878
public static function is_manual($gateway) {
7979
return $gateway === 'Manual';
@@ -91,8 +91,8 @@ public static function required_fields($gateway) {
9191
is_array($parameters[$gateway]['required_fields'])){
9292
$fields = $parameters[$gateway]['required_fields'];
9393
}
94-
//always require the following offsite fields
95-
if (!self::is_offsite($gateway)) {
94+
//always require the following for on-site gateways (and not manual)
95+
if (!self::is_offsite($gateway) && !self::is_manual($gateway)) {
9696
$fields = array_merge(
9797
$fields,
9898
array('name','number','expiryMonth','expiryYear','cvv')

0 commit comments

Comments
 (0)