Skip to content

Commit

Permalink
Merge pull request #164 from buckaroo-it/develop
Browse files Browse the repository at this point in the history
v3.7.0
  • Loading branch information
harli91 authored Jun 28, 2023
2 parents 6974a28 + d843667 commit 0ec93eb
Show file tree
Hide file tree
Showing 122 changed files with 1,602 additions and 2,851 deletions.
85 changes: 36 additions & 49 deletions .github/workflows/icons.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,43 @@
name: Embed icons automatically
name: Icon update
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
icons_embedding:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Embed icons automatically
- name: Clone media repository
run: |
ls -l
mkdir ~/tmp
cd ~/tmp
ls -l
git clone https://github.com/buckaroo-it/Media
cd Media
ls -l
echo ${{ github.workspace }}/library/buckaroo_images/svg
mkdir -p ${{ github.workspace }}/library/buckaroo_images/svg
cp "Payment methods/SVG/AfterPay.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Alipay.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Apple Pay.svg" ${{ github.workspace }}/library/buckaroo_images/svg/ApplePay.svg
cp "Payment methods/SVG/Bancontact.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Belfius.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Billink.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/CBC.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/CreditClick.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Creditcards.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/EPS.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Giftcards.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Giropay.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/INGHomePay.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/In3.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/KBC.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Klarna.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/PayPal.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/PayPerEmail.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Payconiq.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Przelewy24.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/SEPA-directdebit.svg" ${{ github.workspace }}/library/buckaroo_images/svg/SEPAdirectdebit.svg
cp "Payment methods/SVG/SEPACreditTransfer.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Sofort.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Tinka.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/Trustly.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
cp "Payment methods/SVG/WeChat Pay.svg" ${{ github.workspace }}/library/buckaroo_images/svg/WeChatPay.svg
cp "Payment methods/SVG/iDEAL.svg" ${{ github.workspace }}/library/buckaroo_images/svg/
ls -l ${{ github.workspace }}/library/buckaroo_images/svg
cd ${{ github.workspace }}
git config --global user.name "GitHub Actions Bot"
git config --global user.email "[email protected]"
git fetch
git add --all library/buckaroo_images/svg/
if git commit -m 'Embed icons automatically' library/buckaroo_images/svg; then
echo ${GITHUB_REF}
git push origin HEAD:${GITHUB_REF}
fi
git clone https://github.com/buckaroo-it/Media
ls -lah
- name: Rename all files to lowercase
run: |
cd Media
cp ${{ github.workspace }}/.github/workflows/rename-icons.php ${{ github.workspace }}/Media/rename-icons.php
php ./rename-icons.php
- name: Copy payment method icons
run: |
cd Media
cp -R "Payment methods/SVG/." ${{ github.workspace }}/library/buckaroo_images/svg/
cd ${{ github.workspace }}/library/buckaroo_images/svg/
rm -f wechatpay.svg
rm -f vouchers.svg
rm -f trustly.svg
rm -f tinka.svg
rm -f alipay.svg
rm -f buckaroovoucher.svg
- name: Copy creditcards icons
run: |
cd Media
cp -R "Creditcard issuers/SVG/." ${{ github.workspace }}/library/buckaroo_images/creditcards/
- name: Cleanup
run: |
rm -rd Media
- name: Create commit if we have changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply logo changes from media repository
13 changes: 13 additions & 0 deletions .github/workflows/rename-icons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
$path = realpath('./');

$di = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
RecursiveIteratorIterator::LEAVES_ONLY
);

foreach ($di as $name => $fio) {
$newname = $fio->getPath() . DIRECTORY_SEPARATOR . strtolower(str_replace(" ","",str_replace("&","-",$fio->getFilename())));
echo $newname, "\r\n";
rename($name, $newname);
}
22 changes: 12 additions & 10 deletions WC_Buckaroo_Settings_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,24 @@ public function render_file_field($value)
value="<?php echo esc_attr($value['value']); ?>"
class="<?php echo esc_attr($value['class']); ?>"
/>
<tr></td>
</td><tr>
<?php
}
public function render_submeniu_field($value)
{
?>
<h2><?php echo esc_html($value['title']); ?></h2>
<tr><td>
<ul class="subsubsub" style="width:100%;margin-bottom:10px">
<?php foreach ($value['links'] as $key => $link) {
$endSlash = $key === count($value['links']) - 1 ? '' : '|';
echo '<li><b><a href="'.esc_url($link['href']).'"> '.esc_html($link['name']).' </a></b>'.esc_html($endSlash);
}
?>
</ul>
<tr></td>
<tr>
<td>
<ul class="subsubsub" style="width:100%;margin-bottom:10px">
<?php foreach ($value['links'] as $key => $link) {
$endSlash = $key === count($value['links']) - 1 ? '' : '|';
echo '<li><b><a href="'.esc_url($link['href']).'"> '.esc_html($link['name']).' </a></b>'.esc_html($endSlash);
}
?>
</ul>
</td>
<tr>
<?php
}
/**
Expand Down
8 changes: 0 additions & 8 deletions assets/js/checkout/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ class BuckarooCheckout {
.parent()
.toggle(jQuery.trim(jQuery(this).val()).length !== 0);
});
/**
* toggle in3 coc & company name if debtor
*/
jQuery("body").on("change", "#buckaroo-in3-orderas", function () {
jQuery(
"#buckaroo-in3-coc-container, #buckaroo-in3-companyname-container"
).toggle(jQuery(this).val().toLowerCase() !== "debtor");
});

/**
* toggle afterpay b2b fields
Expand Down
2 changes: 1 addition & 1 deletion assets/js/dist/checkout.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0ec93eb

Please sign in to comment.