Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-paypal
Test
Unit
Model
Api
ProcessableExceptionTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Paypal\Test\Unit\Model\Api
;
7
8
use
Magento\Paypal\Model\Api\ProcessableException
;
9
10
class
ProcessableExceptionTest
extends
\PHPUnit\Framework\TestCase
11
{
12
const
UNKNOWN_CODE
= 10411;
13
17
private
$model;
18
25
public
function
testGetUserMessage
(
$code
, $msg)
26
{
27
$this->model =
new
ProcessableException
(
__
($msg),
null
,
$code
);
28
$this->assertEquals($msg, $this->model->getUserMessage());
29
}
30
34
public
function
getUserMessageDataProvider
()
35
{
36
return
[
37
[
38
ProcessableException::API_INTERNAL_ERROR
,
39
"I'm sorry - but we were not able to process your payment. "
40
.
"Please try another payment method or contact us so we can assist you."
,
41
],
42
[
43
ProcessableException::API_UNABLE_PROCESS_PAYMENT_ERROR_CODE
,
44
"I'm sorry - but we were not able to process your payment. "
45
.
"Please try another payment method or contact us so we can assist you."
46
],
47
[
48
ProcessableException::API_COUNTRY_FILTER_DECLINE
,
49
"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
50
],
51
[
52
ProcessableException::API_MAXIMUM_AMOUNT_FILTER_DECLINE
,
53
"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
54
],
55
[
56
ProcessableException::API_OTHER_FILTER_DECLINE
,
57
"I'm sorry - but we are not able to complete your transaction. Please contact us so we can assist you."
58
],
59
[
60
ProcessableException::API_ADDRESS_MATCH_FAIL
,
61
'A match of the Shipping Address City, State, and Postal Code failed.'
62
],
63
[
64
self::UNKNOWN_CODE
,
65
"We can't place the order."
66
]
67
];
68
}
69
}
Magento\Paypal\Test\Unit\Model\Api
Definition:
NvpTest.php:7
Magento\Paypal\Model\Api\ProcessableException\API_MAXIMUM_AMOUNT_FILTER_DECLINE
const API_MAXIMUM_AMOUNT_FILTER_DECLINE
Definition:
ProcessableException.php:28
Magento\Paypal\Test\Unit\Model\Api\ProcessableExceptionTest\UNKNOWN_CODE
const UNKNOWN_CODE
Definition:
ProcessableExceptionTest.php:12
Magento\Paypal\Model\Api\ProcessableException\API_COUNTRY_FILTER_DECLINE
const API_COUNTRY_FILTER_DECLINE
Definition:
ProcessableException.php:27
Magento\Paypal\Model\Api\ProcessableException
Definition:
ProcessableException.php:16
__
__()
Definition:
__.php:13
Magento\Paypal\Test\Unit\Model\Api\ProcessableExceptionTest
Definition:
ProcessableExceptionTest.php:10
Magento\Paypal\Test\Unit\Model\Api\ProcessableExceptionTest\getUserMessageDataProvider
getUserMessageDataProvider()
Definition:
ProcessableExceptionTest.php:34
Magento\Paypal\Model\Api\ProcessableException\API_UNABLE_PROCESS_PAYMENT_ERROR_CODE
const API_UNABLE_PROCESS_PAYMENT_ERROR_CODE
Definition:
ProcessableException.php:22
Magento\Paypal\Model\Api\ProcessableException\API_INTERNAL_ERROR
const API_INTERNAL_ERROR
Definition:
ProcessableException.php:21
Magento\Paypal\Model\Api\ProcessableException\API_ADDRESS_MATCH_FAIL
const API_ADDRESS_MATCH_FAIL
Definition:
ProcessableException.php:30
Magento\Paypal\Test\Unit\Model\Api\ProcessableExceptionTest\testGetUserMessage
testGetUserMessage($code, $msg)
Definition:
ProcessableExceptionTest.php:25
Magento\Paypal\Model\Api\ProcessableException\API_OTHER_FILTER_DECLINE
const API_OTHER_FILTER_DECLINE
Definition:
ProcessableException.php:29
$code
$code
Definition:
info.phtml:12