Skip to content

Commit

Permalink
Merge pull request #29 from buckaroo-it/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
harli91 authored Feb 5, 2024
2 parents bfaaceb + 87164c6 commit a94bd63
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 39 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://www.buckaroo.nl/media/3577/magento2_hyva_icon.png" width="200px" position="center">
<img src="https://github.com/buckaroo-it/Magento2_Hyva/assets/105488705/2bdf7c56-d2ce-44a8-a338-48e4e70b4996" width="200px" position="center">
</p>

# Buckaroo Magento2 Hyvä checkout extension
Expand Down Expand Up @@ -85,6 +85,13 @@ Currently not all payment methods are supported in our Magento 2 Hyvä checkout
We really appreciate it when developers contribute to improve the Buckaroo plugins.
If you want to contribute as well, then please follow our [Contribution Guidelines](CONTRIBUTING.md).

> ### Community is the :green_heart: of open source
> Developing beautiful products is not possible without the input of a community. We thank everyone who actively contributes to this.
>
> [![ennostuurman's avatar](https://github.com/ennostuurman.png?size=50)](https://github.com/ennostuurman) [![rajeev-k-tomy's avatar](https://github.com/rajeev-k-tomy.png?size=50)](https://github.com/rajeev-k-tomy) [![poespas's avatar](https://github.com/poespas.png?size=50)](https://github.com/poespas) [![marissennet's avatar](https://github.com/marissennet.png?size=50)](https://github.com/marissennet) ![mgroensmit's avatar](https://avatars.githubusercontent.com/u/63691247?s=50)
We would like to extend a special thank you to the developers at [Mooore](https://www.mooore.nl/) who have been co-developing with us on this project and were the initiators of this collaboration. Your hard work, dedication, and expertise have been invaluable in bringing this project to life. We couldn't have done it without you. Thank you! :raised_hands:

### Versioning
<p align="left">
<img src="https://www.buckaroo.nl/media/3480/magento_versioning.png" width="500px" position="center">
Expand All @@ -98,3 +105,4 @@ If you want to contribute as well, then please follow our [Contribution Guidelin
### Additional information
- **Support:** https://support.buckaroo.eu/contact
- **Contact:** [[email protected]](mailto:[email protected]) or [+31 (0)30 711 50 50](tel:+310307115050)

8 changes: 4 additions & 4 deletions src/method/Afterpay/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ export function prepareValidationSchema(cart) {
tos: YupBool().oneOf([true], requiredMessage),
identificationNumber: YupString().when('isCompany', {
is: () => cart.billing_address.country === 'FI',
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
coc: YupString().when('isb2b', {
is: () => showCOC(cart),
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
});
}
23 changes: 13 additions & 10 deletions src/method/AfterpayOld/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ export function prepareValidationSchema(cart, paymentMethod) {
return YupObject({
telephone: YupString().when('canShowPhone', {
is: () => canShowPhone(cart),
then: YupString().required(requiredMessage).bkOnlyNumeric(onlyNumeric),
otherwise: YupString(),
then: () =>
YupString().required(requiredMessage).bkOnlyNumeric(onlyNumeric),
otherwise: () => YupString(),
}),
dob: YupString()
.required(requiredMessage)
Expand All @@ -148,20 +149,22 @@ export function prepareValidationSchema(cart, paymentMethod) {
businessType: YupString().oneOf(['b2b', 'b2c'], requiredMessage),
coc: YupString().when('aaa', {
is: () => isDigiAccept(paymentMethod),
then: YupString().required(requiredMessage).bkOnlyNumeric(onlyNumeric),
otherwise: YupString(),
then: () =>
YupString().required(requiredMessage).bkOnlyNumeric(onlyNumeric),
otherwise: () => YupString(),
}),
iban: YupString().when('businessType', {
is: (fields) => isB2B(paymentMethod, fields),
then: YupString()
.required(requiredMessage)
.bkValidateBankNumber(__('Please enter a valid account number')),
otherwise: YupString(),
then: () =>
YupString()
.required(requiredMessage)
.bkValidateBankNumber(__('Please enter a valid account number')),
otherwise: () => YupString(),
}),
companyName: YupString().when('businessType', {
is: (fields) => isB2B(paymentMethod, fields),
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
});
}
8 changes: 7 additions & 1 deletion src/method/Bancontact/Bancontact.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ import usePlaceOrder from './usePlaceOrder';
function Bancontact({ method, selected, actions }) {
const isSelected = method.code === selected.code;
const { registerPaymentAction } = useCheckoutFormContext();
const [clientSideMode, setClientSideMode] = useState('cc');

let defaultClientSideMode = 'mobile';
if (useClientSide) {
defaultClientSideMode = 'cc';
}

const [clientSideMode, setClientSideMode] = useState(defaultClientSideMode);

const formik = useFormik({
initialValues: {
Expand Down
2 changes: 1 addition & 1 deletion src/method/Bancontact/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const yearStart = new Date().getFullYear();
export const range = (size, startAt = 0) =>
[...Array(size).keys()].map((i) => i + startAt);

export const useClientSide = getConfig('mrcash.useClientSide');
export const useClientSide = getConfig('mrcash.useClientSide') === 1;
16 changes: 8 additions & 8 deletions src/method/Billink/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ export const validationSchema = (showDob) => {
tos: YupBool().oneOf([true], requiredMessage),
coc: YupString().when('showB2b', {
is: () => showB2b,
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
phone: YupString().when('showB2b', {
is: () => !showB2b,
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
gender: YupString().when('showDob', {
is: () => showDob,
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
dob: YupString().when('showDob', {
is: () => showDob,
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
});
};
Expand Down
15 changes: 8 additions & 7 deletions src/method/In3/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ export const validationSchema = (showPhone, country) =>
dob: YupString().required(requiredMessage),
phone: YupString().when('showPhone', {
is: () => showPhone,
then: YupString()
.required(requiredMessage)
.bkValidatePhone({
errorMessage: __('Phone number should be correct.'),
country,
}),
otherwise: YupString(),
then: () =>
YupString()
.required(requiredMessage)
.bkValidatePhone({
errorMessage: __('Phone number should be correct.'),
country,
}),
otherwise: () => YupString(),
}),
});
11 changes: 6 additions & 5 deletions src/method/SepaDirect/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ export const validationSchema = (isNotNL) => {
bankAccountNumber: YupString()
.required(requiredMessage)
.bkValidateBankNumber(__('Please enter a valid account number')),
bic: YupString().when('isNotNL', {
bic: YupString().when([], {
is: () => isNotNL,
then: YupString()
.required(requiredMessage)
.bkValidateBic(__('Please enter a valid bic number')),
otherwise: YupString(),
then: () =>
YupString()
.required(requiredMessage)
.bkValidateBic(__('Please enter a valid bic number')),
otherwise: () => YupString(),
}),
});
};
4 changes: 2 additions & 2 deletions src/method/Tinka/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const validationSchema = (showDob) =>
YupObject({
dob: YupString().when('showDob', {
is: () => showDob,
then: YupString().required(requiredMessage),
otherwise: YupString(),
then: () => YupString().required(requiredMessage),
otherwise: () => YupString(),
}),
});

0 comments on commit a94bd63

Please sign in to comment.