Merge pull request #19754 from woocommerce/add/obw-eway-payment-gateway

OBW: Show eWAY payment gateway to merchants in AUS/NZ.
This commit is contained in:
Claudiu Lodromanean 2018-04-17 16:33:41 -07:00 committed by GitHub
commit 59d967c859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 0 deletions

View File

@ -634,6 +634,10 @@ body {
}
}
&.eway-logo .wc-wizard-service-name img {
max-width: 87px;
}
.wc-wizard-service-description {
flex-grow: 1;
padding: 20px;

BIN
assets/images/eway-logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1132,6 +1132,19 @@ class WC_Admin_Setup_Wizard {
return in_array( $country_code, $square_supported_countries, true );
}
/**
* Is eWAY Payments country supported
*
* @param string $country_code Country code.
*/
protected function is_eway_payments_supported_country( $country_code ) {
$supported_countries = array(
'AU', // Australia.
'NZ', // New Zealand.
);
return in_array( $country_code, $supported_countries, true );
}
/**
* Helper method to retrieve the current user's email address.
*
@ -1266,6 +1279,14 @@ class WC_Admin_Setup_Wizard {
'enabled' => true,
'repo-slug' => 'woocommerce-square',
),
'eway' => array(
'name' => __( 'eWAY', 'woocommerce' ),
'description' => __( 'The eWAY extension for WooCommerce allows you to take credit card payments directly on your store without redirecting your customers to a third party site to make payment.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/eway-logo.jpg',
'enabled' => false,
'class' => 'eway-logo',
'repo-slug' => 'woocommerce-gateway-eway',
),
);
}
@ -1283,6 +1304,7 @@ class WC_Admin_Setup_Wizard {
$country = WC()->countries->get_base_country();
$can_stripe = $this->is_stripe_supported_country( $country );
$can_eway = $this->is_eway_payments_supported_country( $country );
if ( $this->is_klarna_checkout_supported_country( $country ) ) {
$spotlight = 'klarna_checkout';
@ -1297,19 +1319,32 @@ class WC_Admin_Setup_Wizard {
$spotlight => $gateways[ $spotlight ],
'ppec_paypal' => $gateways['ppec_paypal'],
);
if ( $can_stripe ) {
$offered_gateways += array( 'stripe' => $gateways['stripe'] );
}
if ( $can_eway ) {
$offered_gateways += array( 'eway' => $gateways['eway'] );
}
return $offered_gateways;
}
$offered_gateways = array();
if ( $can_stripe ) {
$gateways['stripe']['enabled'] = true;
$gateways['stripe']['featured'] = true;
$offered_gateways += array( 'stripe' => $gateways['stripe'] );
}
$offered_gateways += array( 'ppec_paypal' => $gateways['ppec_paypal'] );
if ( $can_eway ) {
$offered_gateways += array( 'eway' => $gateways['eway'] );
}
return $offered_gateways;
}