Off Ramp Hiding Receiving Address Page
Explanation:
Through this integration method, it is possible to hide the deposit address page, but it requires a successful ACH deposit notification. Please refer to the following diagram for the process:
Note: Currently, only the following cryptocurrencies are supported for this feature.
crypto | network |
---|---|
USDC | BSC |
USDT | BSC |
ETH | ETH |
USDC | ETH |
USDT | ETH |
MATIC | MATIC |
USDC | MATIC |
USDT | MATIC |
USDC | TRX |
USDT | TRX |
Request Parameters
Parameter | Description | Required |
---|---|---|
appId | Merchant application ID, eg:ahzxh0klegv1fzol | Y |
crypto | Cryptocurrency name, eg:USDT | Y |
network | Network, eg:ETH | Y |
cryptoAmount | Sold cryptocurrency amount | Y |
fiat | Fiat currency code, eg:USD | Y |
country | Country code, eg:US | Y |
callbackUrl | Callback URL for synchronizing order information with the merchant | Y |
withdrawUrl | URL to redirect back to the merchant | Y |
source | Source. Default: 3. Uploading this field will hide the deposit address page | Y |
type | Type, eg:sell | Y |
merchantOrderNo | Merchant's custom order number, eg:1112957819622420480 | Y |
showAddress | Whether to display the address QR code. Optional: Y/N | Y |
merchantName | Merchant name | Y |
urlType | Can only be "app" or "web",representing the type of withdrawUrl the user will be redirected to | Y |
Note: If the
source
parameter is passed, the URL should be appended with #/sell-formUserInfo. This will directly navigate to the bank information filling page without a back button and menu bar. If not passed, it will directly enter the sell coin homepage.
As shown in the following diagram:
Request example:
https://ramp.alchemypay.org?appId=ahzxh0klegv1fzol&crypto=ELF&network=ELF&fiat=USD&country=US&cryptoAmount=100&callbackUrl=https://localhost:9090/test/test&withdrawUrl=www.baidu.com&type=sell&source=3&urlType=web&merchantName=AELF&merchantOrderNo=2134545343544334&showAddress=N#/sell-formUserInfo
Notification parameters
ACH notification
After the user submits the form, an order will be generated, and the order information will be pushed through the callbackUrl
in the merchant's request parameters. Order information will be pushed for every change in order status.
Push parameters:
Parameter | Description | Required |
---|---|---|
orderNo | Order number | Y |
merchantOrderNo | Merchant order number | N |
crypto | Cryptocurrency | Y |
network | Network | Y |
cryptoPrice | Cryptocurrency price | N |
cryptoAmount | Cryptocurrency quantity | Y |
fiatAmount | Fiat currency quantity | N |
appId | Merchant appId | Y |
fiat | Fiat currency code | Y |
txHash | Transaction hash | N |
User email | N | |
status | Order status: 1: Order created successfully, 2: User coin deposit completed, 3: Start payment, 4: Payment successful, 5: Payment failed, 6: Refund successful, 7: Order timeout | Y |
address | Coin deposit address | Y |
cryptoActualAmount | Actual coin deposit quantity | N |
rampFee | Service fee | N |
receiptTime | Payment completed | N |
paymentType | Payment method | Y |
name | User name | Y |
card | Card number | N |
account | Account | N |
orderAddress | Order details page URL | Y |
signature | Signature, refer to "Notification Signature Method" below | Y |
Merchant notification
After the user completes the coin deposit, the merchant needs to push information to ACH.
Request
Path: https://api.alchemypay.org/webhooks/off/merchant
- post
- application/json
IP whitelist configuration is required and can be added in the merchant backend.
Push parameters:
Parameter | Description | Required |
---|---|---|
orderNo | Order number | Y |
crypto | Cryptocurrency | Y |
cryptoAmount | Cryptocurrency quantity | Y |
network | Network | Y |
txHash | Transfer hash | Y |
address | ACH notification, the "address" in the parameters. | Y |
appId | "Merchant appId" | Y |
signature | Signature, refer to "Notification Signature Method" below | Y |
Push example:
{
"orderNo": "string",
"crypto": "string",
"cryptoAmount": "string",
"txHash": "string",
"network": "string",
"address": "string",
"appId": "string",
"sourceAddress": "string",
"signature": "string"
}
Response
Response parameters:
Parameter | Description | Required |
---|---|---|
success | boolean | Y |
returnCode | string | |
returnMsg | string | Y |
extend | string | |
data | object | Y |
Response example:
{
"success": true,
"returnCode": "string",
"returnMsg": "string",
"extend": "string",
"data": {}
}
Notification Signature Method
Concatenated parameters: appId+appSecret+orderNo+crypto+network+address
public class MerSignCheckUtil {
private static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
private static String encode(String algorithm, String value) {
if (value == null) {
return null;
}
try {
MessageDigest messageDigest= MessageDigest.getInstance(algorithm);
messageDigest.update(value.getBytes());
return getFormattedText(messageDigest.digest());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private static String getFormattedText(byte[] bytes) {
int len = bytes.length;
StringBuilder buf = new StringBuilder(len * 2);
for (int j = 0; j < len; j++) {
buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
}
return buf.toString();
}
public static void main(String[] args) {
String appId = "";
String appSecret = "";
String crypto = "";
String orderNo = "";
String network = "";
String address = "";
String rawString = appId + appSecret + orderNo + crypto + network + address;
String sign = encode("sha1", rawString);
}
}
Updated 3 months ago