Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Add Mercado Pago as default fallback payment gateway #7043

Merged
merged 5 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const PaymentConnect = ( {
const {
key,
oauth_connection_url: oAuthConnectionUrl,
setup_help_text: helpText,
setup_help_text: setupHelpText,
required_settings_keys: settingKeys,
settings,
settings_url: settingsUrl,
Expand Down Expand Up @@ -99,6 +99,9 @@ export const PaymentConnect = ( {
return errors;
};

const helpText = setupHelpText && (
<p dangerouslySetInnerHTML={ sanitizeHTML( setupHelpText ) } />
);
const DefaultForm = ( props ) => (
<DynamicForm
fields={ fields }
Expand Down Expand Up @@ -127,30 +130,29 @@ export const PaymentConnect = ( {
if ( oAuthConnectionUrl ) {
return (
<>
{ helpText }
<Button isPrimary href={ oAuthConnectionUrl }>
{ __( 'Connect', 'woocommerce-admin' ) }
</Button>
{ helpText && (
<p dangerouslySetInnerHTML={ sanitizeHTML( helpText ) } />
) }
</>
);
}

if ( fields.length ) {
return (
<>
{ helpText }
<DefaultForm />
{ helpText && (
<p dangerouslySetInnerHTML={ sanitizeHTML( helpText ) } />
) }
</>
);
}

return (
<Button isPrimary href={ settingsUrl }>
{ __( 'Manage', 'woocommerce-admin' ) }
</Button>
<>
{ helpText }
<Button isPrimary href={ settingsUrl }>
{ __( 'Manage', 'woocommerce-admin' ) }
</Button>
</>
);
};
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
- Add: Note date range logic for GivingFeedback, and InsightFirstSale note. #6969
- Add: Add transient notices feature #6809
- Add: Add transformers in remote inbox notifications #6948
- Add: Add Mercado Pago as default fallback payment gateway #7043
- Add: Get post install scripts from gateway and enqueue in client #6967
- Add: Free extension list powered by remote config #6952
- Add: Add PayPal to fallback payment gateways #7001
Expand Down
10 changes: 10 additions & 0 deletions src/Features/RemotePaymentMethods/DefaultPaymentGateways.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ public static function get_all() {
self::get_rules_for_cbd( false ),
),
),
array(
'key' => 'woo-mercado-pago-custom',
'title' => __( 'Mercado Pago Checkout Pro & Custom', 'woocommerce-admin' ),
'content' => __( 'Accept credit and debit cards, offline (cash or bank transfer) and logged-in payments with money in Mercado Pago. Safe and secure payments with the leading payment processor in LATAM.', 'woocommerce-admin' ),
'image' => plugins_url( 'images/onboarding/mercadopago.png', WC_ADMIN_PLUGIN_FILE ),
'plugins' => array( 'woocommerce-mercadopago' ),
'is_visible' => array(
self::get_rules_for_countries( array( 'AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY' ) ),
),
),
array(
'key' => 'ppcp-gateway',
'title' => __( 'PayPal Payments', 'woocommerce-admin' ),
Expand Down