Skip to content
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

PayPal hosted fields available as components #160

Merged
merged 45 commits into from
Oct 1, 2021

Conversation

borodovisin
Copy link
Contributor

This PR is a first version of the PayPal hosted-fields.
Include two new components to not add much complex in the library.

We have a PayPalHostedFieldsForm component and a PayPalHostedField component

For further info, please check the test cases...

@borodovisin borodovisin requested a review from a team as a code owner September 17, 2021 23:28
@codecov
Copy link

codecov bot commented Sep 18, 2021

Codecov Report

Merging #160 (f144ef7) into main (b78c995) will increase coverage by 1.38%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   98.29%   99.68%   +1.38%     
==========================================
  Files          10       15       +5     
  Lines         235      316      +81     
  Branches       70       92      +22     
==========================================
+ Hits          231      315      +84     
+ Misses          4        1       -3     
Impacted Files Coverage Δ
src/components/PayPalMarks.tsx 100.00% <ø> (ø)
src/components/PayPalScriptProvider.tsx 100.00% <ø> (ø)
src/context/scriptProviderContext.ts 100.00% <ø> (+11.11%) ⬆️
src/components/PayPalButtons.tsx 98.50% <100.00%> (+1.49%) ⬆️
src/components/hostedFields/PayPalHostedField.tsx 100.00% <100.00%> (ø)
...onents/hostedFields/PayPalHostedFieldsProvider.tsx 100.00% <100.00%> (ø)
src/components/hostedFields/utils.ts 100.00% <100.00%> (ø)
src/components/hostedFields/validators.ts 100.00% <100.00%> (ø)
src/constants.ts 100.00% <100.00%> (ø)
src/context/payPalHostedFieldsContext.ts 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b78c995...f144ef7. Read the comment docs.

import React from "react";
import type { FC } from "react";

import type { PayPalHostedFieldProps } from "../../types/payPalHostedFieldTypes";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Food for thought but we could consider colocating types in the future. I don't want to change this in this particular PR, but in files like this sometimes its nice to have colocation. Anyways just curious if thats a good future refactor and what people think about it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is a great suggestion for a future PR. colocation is a great way to organize as this repo grows in the number of files.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@gregjopa gregjopa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @borodovisin!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@gregjopa gregjopa merged commit e025d9a into paypal:main Oct 1, 2021
@borodovisin borodovisin deleted the DTPPSDK-316/hosted-fields branch October 1, 2021 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants