Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhquochan committed Mar 8, 2024
0 parents commit a4ebf35
Show file tree
Hide file tree
Showing 13 changed files with 749 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/pint.json export-ignore
/.editorconfig export-ignore
/.github export-ignore
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules
/vendor
/.idea
/.vscode
/.fleet
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Lịch sử thay đổi

Tất cả thay đổi của `fob-vietnam-bank-qr` sẽ được mô tả trong file này

## 1.0.0 - 2024-03-08

- Bản phát hành đầu tiên
- Chúc mừng ngày Quốc Tế Phụ Nữ 8/3 🥳
41 changes: 41 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
MIT License

Copyright (c) Friends Of Botble

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

Bản quyền (c) Friends Of Botble

Giấy phép này được cấp miễn phí cho bất kỳ ai nhận được bản sao của tài liệu này
và các tệp liên quan ("Phần mềm") nhận được để sử dụng, sao chép, sửa đổi,
hợp nhất, xuất bản, phân phối, cấp phép, và/hoặc bán sao chép của Phần mềm,
và cho phép người nhận của Phần mềm thực hiện điều này, dưới điều kiện sau:

Thông báo bản quyền trên và thông cáo này phải được bao gồm trong tất cả
các bản sao hoặc phần quan trọng của Phần mềm.

PHẦN MỀM ĐƯỢC CUNG CẤP "NHƯ VẬY", KHÔNG CÓ BẤT KỲ LOẠI BẢO ĐẢM NÀO, CHỈ RÕ RÀNG
HAY ẨN Ý, BAO GỒM NHƯNG KHÔNG GIỚI HẠN, CÁC BẢO ĐẢM VỀ CHẤT LƯỢNG KINH DOANH,
PHÙ HỢP CHO MỘT MỤC ĐÍCH NHẤT ĐỊNH, VÀ VI PHẠM QUYỀN SỞ HỮU HOẶC SỰ PHẠM TỘI.
TRONG KHÔNG CÓ TRƯỜNG HỢP NÀO TÁC GIẢ HOẶC CHỦ SỞ HỮU BẢN QUYỀN CHỊU TRÁCH
NHIỆM ĐỐI VỚI BẤT KỲ YÊU CẦU, THIỆT HẠI HOẶC PHÁT VÀO, BẤT KỲ TRÁCH NHIỆM PHÁP LÝ,
ĐẶC BIỆT HOẶC TRÁCH NHIỆM NÀO KHÁC, XUẤT PHÁT TỪ HOẶC TRONG CỐT,
HOẶC LIÊN QUAN ĐẾN PHẦN MỀM HOẶC VIỆC SỬ DỤNG HOẶC CÁC GIAO DIỆN VỚI PHẦN MỀM.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Mã QR Chuyển Tiền Ngân Hàng Việt Nam

Plugin này cho phép bạn hiển thị mã QR code chuyển tiền qua các ứng dụng
ngân hàng ở Việt Nam theo tiêu chuẩn của VietQR khi khách hàng chọn hình
thức thanh toán theo dạng chuyển khoản.

Bạn cần cấu hình thông tin tài khoản ngân hàng Việt Nam trong cổng
thanh toán khi sử dụng tính năng này.

![](./screenshot-demo.png)

## Yêu cầu tối thiểu

- Botble core 7.2.3 hoặc cao hơn.

## Cài đặt

### Cài đặt thông qua bảng quản trị

Vào **Bảng quản trị (Admin)** và chọn **Plugins**. Bấm vào nút "Thêm mới (Add new)", tìm kiếm plugin **Mã QR Chuyển Tiền Ngân Hàng Việt Nam** và sau đó bấm vào "Cài đặt (Install)".

### Cài đặt thủ công

1. Bạn có thể tải về các bản phát hình tại đây hoặc trên [Botble Marketplace](https://marketplace.botble.com/products/friendsofbotble/fob-vietnam-bank-qr).
2. Giải nén file nén vào thư mục `platform/plugins`.
3. Vào **Bảng quản trị (Admin)** và chọn **Plugins** và bấm vào nút **Kích hoạt (Activate)**.

## Lịch sử thay đổi

Vui lòng xem [LỊCH SỬ THAY ĐỔI](CHANGELOG.md) để xem chi tiết.

## Bảo mật

Nếu bạn phát hiện bất kỳ vấn đề liên quan đến bảo mật nào, vui lòng gửi email tới [email protected] thay vì sử dụng issues.

## Credits

- [Friends Of Botble](https://github.com/FriendsOfBotble)
- [All Contributors](../../contributors)

## Giấy phép

MIT License (MIT). Vui lòng đọc trong phần [thông tin giấy phép](LICENSE).
11 changes: 11 additions & 0 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "friendsofbotble/fob-vietnam-bank-qr",
"name": "Mã QR Chuyển Tiền Ngân Hàng Việt Nam",
"namespace": "FriendsOfBotble\\VietnamBankQr\\",
"provider": "FriendsOfBotble\\VietnamBankQr\\Providers\\VietnamBankQrServiceProvider",
"author": "Friends Of Botble",
"url": "https://github.com/FriendsOfBotble",
"version": "1.0.0",
"description": "Plugin này dùng để hiển thị mã QR chuyển tiền hay dùng phương thức chuyển khoản ngân hàng Việt Nam.",
"minimum_core_version": "7.2.3"
}
138 changes: 138 additions & 0 deletions resources/views/bank-info.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@

<style>
.fob .fob-title {
margin-bottom: 20px;
margin-top: 40px;
}
.fob .fob-qr-code {
text-align: center;
margin-bottom: 20px;
}
.fob .fob-qr-code figure {
margin-bottom: 15px;
}
.fob .fob-qr-code img {
width: 200px;
height: auto;
margin: 0;
padding: 0;
}
.fob .fob-qr-code figcaption {
margin-top: 10px;
font-size: 14px;
color: #666;
}
</style>

<div class="fob fob-vietnam-bank-qr fob-container">
<h3 class="fob-title">Quét mã QR để thanh toán</h3>
<div class="fob-qr-code">
<figure>
<img src="{{ $imageUrl }}" alt="QR Code">
<figcaption>Sử dụng <strong class="text-danger">Ứng dụng ngân hàng</strong> để quét mã.</figcaption>
</figure>
</div>

<div class="fob-qr-information">
<table class="table table-hover table-striped">
<tr>
<td>Tên Ngân Hàng</td>
<td>
<strong>{{ $bank['short_name'] }} - {{ $bank['name'] }}</strong>
</td>
<td></td>
</tr>
<tr>
<td>Chủ Tài Khoản</td>
<td>
<strong>{{ $bank['account_name'] }}</strong>
</td>
<td></td>
</tr>
<tr>
<td>Số Tài Khoản</td>
<td>
<strong>{{ $bankAccount = $bank['account_number'] }}</strong>
</td>
<td class="text-end" style="width: 80px;">
<a href="javascript:void(0);" rel="nooper" class="ms-2" type="button" data-clipboard="{{ $bankAccount }}" data-bb-toggle="copy">
<x-core::icon name="ti ti-clipboard" />
</a>
</td>
</tr>
<tr>
<td>Nội Dung Chuyển Khoản</td>
<td>
<strong>{{ $bankTransferDescription }}</strong>
</td>
<td class="text-end" style="width: 80px;">
<a href="javascript:void(0);" rel="nooper" class="ms-2" type="button" data-clipboard="{{ $bankTransferDescription }}" data-bb-toggle="copy">
<x-core::icon name="ti ti-clipboard" />
</a>
</td>
</tr>

<tr>
<td>Số Tiền Giao Dịch</td>
<td>
<strong>{{ $formattedOrderAmount = number_format($orderAmount, 0, ',', '.') . '' }}</strong>
</td>
<td class="text-end" style="width: 80px;">
<a href="javascript:void(0);" rel="nooper" class="ms-2" type="button" data-clipboard="{{ $orderAmount }}" data-bb-toggle="copy">
<x-core::icon name="ti ti-clipboard" />
</a>
</td>
</tr>
</table>

<div class="alert alert-warning">
<p>Vui lòng giữ nguyên nội dung chuyển khoản <strong class="text-danger">{{ $bankTransferDescription }}</strong> và nhập đúng số tiền <strong class="text-danger">{{ $formattedOrderAmount }}</strong> để được xác nhận thanh toán trực tuyến.</p>
</div>
</div>
</div>

<script>
document.addEventListener('DOMContentLoaded', function () {
const copyButtons = document.querySelectorAll('[data-bb-toggle="copy"]');
copyButtons.forEach((button) => {
button.addEventListener('click', function (event) {
event.preventDefault();
const textToCopy = this.getAttribute('data-clipboard');
fobCopyToClipboard(textToCopy);
})
})
})
async function fobCopyToClipboard(textToCopy) {
if (navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(textToCopy);
} else {
fobUnsecuredCopyToClipboard(textToCopy);
}
MainCheckout.showSuccess('Sao chép thành công!');
}
function fobUnsecuredCopyToClipboard(textToCopy) {
const textArea = document.createElement('textarea');
textArea.value = textToCopy;
textArea.style.position = 'absolute';
textArea.style.left = '-999999px';
document.body.prepend(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
} catch (error) {
console.error('Unable to copy to clipboard', error);
}
document.body.removeChild(textArea);
}
</script>
Binary file added screenshot-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace FriendsOfBotble\VietnamBankQr;

use Botble\PluginManagement\Abstracts\PluginOperationAbstract;

class Plugin extends PluginOperationAbstract
{
}
Loading

0 comments on commit a4ebf35

Please sign in to comment.