Merge pull request #19758 from woocommerce/add/obw-payfast-payment-gateway

OBW: Show PayFast payment gateway to merchants in South Africa.
This commit is contained in:
Gerhard Potgieter 2018-04-18 11:07:17 +02:00 committed by GitHub
commit 0a369e2ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 3 deletions

View File

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

BIN
assets/images/payfast.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1287,6 +1287,15 @@ class WC_Admin_Setup_Wizard {
'class' => 'eway-logo',
'repo-slug' => 'woocommerce-gateway-eway',
),
'payfast' => array(
'name' => __( 'PayFast', 'woocommerce' ),
'description' => __( 'The PayFast extension for WooCommerce enables you to accept payments by Credit Card and EFT via one of South Africas most popular payment gateways. No setup fees or monthly subscription costs.', 'woocommerce' ),
'image' => WC()->plugin_url() . '/assets/images/payfast.png',
'class' => 'payfast-logo',
'enabled' => false,
'repo-slug' => 'woocommerce-gateway-payfast',
'file' => 'gateway-payfast.php',
),
);
}
@ -1302,9 +1311,10 @@ class WC_Admin_Setup_Wizard {
return array( 'paypal' => $gateways['paypal'] );
}
$country = WC()->countries->get_base_country();
$can_stripe = $this->is_stripe_supported_country( $country );
$can_eway = $this->is_eway_payments_supported_country( $country );
$country = WC()->countries->get_base_country();
$can_stripe = $this->is_stripe_supported_country( $country );
$can_eway = $this->is_eway_payments_supported_country( $country );
$can_payfast = ( 'ZA' === $country ); // South Africa.
if ( $this->is_klarna_checkout_supported_country( $country ) ) {
$spotlight = 'klarna_checkout';
@ -1328,6 +1338,10 @@ class WC_Admin_Setup_Wizard {
$offered_gateways += array( 'eway' => $gateways['eway'] );
}
if ( $can_payfast ) {
$offered_gateways += array( 'payfast' => $gateways['payfast'] );
}
return $offered_gateways;
}
@ -1345,6 +1359,10 @@ class WC_Admin_Setup_Wizard {
$offered_gateways += array( 'eway' => $gateways['eway'] );
}
if ( $can_payfast ) {
$offered_gateways += array( 'payfast' => $gateways['payfast'] );
}
return $offered_gateways;
}