Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
plugins
/
woocommerce-paypal-payments
/
modules
/
ppcp-api-client
/
src
/
Factory
:
FraudProcessorResponseFactory.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php /** * The FraudProcessorResponseFactory Factory. * * @package WooCommerce\PayPalCommerce\ApiClient\Factory */ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\ApiClient\Factory; use stdClass; use WooCommerce\PayPalCommerce\ApiClient\Entity\FraudProcessorResponse; /** * Class FraudProcessorResponseFactory */ class FraudProcessorResponseFactory { /** * Returns a FraudProcessorResponse object based off a PayPal Response. * * @param stdClass $data The JSON object. * * @return FraudProcessorResponse */ public function from_paypal_response( stdClass $data ): FraudProcessorResponse { $avs_code = ( $data->avs_code ?? null ) ?: null; $cvv_code = ( $data->cvv_code ?? null ) ?: null; return new FraudProcessorResponse( $avs_code, $cvv_code ); } }