Skip to content

Commit 1a29ed7

Browse files
authored
Merge pull request #60 from vtex-apps/feat/payment-origin
✨ Add payment system name and payment origin on payment summary when paid with creditCard
2 parents dbcf2fc + 28c4e11 commit 1a29ed7

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
- Payment system name and payment origin on payment summary when paid with creditCard
12+
1013
## [1.9.1] - 2023-02-16
1114

1215
### Added

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ interface Payment {
234234
id: string;
235235
paymentSystem: string;
236236
paymentSystemName: string;
237+
paymentOrigin: string | null;
237238
value: number;
238239
lastDigits: string | null;
239240
group: string;

react/PaymentMethod.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ const PaymentMethod: FunctionComponent<Props & InjectedIntlProps> = ({
5959
}) => {
6060
const { rootPath } = useRuntime()
6161
const [isOpen, setIsOpen] = useState(false)
62+
const hasPaymentSystemName = payment.paymentSystemName
63+
const hasPaymentOrigin = !!payment.paymentOrigin
6264
const hasLastDigits = !!payment.lastDigits
6365
const isBankInvoice = payment.group === 'bankInvoice'
6466
const handles = useCssHandles(CSS_HANDLES)
@@ -69,8 +71,16 @@ const PaymentMethod: FunctionComponent<Props & InjectedIntlProps> = ({
6971
<p className={`${handles.paymentGroup} c-on-base`}>
7072
{paymentGroupSwitch(payment, intl)}
7173
</p>
72-
{hasLastDigits && (
74+
{hasPaymentSystemName && (
7375
<p className="c-muted-1 mb3">
76+
{payment.paymentSystemName}
77+
{hasPaymentOrigin && (
78+
<span>&nbsp;({payment.paymentOrigin})</span>
79+
)}
80+
</p>
81+
)}
82+
{hasLastDigits && (
83+
<p className="c-muted-1 mt0 mb3">
7484
{intl.formatMessage(messages.lastDigits, {
7585
lastDigits: payment.lastDigits,
7686
})}

react/typings/global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ interface Payment {
128128
id: string
129129
paymentSystem: string
130130
paymentSystemName: string
131+
paymentOrigin: string | null
131132
value: number
132133
lastDigits: string | null
133134
group: string

0 commit comments

Comments
 (0)