forked from LiveCarta/PayPal-PHP-Server-SDK
Release 0.7.0
Beta Release 0.7.0 including: - Bug fixes - Updated model/function names - Updated models to reflect changes in APIs
This commit is contained in:
@@ -10,41 +10,93 @@ declare(strict_types=1);
|
||||
|
||||
namespace PaypalServerSdkLib\Models;
|
||||
|
||||
use Core\Utils\CoreHelper;
|
||||
use Exception;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* The declined payment transactions might have payment advice codes. The card networks, like Visa and
|
||||
* Mastercard, return payment advice codes.
|
||||
*/
|
||||
class PaymentAdviceCode
|
||||
{
|
||||
public const ENUM_01 = '01';
|
||||
|
||||
public const ENUM_02 = '02';
|
||||
|
||||
public const ENUM_03 = '03';
|
||||
|
||||
public const ENUM_21 = '21';
|
||||
|
||||
private const _ALL_VALUES = [self::ENUM_01, self::ENUM_02, self::ENUM_03, self::ENUM_21];
|
||||
/**
|
||||
* For Mastercard, expired card account upgrade or portfolio sale conversion. Obtain new account
|
||||
* information before next billing cycle.
|
||||
*/
|
||||
public const PAYMENTADVICE_01 = '01';
|
||||
|
||||
/**
|
||||
* Ensures that all the given values are present in this Enum.
|
||||
*
|
||||
* @param array|stdClass|null|string $value Value or a list/map of values to be checked
|
||||
*
|
||||
* @return array|null|string Input value(s), if all are a part of this Enum
|
||||
*
|
||||
* @throws Exception Throws exception if any given value is not in this Enum
|
||||
* For Mastercard, over credit limit or insufficient funds. Retry the transaction 72 hours later. For
|
||||
* Visa, the card holder wants to stop only one specific payment in the recurring payment relationship.
|
||||
* The merchant must NOT resubmit the same transaction. The merchant can continue the billing process
|
||||
* in the subsequent billing period.
|
||||
*/
|
||||
public static function checkValue($value)
|
||||
{
|
||||
$value = json_decode(json_encode($value), true); // converts stdClass into array
|
||||
if (CoreHelper::checkValueOrValuesInList($value, self::_ALL_VALUES)) {
|
||||
return $value;
|
||||
}
|
||||
throw new Exception("$value is invalid for PaymentAdviceCode.");
|
||||
}
|
||||
public const PAYMENTADVICE_02 = '02';
|
||||
|
||||
/**
|
||||
* For Mastercard, account closed as fraudulent. Obtain another type of payment from customer due to
|
||||
* account being closed or fraud. Possible reason: Account closed as fraudulent. For Visa, the card
|
||||
* holder wants to stop all recurring payment transactions for a specific merchant. Stop recurring
|
||||
* payment requests.
|
||||
*/
|
||||
public const PAYMENTADVICE_03 = '03';
|
||||
|
||||
/**
|
||||
* For Mastercard, token requirements not fulfilled for this token type.
|
||||
*/
|
||||
public const PAYMENTADVICE_04 = '04';
|
||||
|
||||
/**
|
||||
* For Mastercard, the card holder has been unsuccessful at canceling recurring payment through
|
||||
* merchant. Stop recurring payment requests. For Visa, all recurring payments were canceled for the
|
||||
* card number requested. Stop recurring payment requests.
|
||||
*/
|
||||
public const PAYMENTADVICE_21 = '21';
|
||||
|
||||
/**
|
||||
* For Mastercard, merchant does not qualify for product code.
|
||||
*/
|
||||
public const PAYMENTADVICE_22 = '22';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 1 hour.
|
||||
*/
|
||||
public const PAYMENTADVICE_24 = '24';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 24 hours.
|
||||
*/
|
||||
public const PAYMENTADVICE_25 = '25';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 2 days.
|
||||
*/
|
||||
public const PAYMENTADVICE_26 = '26';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 4 days.
|
||||
*/
|
||||
public const PAYMENTADVICE_27 = '27';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 6 days.
|
||||
*/
|
||||
public const PAYMENTADVICE_28 = '28';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 8 days.
|
||||
*/
|
||||
public const PAYMENTADVICE_29 = '29';
|
||||
|
||||
/**
|
||||
* For Mastercard, retry after 10 days .
|
||||
*/
|
||||
public const PAYMENTADVICE_30 = '30';
|
||||
|
||||
/**
|
||||
* For Mastercard, consumer non-reloadable prepaid card.
|
||||
*/
|
||||
public const PAYMENTADVICE_40 = '40';
|
||||
|
||||
/**
|
||||
* For Mastercard, consumer multi-use virtual card number.
|
||||
*/
|
||||
public const PAYMENTADVICE_43 = '43';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user