276 if ($labelValuesOnly) {
306 $fullMap = array_merge($this->_paymentMap, $this->_systemMap);
307 if (is_object($from)) {
308 $from = [$from,
'getDataUsingMethod'];
310 \Magento\Framework\DataObject\Mapper::accumulateByMap($from, [
$payment,
'setAdditionalInformation'], $fullMap);
323 $fullMap = array_merge($this->_paymentMap, $this->_systemMap);
324 \Magento\Framework\DataObject\Mapper::accumulateByMap(
325 [
$payment,
'getAdditionalInformation'],
340 $paymentStatus =
$payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
341 if (self::PAYMENTSTATUS_PENDING === $paymentStatus) {
342 $pendingReason =
$payment->getAdditionalInformation(self::PENDING_REASON_GLOBAL);
343 return !in_array($pendingReason, [
'authorization',
'order']);
358 ) && 1 ==
$payment->getAdditionalInformation(
359 self::IS_FRAUD_GLOBAL
371 $paymentStatus =
$payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
372 return self::PAYMENTSTATUS_COMPLETED === $paymentStatus;
383 $paymentStatus =
$payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
387 self::PAYMENTSTATUS_COMPLETED,
388 self::PAYMENTSTATUS_INPROGRESS,
389 self::PAYMENTSTATUS_REFUNDED,
390 self::PAYMENTSTATUS_REFUNDEDPART,
391 self::PAYMENTSTATUS_UNREVERSED,
392 self::PAYMENTSTATUS_PROCESSED
398 $pendingReason =
$payment->getAdditionalInformation(self::PENDING_REASON_GLOBAL);
399 return self::PAYMENTSTATUS_PENDING === $paymentStatus && in_array(
401 [
'authorization',
'order']
413 $paymentStatus =
$payment->getAdditionalInformation(self::PAYMENT_STATUS_GLOBAL);
417 self::PAYMENTSTATUS_DENIED,
418 self::PAYMENTSTATUS_EXPIRED,
419 self::PAYMENTSTATUS_FAILED,
420 self::PAYMENTSTATUS_REVERSED,
421 self::PAYMENTSTATUS_VOIDED
439 return __(
'This customer didn\'t include a confirmed address.');
440 case 'authorization':
442 return __(
'The payment is authorized but not settled.');
444 return __(
'The payment eCheck is not cleared.');
446 return __(
'The merchant holds a non-U.S. account and doesn\'t have a withdrawal mechanism.');
447 case 'multi-currency':
449 case 'multi_currency':
451 case 'multicurrency':
452 return __(
'The payment currency doesn\'t match any of the merchant\'s balances currency.');
453 case 'paymentreview':
454 return __(
'The payment is pending while it is being reviewed by PayPal for risk.');
457 'The payment is pending because it was made to an email address that ' 458 .
'is not yet registered or confirmed.' 461 return __(
'The merchant account is not yet verified.');
464 'The payment was made via credit card.' 465 .
' In order to receive funds merchant must upgrade account to Business or Premier status.' 472 return __(
'Sorry, but something went wrong. Please contact PayPal customer service.');
487 'chargeback' =>
__(
'A reversal has occurred on this transaction due to a chargeback by your customer.'),
489 'A reversal has occurred on this transaction due to your customer triggering a money-back guarantee.' 491 'buyer-complaint' =>
__(
492 'A reversal has occurred on this transaction due to a' 493 .
' complaint about the transaction from your customer.' 495 'buyer_complaint' =>
__(
496 'A reversal has occurred on this transaction due to a' 497 .
' complaint about the transaction from your customer.' 500 'A reversal has occurred on this transaction because you have given the customer a refund.' 502 'adjustment_reversal' =>
__(
'Reversal of an adjustment.'),
503 'admin_fraud_reversal' =>
__(
'Transaction reversal due to fraud detected by PayPal administrators.'),
504 'admin_reversal' =>
__(
'Transaction reversal by PayPal administrators.'),
505 'chargeback_reimbursement' =>
__(
'Reimbursement for a chargeback.'),
506 'chargeback_settlement' =>
__(
'Settlement of a chargeback.'),
507 'unauthorized_spoof' =>
__(
508 'A reversal has occurred on this transaction because of a' 509 .
' customer dispute suspecting unauthorized spoof.' 511 'non_receipt' =>
__(
'Buyer claims that he did not receive goods or service.'),
512 'not_as_described' =>
__(
513 'Buyer claims that the goods or service received differ from' 514 .
' merchant’s description of the goods or service.' 516 'unauthorized' =>
__(
'Buyer claims that he/she did not authorize transaction.'),
517 'adjustment_reimburse' =>
__(
'A case that has been resolved and close requires a reimbursement.'),
518 'duplicate' =>
__(
'Buyer claims that a possible duplicate payment was made to the merchant.'),
519 'merchandise' =>
__(
'Buyer claims that the received merchandise is unsatisfactory, defective, or damaged.'),
523 :
__(
'Unknown reason. Please contact PayPal customer service.');
534 $listOfDisputeCodes = [
537 'chargeback' =>
true,
538 'buyer-complaint' =>
true,
539 'adjustment_reversal' =>
true,
540 'guarantee' =>
false,
542 'chargeback_reimbursement' =>
false,
543 'chargeback_settlement' =>
false,
545 return isset($listOfDisputeCodes[
$code]) ? $listOfDisputeCodes[
$code] :
false;
559 foreach ($keys as $key) {
560 if (!isset($this->_paymentMapFull[$key])) {
561 $this->_paymentMapFull[$key] = [];
563 if (!isset($this->_paymentMapFull[$key][
'label'])) {
564 if (!
$payment->hasAdditionalInformation($key)) {
565 $this->_paymentMapFull[$key][
'label'] =
false;
566 $this->_paymentMapFull[$key][
'value'] =
false;
569 $this->_paymentMapFull[$key][
'label'] = (string)$this->
_getLabel($key);
570 $this->_paymentMapFull[$key][
'value'] = $this->
_getValue(
$value, $key);
573 if (!empty($this->_paymentMapFull[$key][
'value'])) {
574 if ($labelValuesOnly) {
575 $value = $this->_paymentMapFull[$key][
'value'];
579 $result[$key] = $this->_paymentMapFull[$key];
594 if (!isset($this->_labelCodesCache[self::ITEM_LABELS])) {
596 self::PAYPAL_PAYER_ID =>
__(
'Payer ID'),
597 self::PAYPAL_PAYER_EMAIL =>
__(
'Payer Email'),
598 self::PAYPAL_PAYER_STATUS =>
__(
'Payer Status'),
599 self::PAYPAL_ADDRESS_ID =>
__(
'Payer Address ID'),
600 self::PAYPAL_ADDRESS_STATUS =>
__(
'Payer Address Status'),
601 self::PAYPAL_PROTECTION_ELIGIBILITY =>
__(
'Merchant Protection Eligibility'),
602 self::PAYPAL_FRAUD_FILTERS =>
__(
'Triggered Fraud Filters'),
603 self::PAYPAL_CORRELATION_ID =>
__(
'Last Correlation ID'),
604 self::PAYPAL_AVS_CODE =>
__(
'Address Verification System Response'),
605 self::PAYPAL_CVV_2_MATCH =>
__(
'CVV2 Check Result by PayPal'),
606 self::PAYPAL_CVV2MATCH =>
__(
'CVV2 Check Result by PayPal'),
607 self::PAYPAL_AVSADDR =>
__(
'AVS Street Match'),
608 self::PAYPAL_AVSZIP =>
__(
'AVS zip'),
609 self::PAYPAL_IAVS =>
__(
'International AVS response'),
610 self::BUYER_TAX_ID =>
__(
'Buyer\'s Tax ID'),
611 self::BUYER_TAX_ID_TYPE =>
__(
'Buyer\'s Tax ID Type'),
614 return isset($this->_labelCodesCache[self::ITEM_LABELS][$key])
628 'chargeback' =>
__(
'Chargeback'),
629 'complaint' =>
__(
'Complaint'),
630 'dispute' =>
__(
'Dispute'),
632 $value = isset($labels[$key]) ? $labels[$key] :
'';
647 $outputValue = implode(
', ', (array)
$value);
670 return sprintf(
'#%s%s', $outputValue, $outputValue ==
$label ?
'' :
': ' .
$label);
682 if (!isset($this->_labelCodesCache[self::PAYPAL_AVS_CODE])) {
684 'A' =>
__(
'Matched Address only (no ZIP)'),
685 'B' =>
__(
'Matched Address only (no ZIP) International'),
686 'N' =>
__(
'No Details matched'),
687 'C' =>
__(
'No Details matched. International'),
688 'X' =>
__(
'Exact Match.'),
689 'D' =>
__(
'Exact Match. Address and Postal Code. International'),
690 'F' =>
__(
'Exact Match. Address and Postal Code. UK-specific'),
691 'E' =>
__(
'N/A. Not allowed for MOTO (Internet/Phone) transactions'),
692 'G' =>
__(
'N/A. Global Unavailable'),
693 'I' =>
__(
'N/A. International Unavailable'),
694 'Z' =>
__(
'Matched five-digit ZIP only (no Address)'),
695 'P' =>
__(
'Matched Postal Code only (no Address)'),
696 'R' =>
__(
'N/A. Retry'),
697 'S' =>
__(
'N/A. Service not Supported'),
698 'U' =>
__(
'N/A. Unavailable'),
699 'W' =>
__(
'Matched whole nine-digit ZIP (no Address)'),
700 'Y' =>
__(
'Yes. Matched Address and five-digit ZIP'),
701 '0' =>
__(
'All the address information matched'),
702 '1' =>
__(
'None of the address information matched'),
703 '2' =>
__(
'Part of the address information matched'),
704 '3' =>
__(
'N/A. The merchant did not provide AVS information'),
705 '4' =>
__(
'N/A. Address not checked, or acquirer had no response. Service not available'),
708 return isset($this->_labelCodesCache[self::PAYPAL_AVS_CODE][
$value])
722 if (!isset($this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH])) {
725 'M' =>
__(
'Matched (CVV2CSC)'),
726 'N' =>
__(
'No match'),
727 'P' =>
__(
'N/A. Not processed'),
728 'S' =>
__(
'N/A. Service not supported'),
729 'U' =>
__(
'N/A. Service not available'),
730 'X' =>
__(
'N/A. No response'),
731 'Y' =>
__(
'Matched (CVV2CSC)'),
733 '0' =>
__(
'Matched (CVV2)'),
734 '1' =>
__(
'No match'),
735 '2' =>
__(
'N/A. The merchant has not implemented CVV2 code handling'),
736 '3' =>
__(
'N/A. Merchant has indicated that CVV2 is not present on card'),
737 '4' =>
__(
'N/A. Service not available'),
740 return isset($this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH][
$value])
753 if (!isset($this->_labelCodesCache[self::BUYER_TAX_ID_TYPE])) {
755 self::BUYER_TAX_ID_TYPE_CNPJ =>
__(
'CNPJ'),
756 self::BUYER_TAX_ID_TYPE_CPF =>
__(
'CPF'),
759 return isset($this->_labelCodesCache[self::BUYER_TAX_ID_TYPE][
$code])
const PAYMENTSTATUS_COMPLETED
_getBuyerIdTypeValue($code)
static isPaymentReviewRequired(\Magento\Payment\Model\InfoInterface $payment)
const PAYMENTSTATUS_PENDING
const ORDER_STATUS_REVERSED
static isPaymentCompleted(\Magento\Payment\Model\InfoInterface $payment)
_getFullInfo(array $keys, \Magento\Payment\Model\InfoInterface $payment, $labelValuesOnly)
const PAYPAL_CORRELATION_ID
const TXN_TYPE_ADJUSTMENT
const PAYMENTSTATUS_PROCESSED
importToPayment($from, \Magento\Payment\Model\InfoInterface $payment)
const PAYMENTSTATUS_FAILED
const PAYMENTSTATUS_REVIEW
const PAYPAL_PAYER_STATUS
const ORDER_STATUS_CANCELED_REVERSAL
static explainPendingReason($code)
const PAYMENTSTATUS_INPROGRESS
static isPaymentFailed(\Magento\Payment\Model\InfoInterface $payment)
const PAYMENTSTATUS_DENIED
static isReversalDisputable($code)
getPublicPaymentInfo(\Magento\Payment\Model\InfoInterface $payment, $labelValuesOnly=false)
const PAYMENTSTATUS_UNREVERSED
const PAYMENT_STATUS_GLOBAL
static isPaymentSuccessful(\Magento\Payment\Model\InfoInterface $payment)
const BUYER_TAX_ID_TYPE_CNPJ
const PAYMENT_REASON_CODE_REFUND
const PAYMENTSTATUS_VOIDED
const PENDING_REASON_GLOBAL
static explainReasonCode($code)
const PAYPAL_ADDRESS_STATUS
const PAYMENTSTATUS_REFUNDEDPART
const PAYMENTSTATUS_REFUNDED
static isFraudReviewAllowed(\Magento\Payment\Model\InfoInterface $payment)
getPaymentInfo(\Magento\Payment\Model\InfoInterface $payment, $labelValuesOnly=false)
const BUYER_TAX_ID_TYPE_CPF
const PAYMENTSTATUS_REVERSED
const PAYMENTSTATUS_EXPIRED
const PAYPAL_PROTECTION_ELIGIBILITY
static getCaseTypeLabel($key)
& exportFromPayment(\Magento\Payment\Model\InfoInterface $payment, $to, array $map=null)
const PAYPAL_FRAUD_FILTERS