niksumeiko / payment-form-react-tdd-kata Goto Github PK
View Code? Open in Web Editor NEWPayment form (React + TDD kata)
Payment form (React + TDD kata)
Display API errors
Display API error underneath related input field
Display generic API error above payment form
Attribute | Type |
---|---|
scope | string(amount | bic ) |
message | string |
[
{ "scope": "amount", "message": "Missing amount" },
{ "scope": "bic", "message": "Missing BIC" },
]
Disable pay button after it's being clicked
Enable international payment
Enhance payment page with BIC input:
(BIC stands for an International Bank Code)
Send form data to the API
Display validation errors
Payment form
Validation error
Attribute | Type |
---|---|
amount | string |
iban | string |
bic | string |
Attribute | Type |
---|---|
id | string |
amount | number |
iban | string |
bic | string |
type | enum(DOM | INT) |
Enable the customer to make a domestic payment.
1. Create a payment page:
With the form:
- IBAN input field
- Amount input field
- Make payment button
2. Send form data to the API
When the user clicks the form control
3. Display success screen
4. Display validation errors
- When IBAN is not provided
- When payment amount is empty or invalid
The new payment is created via POST /pay endpoint.
Expected request:
Attribute | Type |
---|---|
amount | number |
iban | string |
Response:
Attribute | Type |
---|---|
id | string |
amount | number |
iban | string |
type | enum(DOM | INT) |
Display my account details
Display my account details to the left of page heading title
When successfully making a payment, refetch account
Header | Value |
---|---|
Content-Type | application/json |
Attribute | Type |
---|---|
id | string |
balance | number |
name | string |
Enhance the success screen with payment details.
Attribute | Type |
---|---|
id | string |
amount | number |
iban | string |
type | enum(DOM | INT) |
For domestic payment
For international
The payment amount can't be empty, 0 or invalid.
The acceptance criteria from #3 was forgotten.
1. Open payment page
2. Fill in the IBAN (AT123)
3. Submit the payment form
Actual
4. POST /pay request throws
5. Nothing happens
Expected
4. No POST /pay request is even issued
5. Form validation error is displayed
Exactly as other form inputs validation errors:
Enable the customer to see the payment receiver's bank details.
1. Display an info message for the internal receiver.
Message: "Same bank transfer · Money arrives immediately"
When isInternal=true
(see API specification below).
2. Display an info message for the external receiver that qualifies for instant payment.
Message: "Slovenská sporiteľňa, Bratislava, SK · Money arrives immediately"
When isInternal=true
and bank
is provided (see API specification below).
3. Display an info message for a regular external receiver.
Message: "Santander Consumer Bank, Schweglerstraße 26, 1150 Vienna, AT"
When isInternal=false
and bank
is provided (see API specification below).
Retrieve IBAN evaluation via GET /receiver endpoint.
Expected request:
Attribute | Type |
---|---|
iban | string |
Response:
Attribute | Type |
---|---|
isInternal? | true |
bank?.name? | string |
bank?.address?.street | string |
bank?.address?.zip | string |
bank?.address?.city | string |
bank?.address?.country | string(ISO2) |
Internal receiver
External receiver for instant payment
Regular external receiver
Enable the customer to upload an invoice to a particular transaction.
1. Display the "Attach file" button within transaction details
- Only when the transaction doesn't have a file already attached
2. Upload the selected file to the AWS S3 bucket
- When clicking the "Attach file" button, upload the file to S3
3. Link uploaded file to the transaction
- After the S3 upload is done, save generated file URL to the transaction
4. Display a link to the attached file within the transaction details
- When a transaction has a link to the attached file, display it instead of the button.
Expected response:
Attribute | Type |
---|---|
items | Array |
items[].id | string |
items[].date | ISO(string) |
items[].amount | number |
items[].type | enum(DOM |
items[].iban | string |
items[].file | string |
Expected request:
Attribute | Type |
---|---|
file | string |
Display my account future balance
Display the future account balance underneath amount input
Display info message underneath the amount input
Disable pay button when the future balance is negative
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.