Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: payment transaction processor images to payment recommendations #37230

Merged
merged 1 commit into from Mar 17, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -31,6 +31,7 @@ export const Item = ( { isRecommended, markConfigured, paymentGateway } ) => {
settingsUrl: manageUrl,
is_local_partner: isLocalPartner,
external_link: externalLink,
transaction_processors: transactionProcessors,
} = paymentGateway;

const connectSlot = useSlot(
Expand Down Expand Up @@ -88,6 +89,21 @@ export const Item = ( { isRecommended, markConfigured, paymentGateway } ) => {
<div className="woocommerce-task-payment__content">
{ content }
</div>
{ transactionProcessors && (
<div className="woocommerce-task-payment__transaction-processors_images">
{ Object.keys( transactionProcessors ).map(
( key ) => {
return (
<img
src={ transactionProcessors[ key ] }
alt={ key }
key={ key }
/>
);
}
) }
</div>
) }
</div>
<div className="woocommerce-task-payment__footer">
<Action
Expand Down
Expand Up @@ -67,6 +67,18 @@
font-size: 12px;
}
}
.woocommerce-task-payment__transaction-processors_images {
padding-top: 16px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 8px;

img {
height: 24px;
}
}

.woocommerce-task-payment__description {
flex: 1;
}
Expand Down
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Added images support for the payment recommendations transaction processors
10 changes: 10 additions & 0 deletions plugins/woocommerce/src/Admin/API/PaymentGatewaySuggestions.php
Expand Up @@ -168,6 +168,16 @@ public function get_item_schema() {
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
'transaction_processors' => array(
'description' => __( 'Array of transaction processors and their images.', 'woocommerce' ),
'type' => 'object',
'addtionalProperties' => array(
'type' => 'string',
'format' => 'uri',
),
'context' => array( 'view', 'edit' ),
'readonly' => true,
),
),
);

Expand Down