add: payment transaction processor images to payment recommendations (#37230)

This commit is contained in:
RJ 2023-03-17 13:49:50 +08:00 committed by GitHub
parent 04f34e9636
commit 23b79428f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 0 deletions

View File

@ -31,6 +31,7 @@ export const Item = ( { isRecommended, markConfigured, paymentGateway } ) => {
settingsUrl: manageUrl, settingsUrl: manageUrl,
is_local_partner: isLocalPartner, is_local_partner: isLocalPartner,
external_link: externalLink, external_link: externalLink,
transaction_processors: transactionProcessors,
} = paymentGateway; } = paymentGateway;
const connectSlot = useSlot( const connectSlot = useSlot(
@ -88,6 +89,21 @@ export const Item = ( { isRecommended, markConfigured, paymentGateway } ) => {
<div className="woocommerce-task-payment__content"> <div className="woocommerce-task-payment__content">
{ content } { content }
</div> </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>
<div className="woocommerce-task-payment__footer"> <div className="woocommerce-task-payment__footer">
<Action <Action

View File

@ -67,6 +67,18 @@
font-size: 12px; 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 { .woocommerce-task-payment__description {
flex: 1; flex: 1;
} }

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Added images support for the payment recommendations transaction processors

View File

@ -168,6 +168,16 @@ class PaymentGatewaySuggestions extends \WC_REST_Data_Controller {
'context' => array( 'view', 'edit' ), 'context' => array( 'view', 'edit' ),
'readonly' => true, '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,
),
), ),
); );