PHP code example of nofraud / connect
1. Go to this page and download the library: Download nofraud/connect library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nofraud / connect example snippets
const DEFAULT_AVS_CODE = 'U';
const DEFAULT_CVV_CODE = 'U';
$criteria = $this->criteriaBuilder
->addFilter(
'additional_information',
'%nofraud_decision___review%',
'like'
)->create();
$searchResult = $this->paymentRepository->getList( $criteria );
$paymentsUnderReview = $searchResult->getItems();
$criteria = $this->criteriaBuilder
->addFilter(
'additional_information',
'%nofraud_decision___review%',
'like'
)->create();
[
'braintree' => [
'value' => 'braintree',
'label' => 'Credit Card (Braintree)',
],
'authorizenet_directpost' => [
'value' => 'authorizenet_directpost',
'label' => 'Credit Card Direct Post (Authorize.net)',
],
]
[
'paypal' => [
'label' => 'PayPal', // <- group 'label'
'value' => [ // <- group 'value' (array of choices in the group)
'paypal_billing_agreement' => [
'value' => 'paypal_billing_agreement',
'label' => 'PayPal Billing Agreement',
],
'payflow_express_bml' => [
'value' => 'payflow_express_bml',
'label' => 'PayPal Credit',
],
],
],
'authorizenet_directpost' => [
'value' => 'authorizenet_directpost',
'label' => 'Credit Card Direct Post (Authorize.net)',
],
]
// Use the NoFraud Sandbox URL if Sandbox Mode is enabled in Admin Config:
//
$apiUrl = $this->apiUrl->whichEnvironmentUrl();
// Get the API URL:
//
$apiUrl = $this->configHelper->getApiUrl();
[
'http' => [
'response' => [
'body' => $responseBody,
'code' => $responseCode,
'time' => $responseTime,
],
'client' => [
'error' => $curlError,
],
],
]
Logger/Logger.php
Logger/Handler/Info.php
etc/di.xml
xml
<config>
<type name="Magento\Config\Model\Config\TypePool">
<arguments>
<argument name="sensitive" xsi:type="array">
<item name="nofraud_connect/general/api_token" xsi:type="string">1</item>
</argument>
</arguments>
</type>
</config>