Merge branch 'trunk' into PCP-591-save-and-display-vaulted-payment-methods-in-woo-commerce-native-endpoint

This commit is contained in:
emilicastells 2023-01-24 09:48:29 +01:00
commit d558f0db5c
No known key found for this signature in database
GPG key ID: 1520C07081754570
6 changed files with 24 additions and 0 deletions

View file

@ -9,6 +9,8 @@
* Enhancement - Add FraudNet to all payments #1040
* Enhancement - Update "Standard Payments" tab settings #1065
* Enhancement - Update PHP 7.2 requirement in all relevant files #1084
* Enhancement - When PUI is enabled FraudNet should be also enabled #1129
* Enhancement - Add PayPal-Request-Id if payment source exist #1132
= 2.0.1 - 2022-12-13 =
* Fix - Error while syncing tracking data to PayPal -> Sync GZD Tracking #1020

View file

@ -236,6 +236,10 @@ class OrderEndpoint {
$args['headers']['PayPal-Client-Metadata-Id'] = $this->fraudnet->session_id();
}
if ( isset( $data['payment_source'] ) ) {
$args['headers']['PayPal-Request-Id'] = uniqid( 'ppcp-', true );
}
$response = $this->request( $url, $args );
if ( is_wp_error( $response ) ) {
$error = new RuntimeException(

View file

@ -1147,6 +1147,16 @@ return array(
return false;
},
'wcgateway.settings.should-disable-fraudnet-checkbox' => static function( ContainerInterface $container ): bool {
$pui_helper = $container->get( 'wcgateway.pay-upon-invoice-helper' );
assert( $pui_helper instanceof PayUponInvoiceHelper );
if ( $pui_helper->is_pui_gateway_enabled() ) {
return true;
}
return false;
},
'wcgateway.settings.tracking-label' => static function ( ContainerInterface $container ): string {
$tracking_label = sprintf(
// translators: %1$s and %2$s are the opening and closing of HTML <a> tag.

View file

@ -139,6 +139,11 @@ class PayUponInvoice {
* @throws NotFoundException When setting is not found.
*/
public function init(): void {
if ( $this->pui_helper->is_pui_gateway_enabled() ) {
$this->settings->set( 'fraudnet_enabled', true );
$this->settings->persist();
}
add_filter(
'ppcp_partner_referrals_data',
function ( array $data ): array {

View file

@ -411,6 +411,7 @@ return function ( ContainerInterface $container, array $fields ): array {
),
'requirements' => array(),
'gateway' => Settings::CONNECTION_TAB_ID,
'input_class' => $container->get( 'wcgateway.settings.should-disable-fraudnet-checkbox' ) ? array( 'ppcp-disabled-checkbox' ) : array(),
),
'credentials_integration_configuration_heading' => array(

View file

@ -90,6 +90,8 @@ Follow the steps below to connect the plugin to your PayPal account:
* Enhancement - Add FraudNet to all payments #1040
* Enhancement - Update "Standard Payments" tab settings #1065
* Enhancement - Update PHP 7.2 requirement in all relevant files #1084
* Enhancement - When PUI is enabled FraudNet should be also enabled #1129
* Enhancement - Add PayPal-Request-Id if payment source exist #1132
= 2.0.1 =
* Fix - Error while syncing tracking data to PayPal -> Sync GZD Tracking #1020