XenoRyet has uploaded a new change for review.
https://gerrit.wikimedia.org/r/286949
Change subject: Adyen form for Israel
......................................................................
Adyen form for Israel
Enable Adyen form in Israel and use Hebrew language.
Bug: T128812
Change-Id: Ia9fe1fb229f243ba234a611dc4e598f976dfb89d
---
M DonationInterfaceFormSettings.php
M adyen_gateway/adyen.adapter.php
2 files changed, 23 insertions(+), 10 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/49/286949/1
diff --git a/DonationInterfaceFormSettings.php
b/DonationInterfaceFormSettings.php
index 832aa47..df130a5 100644
--- a/DonationInterfaceFormSettings.php
+++ b/DonationInterfaceFormSettings.php
@@ -600,8 +600,8 @@
$forms_whitelist['adyen'] = array(
'file' => __DIR__ . '/gateway_forms/mustache/index.html.mustache',
'gateway' => 'adyen',
- 'countries' => array( '+' => 'US',),
- 'currencies' => array( '+' => 'USD',),
+ 'countries' => array( '+' => 'US', 'IL' ),
+ 'currencies' => array( '+' => 'USD', 'ILS' ),
'payment_methods' => array('cc' => array( 'visa', 'mc', 'amex',
'discover' )),
'selection_weight' => 0
);
diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php
index 7ac18ec..c99bd7e 100644
--- a/adyen_gateway/adyen.adapter.php
+++ b/adyen_gateway/adyen.adapter.php
@@ -32,7 +32,11 @@
public function getRequiredFields() {
$fields = parent::getRequiredFields();
- $fields[] = 'address';
+ $addressRequired = array( 'US' );
+ $country = $this->getData_Unstaged_Escaped( 'country' );
+ if ( in_array( $country, $addressRequired ) ) {
+ $fields[] = 'address';
+ }
$fields[] = 'payment_submethod';
return $fields;
}
@@ -87,18 +91,12 @@
* Define transactions
*/
function defineTransactions() {
-
+
$this->transactions = array( );
$this->transactions[ 'donate' ] = array(
'request' => array(
'allowedMethods',
- 'billingAddress.street',
- 'billingAddress.city',
- 'billingAddress.postalCode',
- 'billingAddress.stateOrProvince',
- 'billingAddress.country',
- 'billingAddressType',
'card.cardHolderName',
'currencyCode',
'merchantAccount',
@@ -130,6 +128,21 @@
),
'iframe' => TRUE,
);
+
+ // Add address fields for countries that use them.
+ $addressRequired = array( 'US' );
+ $addressFields = array (
+ 'billingAddress.street',
+ 'billingAddress.city',
+ 'billingAddress.postalCode',
+ 'billingAddress.stateOrProvince',
+ 'billingAddress.country',
+ 'billingAddressType',
+ );
+ $country = $this->getData_Unstaged_Escaped( 'country' );
+ if ( in_array( $country, $addressRequired ) ) {
+ $this->transactions[ 'donate' ] = array_merge(
$this->transactions[ 'donate' ], $addressFields );
+ }
}
protected function getAllowedPaymentMethods() {
--
To view, visit https://gerrit.wikimedia.org/r/286949
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9fe1fb229f243ba234a611dc4e598f976dfb89d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: XenoRyet <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits