Skip to content

Commit

Permalink
Merge branch 'main_us' of github.com:xxl4/NexaMerchant into main_us
Browse files Browse the repository at this point in the history
xxl4 committed Jan 13, 2025

Verified

This commit was signed with the committer’s verified signature.
yuyichao Yichao Yu
2 parents 3d0eea0 + 1cf1ccd commit 45a2968
Showing 8 changed files with 566 additions and 49 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -142,6 +142,27 @@ jobs:
cd ${{ secrets.WWW_DIR_US }} && git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_7 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_8 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_9 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_10 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_11 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_12 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
cd ${{ secrets.WWW_DIR_13 }} && sudo git pull
composer dump-autoload
cd storage && sudo chmod -R 777 *
- name: Sync to Server 3 and Do it
uses: appleboy/ssh-action@master
env:
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -72,8 +72,10 @@
"laravel/tinker": "^2.0",
"laravel/ui": "^4.0",
"maatwebsite/excel": "^3.1.46",
"nexa-merchant/apis": "dev-main",
"nexa-merchant/apis": "^2.0.3",
"nexa-merchant/apps": "^1.0",
"nexa-merchant/checkoutcod": "^1.1",
"nexa-merchant/googleplaces": "^1.0",
"nexa-merchant/upselling": "1.0.3",
"paypal/paypal-checkout-sdk": "1.0.2",
"predis/predis": "^2.2",
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script>
// STEP #2: Initialize the Airwallex global context for event communication
Airwallex.init({
env: '<?php echo $app_env;?>', // Setup which Airwallex env('staging' | 'demo' | 'prod') to integrate with
env: '<?php echo $app_env; ?>', // Setup which Airwallex env('staging' | 'demo' | 'prod') to integrate with
origin: window.location.origin, // Setup your event target to receive the browser events message
// components: ['cvc']
});
@@ -85,12 +85,22 @@ function createOrder() {
var data = res;
if (data.result === 200) {
// 获取当前 URL 的查询参数
const queryString = window.location.search;
// 创建 URLSearchParams 对象
const urlParams = new URLSearchParams(queryString);
// 获取参数
const paymentId = urlParams.get('payment_id');
var order_info = data.order;
localStorage.setItem("order_id", order_info.id);
customer_id = localStorage.getItem('cus_id') ? localStorage.getItem('cus_id') : '<?php echo $airwallex_customer_id; ?>';
payment_consent_id = localStorage.getItem('payment_consent_id') ? localStorage.getItem('payment_consent_id') : '';
payment_consent_id = paymentId ? paymentId : '';
<?php if ($payment_airwallex_vault == 1) { ?>
@@ -199,11 +209,20 @@ function createOrder2() {
var data = res;
if (data.result === 200) {
// 获取当前 URL 的查询参数
const queryString = window.location.search;
// 创建 URLSearchParams 对象
const urlParams = new URLSearchParams(queryString);
// 获取参数
const paymentId = urlParams.get('payment_id');
var order_info = data.order;
localStorage.setItem("order_id", order_info.id);
customer_id = localStorage.getItem('cus_id') ? localStorage.getItem('cus_id') : '<?php echo $airwallex_customer_id; ?>';
payment_consent_id = localStorage.getItem('payment_consent_id') ? localStorage.getItem('payment_consent_id') : '';
payment_consent_id = paymentId ? paymentId : '';
<?php if ($payment_airwallex_vault == 1) { ?>
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ function paypalInit() {
function creatPaypalCardButton() {
console.log('creatPaypalCardButton')
let cartId = ''
paypal.Buttons({
style: {
layout: 'horizontal',
@@ -87,16 +88,17 @@ function creatPaypalCardButton() {
console.log('------------------')
console.log(data)
console.log('------------------')
cartId = data.cart.id
if (data.order.statusCode === 200 || data.order.statusCode === 201) {
let order_info = data.order.result;
let cart_info = data.cart;
console.log(order_info)
localStorage.setItem("order_id", order_info.id);
localStorage.setItem("cart_id", cart_info.id);
if (order_info.status === "COMPLETED") {
gotoSuccess(data);
gotoSuccess(data, cartId);
return
}
return order_info.id;
@@ -107,11 +109,11 @@ function creatPaypalCardButton() {
}
}
var pay_error = JSON.parse(data.error);
var pay_error_message = pay_error.details;
var pay_error_message = pay_error.details;
if (pay_error_message && pay_error_message.length) {
alert(pay_error_message)
}
if (pay_error_message && pay_error_message.length) {
alert(pay_error_message)
}
}
}).catch(function(res) {
$('#loading').hide();
@@ -120,18 +122,18 @@ function creatPaypalCardButton() {
// Call your server to finalize the transaction
onApprove: function(data, actions) {
gotoSuccess(data)
gotoSuccess(data, cartId)
}
}).render('#complete-btn-id');
}
function gotoSuccess(data) {
console.log(data, 'id?===')
function gotoSuccess(data, cartId) {
console.log(cartId, 'cartId=====');
$('#loading').show();
var orderData = {
paymentID: localStorage.getItem('order_id'),
orderID: localStorage.getItem('order_id'),
cartId: localStorage.getItem('cart_id'),
cartId: cartId,
};
var paypalParams = {
first_name: shippingAddress.first_name || '',
@@ -149,8 +151,8 @@ function gotoSuccess(data) {
id: localStorage.getItem('order_id'),
orderData: orderData,
data: data,
cart_id: localStorage.getItem('cart_id'),
params: paypalParams
params: paypalParams,
cart_id: cartId
}
var url = "/api/onebuy/order/status?_token={{ csrf_token() }}&currency={{ core()->getCurrentCurrencyCode() }}";
return fetch(url, {
@@ -177,6 +179,7 @@ function gotoSuccess(data) {
function creatPaypalCardButton2() {
console.log('creatPaypalCardButton2')
let cartId = ''
paypal.Buttons({
style: {
layout: 'horizontal',
@@ -216,7 +219,7 @@ function creatPaypalCardButton2() {
}).then(function(res) {
$('#loading').hide();
let data = res;
cartId = data.cart.id
console.log('------------------')
console.log(data)
console.log('------------------')
@@ -225,11 +228,11 @@ function creatPaypalCardButton2() {
let order_info = data.order.result;
console.log(order_info)
localStorage.setItem("order_id", order_info.id);
if (order_info.status === "COMPLETED") {
gotoSuccess(data);
gotoSuccess(data, cartId);
return
}
return order_info.id;
@@ -240,11 +243,11 @@ function creatPaypalCardButton2() {
}
}
var pay_error = JSON.parse(data.error);
var pay_error_message = pay_error.details;
var pay_error_message = pay_error.details;
if (pay_error_message && pay_error_message.length) {
alert(pay_error_message)
}
if (pay_error_message && pay_error_message.length) {
alert(pay_error_message)
}
}
}).catch(function(res) {
$('#loading').hide();
@@ -253,7 +256,7 @@ function creatPaypalCardButton2() {
// Call your server to finalize the transaction
onApprove: function(data, actions) {
gotoSuccess(data)
gotoSuccess(data, cartId)
}
}).render('#complete-btn-id2');
}
10 changes: 9 additions & 1 deletion packages/Nicelizhi/Shopify/src/Console/Commands/Order/Post.php
Original file line number Diff line number Diff line change
@@ -196,6 +196,14 @@ public function postOrder($id, $shopifyStore) {
$line_item = [];
$line_item['variant_id'] = $skuInfo[1];
$line_item ['quantity'] = $product['qty_ordered'];
$line_item ['price'] = $product['price'];
$price_set = [];
$price_set['shop_money'] = [
'amount' => $product['price'],
'currency_code' => $order->order_currency_code
];
$line_item['price_set'] = $price_set;

$q_ty += $product['qty_ordered'];
$line_item ['requires_shipping'] = true;

@@ -345,7 +353,7 @@ public function postOrder($id, $shopifyStore) {
//\Nicelizhi\Shopify\Helpers\Utils::send($str.'--' .$id. " 需要留意查看 ");
//continue;
//return false;
$postOrder['send_receipt'] = false;
$postOrder['send_receipt'] = true;
}else{
$postOrder['send_receipt'] = true;
}
Original file line number Diff line number Diff line change
@@ -696,6 +696,7 @@ public function checkoutCustomerCode($product_id, Request $request) {
'title_activity' => '',
'activity_time' => '', // actiovity time
'activity_title' => '', // activity title
'ad_message' => '', // ad message
];

// foreach codekeys and get date from redis
42 changes: 22 additions & 20 deletions packages/Webkul/Shop/src/Resources/views/emails/layout.blade.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<body style="font-family: inter;">
<div style="max-width: 640px; margin-left: auto; margin-right: auto;">
<div style="padding: 30px;">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>

<body style="font-family: inter;">
<div style="max-width: 640px; margin-left: auto; margin-right: auto;">
<!-- <div style="padding: 30px;">
{{-- Email Header --}}
<div style="margin-bottom: 65px;">
<a href="{{ route('shop.home.index') }}">
@@ -31,20 +32,21 @@
/>
@endif
</a>
</div>
</div> -->

{{-- Email Content --}}
{{ $slot }}
{{-- Email Content --}}
{{ $slot }}

{{-- Email Footer --}}
<p style="font-size: 16px;color: #202B3C;line-height: 24px;">
{{-- Email Footer --}}
<!-- <p style="font-size: 16px;color: #202B3C;line-height: 24px;">
@lang('shop::app.emails.thanks', [
'link' => 'mailto:customer@hatmeo.com',
'email' => 'customer@hatmeo.com',
'style' => 'color: #2969FF;'
])
</p>
</div>
</div>
</body>
</html>
</p> -->
</div>
</div>
</body>

</html>

Large diffs are not rendered by default.

0 comments on commit 45a2968

Please sign in to comment.