๐ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
๊ฐ์ฅ ๊ฐ๋จํ ๋ฐฉ๋ฒ์ผ๋ก ์์ ฏ์ ์ฌ์ฉํด๋ณด์ธ์.
// ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
const widget = new CryptoPaymentsWidget({
mode: 'window', // ๋๋ 'modal'
debug: true
});
// ์
๊ธ ์์ ฏ ์ด๊ธฐ
await widget.openDeposit('user123');
// ์ถ๊ธ ์์ ฏ ์ด๊ธฐ (์๋ก์ด ํจ์ ์ธํฐํ์ด์ค)
await widget.openWithdrawal('user123', {
minAmount: 10,
maxAmount: 10000,
showBalance: true,
reqWithdraw: async (withdrawalData) => {
// ํํธ๋ ์๋ฒ์์ ์ถ๊ธ ์ฒ๋ฆฌ
const response = await fetch('/api/process-withdrawal', {
method: 'POST',
body: JSON.stringify({ withdrawalData })
});
return response.ok; // ์ฑ๊ณต ์ true ๋ฐํ
}
});
๐ฏ ํฉํ ๋ฆฌ ํจ์ ์ฌ์ฉ๋ฒ
ํธ์ ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ๋ ๊ฐ๋จํ๊ฒ ์์ ฏ์ ์์ฑํ ์ ์์ต๋๋ค.
// ์์ฐฝ ๋ชจ๋ ์์ ฏ
const windowWidget = createCryptoPaymentsWidget.window({
theme: 'light',
debug: true
});
// ๋ชจ๋ฌ ๋ชจ๋ ์์ ฏ
const modalWidget = createCryptoPaymentsWidget.modal({
modalAnimation: true,
modalZIndex: 10000
});
// ์
๊ธ ์ ์ฉ ์์ ฏ
const depositWidget = createCryptoPaymentsWidget.deposit({
mode: 'modal'
});
๐จ ๊ณ ๊ธ ์ค์
์์ธํ ์ฝ๋ฐฑ๊ณผ ์ค์ ์ ํฌํจํ ์์ ฏ ์ฌ์ฉ๋ฒ์
๋๋ค.
const advancedWidget = new CryptoPaymentsWidget({
mode: 'modal',
theme: 'dark',
width: 500,
height: 700,
// ์ฝ๋ฐฑ ํจ์๋ค
onSuccess: (result) => {
console.log('์ฑ๊ณต:', result);
if (result.type === 'deposit') {
alert(`์
๊ธ ์ฃผ์ ์์ฑ: ${result.address}`);
} else if (result.type === 'withdrawal') {
alert(`์ถ๊ธ ์์ฒญ ์๋ฃ: ${result.transactionId}`);
}
},
onError: (error) => {
console.error('์ค๋ฅ:', error);
alert(`์ค๋ฅ ๋ฐ์: ${error.message}`);
},
onClose: () => {
console.log('์์ ฏ์ด ๋ซํ์ต๋๋ค');
}
});
๐ง ์ฒด์ธ/ํ ํฐ ๋ฏธ๋ฆฌ ์ ํ
ํน์ ์ฒด์ธ์ด๋ ํ ํฐ์ ๋ฏธ๋ฆฌ ์ ํํ ์ํ๋ก ์์ ฏ์ ์ด ์ ์์ต๋๋ค.
๐ฏ ํตํ ์ ํ (allowedCurrencies)
ํน์ ํตํ๋ง ์ ํํ ์ ์๋๋ก ์ ํํ ์ ์์ต๋๋ค.
// ํน์ ํตํ๋ง ํ์ฉํ๋ ์์
// 1๏ธโฃ USDT๋ง ํ์ฉ
await widget.openDeposit('user123', {
allowedCurrencies: ['USDT']
});
// 2๏ธโฃ USDC๋ง ํ์ฉ
await widget.openDeposit('user123', {
allowedCurrencies: ['USDC']
});
// 3๏ธโฃ ์คํ
์ด๋ธ์ฝ์ธ๋ง ํ์ฉ
await widget.openDeposit('user123', {
allowedCurrencies: ['USDT', 'USDC']
});
// 4๏ธโฃ ๋ชจ๋ ํตํ ํ์ฉ (๊ธฐ๋ณธ๊ฐ)
await widget.openDeposit('user123', {
allowedCurrencies: null // ๋๋ ์๋ต
});
๐ฐ ๊ธ์ก ๋ฏธ๋ฆฌ ์ค์ ์ถ๊ธ
KRW๋ USD ๊ธ์ก์ ๋ฏธ๋ฆฌ ์ค์ ํ์ฌ ์ถ๊ธ ์์ ฏ์ ์ด ์ ์์ต๋๋ค.
์์ก ์๊ด์์ด ์ค์ ๋ ๊ธ์ก์ผ๋ก ์ถ๊ธ์ด ๊ฐ๋ฅํ๋ฉฐ, ํ์จ์ ์๋์ผ๋ก ๋ณํ๋ฉ๋๋ค.
๐ง ์ฌ์ฉ์ ์ ์ ๊ธ์ก ์ค์
๐ก ํ: ํ์จ์ ์ค์๊ฐ์ผ๋ก ์ ์ฉ๋๋ฉฐ, ํํธ๋๋ณ๋ก ๋ค๋ฅธ ํ์จ ์ ์ฑ
์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
// ๐ฐ ๊ธ์ก ๋ฏธ๋ฆฌ ์ค์ ์ถ๊ธ ์์ (์๋ก์ด ํจ์ ์ธํฐํ์ด์ค)
// 1๏ธโฃ 10,000 KRW โ USDT ์ถ๊ธ (๋ฏธ๋ฆฌ ์ค์ ๋ ๊ธ์ก)
await widget.openWithdrawal('user123', {
presetAmount: 10000,
presetAmountCurrency: 'KRW',
targetCurrency: 'USDT',
minAmount: 1000,
maxAmount: 100000,
dailyLimit: 500000,
showBalance: true,
showFeeInfo: true,
reqWithdraw: async (withdrawalData) => {
// ํํธ๋ ์๋ฒ์์ ์ถ๊ธ ์ฒ๋ฆฌ
const response = await fetch('/api/process-withdrawal', {
method: 'POST',
body: JSON.stringify({ withdrawalData })
});
return response.ok;
}
});
// 2๏ธโฃ 100 USD โ USDC ์ถ๊ธ
await widget.openWithdrawal('user123', {
presetAmount: 100,
presetAmountCurrency: 'USD',
targetCurrency: 'USDC',
minAmount: 10,
maxAmount: 10000,
dailyLimit: 50000,
reqWithdraw: async (withdrawalData) => {
// ํํธ๋ ์๋ฒ์์ ์ถ๊ธ ์ฒ๋ฆฌ
return true; // ์ฑ๊ณต ์ true ๋ฐํ
}
});
// 3๏ธโฃ ์๋ ํตํ ์ ํ (์ฌ์ฉ์๊ฐ UI์์ ์ ํ)
await widget.openWithdrawal('user123', {
presetAmount: 50000,
presetAmountCurrency: 'KRW',
// targetCurrency ์๋ต ์ ์ฌ์ฉ์๊ฐ ์ ํ
reqWithdraw: async (withdrawalData) => {
return true; // ์ฑ๊ณต ์ true ๋ฐํ
}
});
๐ฏ ์ค์ ์ฌ์ฉ ์๋๋ฆฌ์ค
ํํธ๋ ์์คํ
์์ ์ด ๊ธฐ๋ฅ์ ์ด๋ป๊ฒ ํ์ฉํ ์ ์๋์ง ๋ณด์ฌ์ฃผ๋ ์์์
๋๋ค.
๐ฑ ๋ชจ๋ฐ์ผ ์ฑ ์๋๋ฆฌ์ค
์ฌ์ฉ์๊ฐ ์ฑ์์ "10,000์ ์ถ๊ธ" ๋ฒํผ์ ๋๋ ์ ๋:
โ
๊ฐ์ ๋ ๋ฐฉ์ (๊ธ์ก ๋ฏธ๋ฆฌ ์ค์ )
1๋จ๊ณ: ์ฑ์์ 10,000 KRW ์ค์
2๋จ๊ณ: ์ถ๊ธ ์์ ฏ ์ด๊ธฐ
3๋จ๊ณ: ๋คํธ์ํฌ ์ ํ (TRON/BSC/ETH ๋ฑ)
4๋จ๊ณ: ์์ ์ฃผ์ ์
๋ ฅ
5๋จ๊ณ: ์ถ๊ธ ์๋ฃ
๐ ์์ก ๋ถ์กฑํด๋ ์ถ๊ธ ๊ฐ๋ฅ!
๐ ๊ธ์ก ๊ณ์ฐ ๋ถํ์!
โ ๊ธฐ์กด ๋ฐฉ์
1๋จ๊ณ: ์ถ๊ธ ์์ ฏ ์ด๊ธฐ
2๋จ๊ณ: ํตํ ์ ํ (USDT/USDC)
3๋จ๊ณ: ๋คํธ์ํฌ ์ ํ
4๋จ๊ณ: ๊ธ์ก ๊ณ์ฐ ๋ฐ ์
๋ ฅ
5๋จ๊ณ: ์์ก ํ์ธ
6๋จ๊ณ: ์์ ์ฃผ์ ์
๋ ฅ
7๋จ๊ณ: ์ถ๊ธ ์๋ฃ
๐ ์์ก ๋ถ์กฑ์ ์ถ๊ธ ๋ถ๊ฐ
๐ ํ์จ ๊ณ์ฐ ํ์