4.1.3
This commit is contained in:
@@ -980,7 +980,7 @@ const handleOfferPaymentCallback = async (req, res) => {
|
||||
const offerPriceToman = amount / 10
|
||||
const receiverShare = Math.round(offerPriceToman * OFFER_COMMISSION_RATE)
|
||||
|
||||
// سهم گیرنده فقط با پاسخگویی ظرف ۲۴ ساعت به اولین پیام دایرکت واریز میشود
|
||||
// سهم گیرنده فقط با پاسخگویی ظرف ۱۲ ساعت به اولین پیام دایرکت واریز میشود
|
||||
// (نگاه کنید به trackOfferMessageForCommission که موقع ارسال پیام صدا زده میشود)
|
||||
const offer = await OfferModel.create({
|
||||
sender: userId,
|
||||
@@ -989,10 +989,18 @@ const handleOfferPaymentCallback = async (req, res) => {
|
||||
pendingCommissionAmount: receiverShare
|
||||
})
|
||||
|
||||
// صفحه/دیپلینکِ موفقیت برای دکمهی «ارسال پیام» به شناسه (و نامکاربریِ) گیرنده
|
||||
// نیاز داره — قبلاً فقط offerId فرستاده میشد و صفحهی وب دنبال یک پارامتر userId
|
||||
// (که هیچوقت ست نمیشد) میگشت، پس همیشه «کاربر یافت نشد» میداد
|
||||
const receiverUser = await UserModel.findById(receiverId).select('user_name')
|
||||
const receiverUsername = receiverUser?.user_name || ''
|
||||
|
||||
return isAndroid
|
||||
? res.redirect(`modstagram://SuccessPay?type=offer&offerId=${offer._id}`)
|
||||
? res.redirect(
|
||||
`modstagram://SuccessPay?type=offer&offerId=${offer._id}&userId=${receiverId}&username=${encodeURIComponent(receiverUsername)}`
|
||||
)
|
||||
: res.redirect(
|
||||
`${process.env.APP_SITE}/offer/payment/success?offerId=${offer._id}`
|
||||
`${process.env.APP_SITE}/offer/payment/success?offerId=${offer._id}&userId=${receiverId}`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user