Anonymous
Какими должны быть Surl и Furl в моем родном SDK Cordova Payu
Сообщение
Anonymous » 11 дек 2025, 13:13
Код: Выделить всё
export default function PayUMoneyPayment({ data }) {
const handlePayuNativeCordovaMobilePay = async () => {
const key = "xyz";
const txnid = "txn_" + Math.random().toString(36).substr(2, 9);
const amount = parseFloat(data.amount).toFixed(2);
const productinfo = data.cartItems[0]?.product_name.replace(/[^a-zA-Z0-9 ]/g, "") + " and others";
const firstname = data.fname;
const email = data.email;
const phone = data.phone;
const udf5 = "ABC";
const cartItems = data.cartItems;
const type = data.type;
const surl= config.CUSTOMER_URL + "/success-web.html?txn_id="+txnid+'&type='+type+'&ctype=web';
const furl= config.CUSTOMER_URL + "/failure-web.html?txn_id="+txnid+'&type='+type+'&ctype=web';
const res = await fetchApi({ amount: amount, txn_id:txnid, cart_items:cartItems, payment_gateway:'payumoney'}, '/create_payu_order');
// 👉 STEP 2: Prepare PayU params
const payUPaymentParams = {
key,
transactionId: txnid,
amount,
productInfo: productinfo,
firstName: firstname,
email,
phone,
udf5,
surl,
furl,
};
const payUCheckoutProConfig = {
showExitConfirmationOnCheckoutScreen: true,
merchantName: "PKJShop",
merchantLogo: "https://pkjshop.in/public/site_images/larges/logo.png",
};
const payUParams = {
payUPaymentParams,
payUCheckoutProConfig,
};
// 👉 STEP 3: Open PayU Native Checkout Screen
try {
window.cordova.plugins.PayUCheckoutProCordova.openCheckoutScreen(
payuResponseCallback,
payUParams
);
} catch (err) {
alert("PayU Error: " + err.message);
console.error(err);
}
};
};
Я всегда получаю сообщение «Ошибка PayU: 'surl должен быть чем-то вроде
https://www.payu.in/txnstatus '»
Я пробовал это со многими форматами URL, такими как «
https://pkjshop.in/success-web.html?txn_id=abc » и «
https://pkjshop.in/failure-web.html?txn_id=abc ». Пробовал и с красивыми URL-адресами. но всегда получаю одну и ту же ошибку.
Подробнее здесь:
https://stackoverflow.com/questions/798 ... ordova-sdk
1765448033
Anonymous
[code]export default function PayUMoneyPayment({ data }) { const handlePayuNativeCordovaMobilePay = async () => { const key = "xyz"; const txnid = "txn_" + Math.random().toString(36).substr(2, 9); const amount = parseFloat(data.amount).toFixed(2); const productinfo = data.cartItems[0]?.product_name.replace(/[^a-zA-Z0-9 ]/g, "") + " and others"; const firstname = data.fname; const email = data.email; const phone = data.phone; const udf5 = "ABC"; const cartItems = data.cartItems; const type = data.type; const surl= config.CUSTOMER_URL + "/success-web.html?txn_id="+txnid+'&type='+type+'&ctype=web'; const furl= config.CUSTOMER_URL + "/failure-web.html?txn_id="+txnid+'&type='+type+'&ctype=web'; const res = await fetchApi({ amount: amount, txn_id:txnid, cart_items:cartItems, payment_gateway:'payumoney'}, '/create_payu_order'); // 👉 STEP 2: Prepare PayU params const payUPaymentParams = { key, transactionId: txnid, amount, productInfo: productinfo, firstName: firstname, email, phone, udf5, surl, furl, }; const payUCheckoutProConfig = { showExitConfirmationOnCheckoutScreen: true, merchantName: "PKJShop", merchantLogo: "https://pkjshop.in/public/site_images/larges/logo.png", }; const payUParams = { payUPaymentParams, payUCheckoutProConfig, }; // 👉 STEP 3: Open PayU Native Checkout Screen try { window.cordova.plugins.PayUCheckoutProCordova.openCheckoutScreen( payuResponseCallback, payUParams ); } catch (err) { alert("PayU Error: " + err.message); console.error(err); } }; }; [/code] Я всегда получаю сообщение «Ошибка PayU: 'surl должен быть чем-то вроде https://www.payu.in/txnstatus'» Я пробовал это со многими форматами URL, такими как «https://pkjshop.in/success-web.html?txn_id=abc» и «https://pkjshop.in/failure-web.html?txn_id=abc». Пробовал и с красивыми URL-адресами. но всегда получаю одну и ту же ошибку. Подробнее здесь: [url]https://stackoverflow.com/questions/79843832/what-should-be-surl-and-furl-in-my-payu-native-cordova-sdk[/url]