Skip to content

Commit

Permalink
Merge pull request #38 from mediaopt/feature/35190-integrate-vaulting…
Browse files Browse the repository at this point in the history
…-settings

Feature/35190 integrate vaulting settings
  • Loading branch information
majidabbasimediaopt authored Nov 22, 2023
2 parents d636843 + 9af5fb2 commit 360360a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paypal-commercetools-client",
"version": "0.0.63",
"version": "0.0.64",
"private": false,
"type": "module",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion src/components/HostedFields/SubmitPayment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const SubmitPayment: React.FC<SubmitPaymentProps> = ({
const [paying, setPaying] = useState(false);
const cardHolderName = useRef<HTMLInputElement>(null);

const storeInVaultOnSuccess = settings?.storeInVaultOnSuccess;
const save = useRef<HTMLInputElement>(null);
const hostedField = usePayPalHostedFields();
const threeDSAuth = settings?.threeDSOption;
Expand Down Expand Up @@ -113,7 +114,7 @@ export const SubmitPayment: React.FC<SubmitPaymentProps> = ({
placeholder="Full name"
/>
</label>
{enableVaulting && (
{(enableVaulting || storeInVaultOnSuccess) && (
<label>
<input
type="checkbox"
Expand Down
4 changes: 3 additions & 1 deletion src/components/PayPal/PayPalMask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const PayPalMask: React.FC<CustomPayPalButtonsComponentProps> = (
const { enableVaulting, paypalMessages, ...restprops } = props;
const save = useRef<HTMLInputElement>(null);

const storeInVaultOnSuccess = settings?.storeInVaultOnSuccess;

const style = useMemo(() => {
if (restprops.style || !settings) {
return restprops.style;
Expand Down Expand Up @@ -74,7 +76,7 @@ export const PayPalMask: React.FC<CustomPayPalButtonsComponentProps> = (
{...actions}
onError={errorFunc}
/>
{enableVaulting && (
{(enableVaulting || storeInVaultOnSuccess) && (
<label>
<input
type="checkbox"
Expand Down

0 comments on commit 360360a

Please sign in to comment.