Recharging the white-label credit account helps the white label combine its own business characteristics, enabling the white label to achieve unattended credit allocation. By specifying a contract address, calling fund-related APIs, and automating fund recharge and transfer, operational efficiency can be improved.
1.Automatic credit account recharge process
2.Credit account automatic recharge swim lane diagram
3.Credit account automatic recharge interface instructions
3.1 View credit account balance interface:View credit account balance
3.2 Transfer coins to the specified web3 contract address, there are the following methods:
3.2.1 Please refer to the testnet address for direct coin deposit through the blockchain browser:Recharge interface for testing chain specified address
The production environment blockchain browser directly deposits the coin address, provided by PassTo.
3.2.2 To achieve coin transfer through code, the demo is as follows:
// ERC20 ABI
const erc20_abiStr = '[]';
const ERC20_ABI = JSON.parse(erc20_abiStr);
// Contract address
const contractAddress = "0x6A8Acc9BAaC04386f17eD964052968cEcd4D3E0B";
// Contract ABI
const transfer_abiStr = '[]';
const transferABI = JSON.parse(transfer_abiStr);
// Token address
const tokenAddress = "0x43bCA8Fe12a7888224a7e76ec938eD9a29800cE2";
// Amount
const amount = 1;
// OrderId
const orderId = "pk-0404c0021.A908773917";
// transfer
$("#transfer").click(async function () {
const provider = new ethers.BrowserProvider(window.ethereum);
const networkInfo = await provider.getNetwork();
try {
// Create contract instance
const signer = await provider.getSigner();
const contract = new ethers.Contract(
contractAddress,
transferABI,
signer
);
// Get currency decimal places
const baseContract = new ethers.Contract(
tokenAddress,
ERC20_ABI,
signer
);
const decimals = await baseContract.decimals();
// Calculate the payment amount based on decimal places.
const value = mul(amount, pow(10, decimals));
// Check balance
if (lt(balance, value)) {
alert("Insufficient balance");
return;
}
// Get authorized limit
const allowance = await baseContract.allowance(
signer.address,
contractAddress
);
// Determine if the authorized limit is sufficient.
if (lt(allowance, value)) {
const approve = await baseContract.approve(contractAddress, value);
await approve.wait();
}
// Contract transfer
const transfer = await contract.transferToken(
tokenAddress,
value,
orderId
);
const result = await transfer.wait();
} catch (error) {
console.log('error', error)
}
});
Field Description:
contractAddress: Exclusive contract address provided by PassTo, for example: 0x6A8Acc9BAaC04386f17eD964052968cEcd4D3E0B
tokenAddress: Contract address of the token, for example: 0x43bCA8Fe12a7888224a7e76ec938eD9a29800cE2
amount: Additional amount information determined by the customer's additional amount information, such as: 1
orderId: Order information in the format of customer credential.order number, for example: pk-0404c0021.A908773917
Special Instructions:
Customer credential: This credential needs to be provided by PassTo to the white label partner, for example: pk-0404c0021
Order number: Unique order number in the white label business system, not exceeding 50 characters in length. Data that is too long will increase gas fees. For example:A908773917
3.3 The specified web3 contract coin transfer support range
ERC20: USDT、USDC
TRC20: USDT
3.4 Notes
Do not support sending coins directly to a specified contract address through the wallet.
4.Increase credit limit for regular customers:
When the credit automatic recharge is completed and the balance of the credit account is sufficient, it can be used to increase the amount for other regular customers to use for normal credit card consumption. There are several ways in which the credit account can be increased for regular customers.
4.1 Increase the quota for ordinary customers through the management background, see the picture below:
Instructions:
The management backend address and account password are obtained from PassTo.
Operation path:
Credit Management > Client Credit > Pending > Add

