Merge pull request #1427 from woocommerce/feat/PCP-1709_soft_descriptor

Include soft descriptor for card's activity
This commit is contained in:
Emili Castells 2023-07-18 15:40:04 +02:00 committed by GitHub
commit 75f73ea090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 5 deletions

View file

@ -971,6 +971,15 @@ return array(
return 'https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s';
},
'wcgateway.soft-descriptor' => static function ( ContainerInterface $container ): string {
$settings = $container->get( 'wcgateway.settings' );
assert( $settings instanceof Settings );
if ( $settings->has( 'soft_descriptor' ) ) {
return $settings->get( 'soft_descriptor' );
}
return '';
},
'wcgateway.transaction-url-provider' => static function ( ContainerInterface $container ): TransactionUrlProvider {
$sandbox_url_base = $container->get( 'wcgateway.transaction-url-sandbox' );
$live_url_base = $container->get( 'wcgateway.transaction-url-live' );

View file

@ -423,6 +423,20 @@ return function ( ContainerInterface $container, array $fields ): array {
'</a>'
),
),
'soft_descriptor' => array(
'title' => __( 'Soft Descriptor', 'woocommerce-paypal-payments' ),
'type' => 'text',
'desc_tip' => true,
'description' => __( 'The soft descriptor is the dynamic text used to construct the statement descriptor that appears on a payer\'s card statement. Text field, max value of 22 characters.', 'woocommerce-paypal-payments' ),
'maxlength' => 22,
'default' => '',
'screens' => array(
State::STATE_START,
State::STATE_ONBOARDED,
),
'requirements' => array(),
'gateway' => Settings::CONNECTION_TAB_ID,
),
'prefix' => array(
'title' => __( 'Invoice prefix', 'woocommerce-paypal-payments' ),
'type' => 'text',