-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial feature: Payto Await #3104
base: feature/payto-component-full
Are you sure you want to change the base?
Conversation
|
Size Change: +14 kB (+1.81%) Total Size: 788 kB
ℹ️ View Unchanged
|
size-limit report 📦
|
b402bc3
to
df83f04
Compare
4b4e27f
to
36eeb94
Compare
Quality Gate failedFailed conditions |
awaitText={this.props.i18n.get('await.waitForConfirmation')} | ||
showCountdownTimer={config.showCountdownTimer} | ||
throttleTime={config.THROTTLE_TIME} | ||
throttleInterval={config.THROTTLE_INTERVAL} | ||
onActionHandled={this.onActionHandled} | ||
endSlot={() => <MandateSummary mandate={this.props.mandate} currencyCode={this.props.amount.currency} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be a function? I think you can directly pass the Component , or maybe I am missing/forgetting something 🙈
endSlot={<MandateSummary mandate={this.props.mandate} currencyCode={this.props.amount.currency} />}
endsAt: string; | ||
remarks: string; | ||
count?: string; | ||
} | ||
|
||
export interface PayToConfiguration extends UIElementProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The types that are exposed live in the types.ts
file that stays on the root of the payment method folder. This PayToConfiguration
seems to belong there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was part of the what we had discussed in the techtalk about moving the types into the components or experiment with that at least, the idea was that we won't need to edit 2 files every time there's a prop change, or open 2 files to see the logic behind one component.
How are we configuring these exports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed that, but if I am not mistaken we also discussed that this would apply for preact components and not for the payment method elements (UIElement) since the payment method element types are usually exposed and preact component types are not.
All types that must be exposed externally are placed here
|
||
export interface PayToConfiguration extends UIElementProps { | ||
paymentData?: any; | ||
data?: PayToData; | ||
placeholders?: any; //TODO | ||
mandate: MandateType; | ||
instructions?: any; //TODO this probably should not be here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the instructions
be removed here?
And the placeholders - is it still TODO or can it be typed already?
import { PayToInstructions } from './components/PayToInstructions'; | ||
import MandateSummary from './components/MandateSummary'; | ||
|
||
//TODO export type MandateFrequencyType = 'adhoc' | 'daily' | 'weekly' | 'biWeekly' | 'monthly' | 'quarterly' | 'halfYearly' | 'yearly'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this MandateFrequencyType
type? Is it needed?
|
||
export default function MandateSummary({ mandate, currencyCode }: { mandate: MandateType; currencyCode: string }) { | ||
const { i18n } = useCoreContext(); | ||
console.log(mandate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log
- should it be removed?
}; | ||
} | ||
} | ||
// TODO test this for XSS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there anything to be done here related to this TODO
?
@@ -85,6 +85,7 @@ export { default as Blik } from './Blik'; | |||
export { default as MBWay } from './MBWay'; | |||
export { default as UPI } from './UPI'; | |||
export { default as ANCV } from './ANCV'; | |||
export { default as PayTo } from './PayTo'; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component is exposed, but its types are not. The payment method types must be exposed on the src/components/types.ts
@@ -191,6 +191,8 @@ function Await(props: AwaitComponentProps) { | |||
> | |||
{props.brandLogo && <img src={props.brandLogo} alt={props.type} className="adyen-checkout__await__brand-logo" />} | |||
|
|||
{props.showAmount && <div className="adyen-checkout__await__amount">{i18n.amount(props.amount.value, props.amount.currency)}</div>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a use-case where the amount is zero? If so, do we still display it here?
I believe that we have similar logic for QR code and we don't display it if amount is zero
|
||
const meta: Meta<PaymentMethodStoryProps<PayToStory>> = { | ||
title: 'Components/PayTo' | ||
}; | ||
|
||
// const payToPaymentObject = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these code comments about the payToPaymentObject
and paymentResponse
or can they be removed? (not sure if you left them because dev/mock purposes)
Summary
A few changes for this part of the component.
showAmount
flagdl
element (definition list), see docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl#metadataTested scenarios
Fixed issue: