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:
commit
59d967c859
|
@ -634,6 +634,10 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
&.eway-logo .wc-wizard-service-name img {
|
||||
max-width: 87px;
|
||||
}
|
||||
|
||||
.wc-wizard-service-description {
|
||||
flex-grow: 1;
|
||||
padding: 20px;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue