NAV
Java

onerway V3.0 openAPI v1.0.0

Welcome to the onerway API Reference Guide.

Base URLs:

Signature

SHA256withRSA

Process

  1. Get private key(privateKey);
  2. ALGORITHM selects SHA256withRSA;
  3. Converts the information to be signed in UTF-8 format;
  4. Signs;
  5. Base64 transcoding.

Data to be signed

Sort all parameters whose "Signed" column is "Yes" and not empty according to the ASCII code of the parameter name, and then concatenate the key and value in the way of key=value&key1=value1... (the last parameter does not need &).

For example


1. Private Key

MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDHaM7clWWlJNS6ZR5ZkxSFeMMFt74YGRmYPr67UHrfc4CzFtN9sctIUqZJVv05sfOgnb0rk1G7wx97/LqxPEGs5chc+Nq9HkNf5VopMifOQ85j1Sv1U031oEGk+Oi4MTAR4ZWlLKBQPyKVb5pCP8aIv15GTIiIwJKS17zY5mQUrXzASTDk54DCG9eN4Lgka9xzwRvaYZvmxLg732GxjI5TE797kA5gxY7GxZ0wxdkWkhcee6xX6WWhAcmdHPUUS0EPcnL5wcc3wP07vO+R/jO1XoaXczb6JRh6ApR3Y5VjSFQApqwe7AIgASGf8aSkBU4K95RfZ3QsBjof2SX/3fkfAgMBAAECggEAf5F3NPqGSj3jsVLbNaa4LCLzcIb5n2T/ULxjPGXiFW1I2kkyB2lkiOIG60gxO2WyXABNcsEOOrY7QBCQRq4rvbZKld/F39Kqe4C4Sz6A5J3QPWG0e39NkmNxW165Uox1GhtcpoyECpI5R6xb3SH7mqQCZaq0dffsTPCjKYdKY0bvKPZrC+o8CqadySVzM6cRytvS+ZBjc03eT5MRHH6if1mIIxg8qPnOa2x7iXkq0UibFETqX+1gKZcQ3L9uIaH68t1UJEhjU7BB6YY76kMfZ/IH48iglXKlpcGMfOA7ST5Y81Si5ltsFuyuQ2BprUQ7zF/CDSHGfOA5v/q/tkZxoQKBgQD2by9lTP9JkZ8MvKJvAVpMS+f4zx8eDUFNM/2FA095en7xL5qyx/dXJMF+n4wSa421JcGqeYWN46+hFbnA+7Gv9r8GWDdb9sOKDhITVj9Qwl8KGQZRQJvtPnTygQE5w7GvS+NL/Rnp19iHZJ4IwAgdp2yD64uOFq0SB3x22d+qBwKBgQDPJlZBvgyuTL3z6YNhB3Skc9JDNs/EFSxP8q+hQn5ltsQeROwKot2I66xe0JoEWRpDrjWD9TpbqOg9rmDtPFG7d4matZCsg6hodSSwx7NyJxkI6JGg+ISLylc9LJz/uBmj5u69KDGBIcWIEnktxumuEipLOTSxyaRLDo2CdV7SKQKBgCkaZGpeDFqF+mRSdjlTnW8KXhem3EbT6SdqW4e7BJ97af7qdMALEFstm0R2chOEcu9a69F2UWtYJawVhpUEph92ZWg2gI1LPFQjgqpNAWSD9vwlLmORBjDs8O6dy8mJtXJKkw/SmGbjhI8Yni9RcEkZ6sSaHf3GFHnkW8MrFd4zAoGARFLwwF5e8F5/iKPMoYREBLnu8Bx0CsixBO2W4Cl+Zy4RIaq58Agn6bFR+TP0mNqKvygGnq+TwAfGEhIiBh2PF7YlvNGGFmCWe12n7Gbx2QTsTPPolJ9jmHf0rki4v9+JFXZl6B4Jtf3dmTP+pAqnqLJ1ILqNltZbSiZSpmTwEYECgYB/2Zv8JZ4poDugvvWY8N5e71ptVYljVcddm+BJ+uGgMUofPqoBvz1/hFnjX80CtqzOcxcg6KM+v71gt9qGbe2+483/Axmrwea50UKLqRVH3IXzTOEJth0betqTmbefYFLETn5RXB6MOJQOdzpvvcP305FmtT/grqqcnaeLbosT4A==


2. Data

{ "key":"value", "key2":"value2", "key1":"value2" }


3. Data to be signed

key=value&key1=value2&key2=value2


4. Sign

RcqXuiVp1JpwJedRGzTpL8M5mUsfeHL29gV9ycaJwmDoNV21AiaQ41au2qiJ8h+jKn/KBMcrJAzHGBTO3CZ0ffGxmqNz9fKhZX+X1MTntH+MhtKTyKR4ZF8kbAtezdVgPfqT69NPQGbWo57R3KP0m4W4n2ZjgkxkcG3yYtBdAgsyxDNoT8W0wH7nK7Y0zp88O8wIMe7kfBnK59J4y0Xz2EwiFX+bNkfRhf3U5WiHIU2TdRbaYsnzndmOkYkVdFAiUH7zoXnEn8ZVqiDZkK4eFG9H1LxU55dStug1hLtwxOKlu5OYFUi4iGAiq0Vlir01eDR1++KAudOdb1gcUyH2rA==

Code example


<dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.14</version> </dependency>



package xxx;

import org.apache.commons.codec.binary.Base64;

import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;


public class RSASecureDemo {

  /**
   * signRSA
   *
   * @param privateKey the private key
   * @param toBeSignedData  data to be signed
   * @return sign signature
   */
  public static String signRSA(String privateKey, String toBeSignedData) {
    try {
      byte[] keyBytes = Base64.decodeBase64(privateKey);
      PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
      KeyFactory keyFactory = KeyFactory.getInstance("RSA");
      PrivateKey priKey = keyFactory.generatePrivate(pkcs8KeySpec);
      Signature signature = Signature.getInstance("SHA256withRSA");
      signature.initSign(priKey);
      signature.update(toBeSignedData.getBytes(StandardCharsets.UTF_8));
      return Base64.encodeBase64String(signature.sign());
    } catch (Exception e) {
      throw new RuntimeException("ras sign failed");
    }
  }


  public static void main(String[] args) {

    String privateKey =//"-----BEGIN PRIVATE KEY-----\n" +
      "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDHaM7clWWlJNS6\n" +
        "ZR5ZkxSFeMMFt74YGRmYPr67UHrfc4CzFtN9sctIUqZJVv05sfOgnb0rk1G7wx97\n" +
        "/LqxPEGs5chc+Nq9HkNf5VopMifOQ85j1Sv1U031oEGk+Oi4MTAR4ZWlLKBQPyKV\n" +
        "b5pCP8aIv15GTIiIwJKS17zY5mQUrXzASTDk54DCG9eN4Lgka9xzwRvaYZvmxLg7\n" +
        "32GxjI5TE797kA5gxY7GxZ0wxdkWkhcee6xX6WWhAcmdHPUUS0EPcnL5wcc3wP07\n" +
        "vO+R/jO1XoaXczb6JRh6ApR3Y5VjSFQApqwe7AIgASGf8aSkBU4K95RfZ3QsBjof\n" +
        "2SX/3fkfAgMBAAECggEAf5F3NPqGSj3jsVLbNaa4LCLzcIb5n2T/ULxjPGXiFW1I\n" +
        "2kkyB2lkiOIG60gxO2WyXABNcsEOOrY7QBCQRq4rvbZKld/F39Kqe4C4Sz6A5J3Q\n" +
        "PWG0e39NkmNxW165Uox1GhtcpoyECpI5R6xb3SH7mqQCZaq0dffsTPCjKYdKY0bv\n" +
        "KPZrC+o8CqadySVzM6cRytvS+ZBjc03eT5MRHH6if1mIIxg8qPnOa2x7iXkq0Uib\n" +
        "FETqX+1gKZcQ3L9uIaH68t1UJEhjU7BB6YY76kMfZ/IH48iglXKlpcGMfOA7ST5Y\n" +
        "81Si5ltsFuyuQ2BprUQ7zF/CDSHGfOA5v/q/tkZxoQKBgQD2by9lTP9JkZ8MvKJv\n" +
        "AVpMS+f4zx8eDUFNM/2FA095en7xL5qyx/dXJMF+n4wSa421JcGqeYWN46+hFbnA\n" +
        "+7Gv9r8GWDdb9sOKDhITVj9Qwl8KGQZRQJvtPnTygQE5w7GvS+NL/Rnp19iHZJ4I\n" +
        "wAgdp2yD64uOFq0SB3x22d+qBwKBgQDPJlZBvgyuTL3z6YNhB3Skc9JDNs/EFSxP\n" +
        "8q+hQn5ltsQeROwKot2I66xe0JoEWRpDrjWD9TpbqOg9rmDtPFG7d4matZCsg6ho\n" +
        "dSSwx7NyJxkI6JGg+ISLylc9LJz/uBmj5u69KDGBIcWIEnktxumuEipLOTSxyaRL\n" +
        "Do2CdV7SKQKBgCkaZGpeDFqF+mRSdjlTnW8KXhem3EbT6SdqW4e7BJ97af7qdMAL\n" +
        "EFstm0R2chOEcu9a69F2UWtYJawVhpUEph92ZWg2gI1LPFQjgqpNAWSD9vwlLmOR\n" +
        "BjDs8O6dy8mJtXJKkw/SmGbjhI8Yni9RcEkZ6sSaHf3GFHnkW8MrFd4zAoGARFLw\n" +
        "wF5e8F5/iKPMoYREBLnu8Bx0CsixBO2W4Cl+Zy4RIaq58Agn6bFR+TP0mNqKvygG\n" +
        "nq+TwAfGEhIiBh2PF7YlvNGGFmCWe12n7Gbx2QTsTPPolJ9jmHf0rki4v9+JFXZl\n" +
        "6B4Jtf3dmTP+pAqnqLJ1ILqNltZbSiZSpmTwEYECgYB/2Zv8JZ4poDugvvWY8N5e\n" +
        "71ptVYljVcddm+BJ+uGgMUofPqoBvz1/hFnjX80CtqzOcxcg6KM+v71gt9qGbe2+\n" +
        "483/Axmrwea50UKLqRVH3IXzTOEJth0betqTmbefYFLETn5RXB6MOJQOdzpvvcP3\n" +
        "05FmtT/grqqcnaeLbosT4A==\n"
      //  +"-----END PRIVATE KEY-----"
      ;

    String toBeSignedData = "key=value&key1=value2&key2=value2";
    String sign = signRSA(privateKey, toBeSignedData);
    System.out.println(sign);

  }

}


SHA256

Process

  1. Get the key;
  2. Concatenate the data string to be signed and the key string;
  3. Convert the above string in UTF-8 format;
  4. sha-256 digest;
  5. Convert byte to hexadecimal.

Data to be signed

Sort all parameters whose "Signed" column is "Yes" and not empty according to the ASCII code of the parameter name, and then concatenate the values in the way of vaule1vaule2vaule3...;

For example


1. The Key

3b5e10b65bff4172a5b9ca2d2ec00a6e


2. Data

{ "merchantNo":"800135", "test":"dsaaass1dsag", "bizContent":"yesdas1dsa", "as":"12334567", "bc":"098754" }


3. Data to be signed

12334567098754yesdas1dsa800135dsaaass1dsag


4. Sign

0ce84cc90742e79b3af76da6b6909dc158a2e933057562639fe6a5a8e73f5350

Code example


<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.6</version> </dependency>



package xxx;

import org.apache.commons.lang3.StringUtils;

import java.security.MessageDigest;
import java.util.TreeMap;


public class SHA256SecureDemo {

  public static void main(String[] args) throws Exception{
    TreeMap data = new TreeMap();
    data.put("merchantNo","800135");
    data.put("test","yesdas1dsa");
    data.put("bizContent","dsaaass1dsag");
    data.put("as","12334567");
    data.put("bc","098754");

    String toBeSignedData =strcatValueSign(data);
    String key= "3b5e10b65bff4172a5b9ca2d2ec00a6e";
    String sign= signSha256(key,toBeSignedData);
    System.out.println(sign);

  }

  private static String strcatValueSign(TreeMap treeMap) {
    StringBuffer buffer = new StringBuffer();
    treeMap.forEach((k, v) -> {
      if (StringUtils.isNotBlank(v)) {
        buffer.append(v);
      }
    });
    return buffer.toString();
  }


  public static String signSha256(String key, String toBeSignedData){

    String str=toBeSignedData + key;
    MessageDigest messageDigest;
    String encodestr = "";
    try {
      messageDigest = MessageDigest.getInstance("SHA-256");
      messageDigest.update(str.getBytes("UTF-8"));
      encodestr = byte2Hex(messageDigest.digest());
    } catch (Exception e) {
      e.printStackTrace();
    }
    return encodestr;
  }

  /**
   * Convert byte to hexadecimal
   *
   * @param bytes
   * @return
   */
  private static String byte2Hex(byte[] bytes) {
    StringBuffer stringBuffer = new StringBuffer();
    String temp = null;
    for (int i = 0; i < bytes.length; i++) {
      temp = Integer.toHexString(bytes[i] & 0xFF);
      if (temp.length() == 1) {
        stringBuffer.append("0");
      }
      stringBuffer.append(temp);
    }
    return stringBuffer.toString();
  }

}


Signature Verification

SHA256withRSA

Process

  1. Get public key(publicKey);
  2. ALGORITHM selects SHA256withRSA;
  3. Converts the information to be signed in UTF-8 format;
  4. Signature string base64 decoded;
  5. Signature verification.

Data to be signed

Sort all parameters whose "Signed" column is "Yes" and not empty according to the ASCII code of the parameter name, and then concatenate the key and value in the way of key=value&key1=value1... (the last parameter does not need &).

For example


1. Public Key

MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2jO3JVlpSTUumUeWZMUhXjDBbe+GBkZmD6+u1B633OAsxbTfbHLSFKmSVb9ObHzoJ29K5NRu8Mfe/y6sTxBrOXIXPjavR5DX+VaKTInzkPOY9Ur9VNN9aBBpPjouDEwEeGVpSygUD8ilW+aQj/GiL9eRkyIiMCSkte82OZkFK18wEkw5OeAwhvXjeC4JGvcc8Eb2mGb5sS4O99hsYyOUxO/e5AOYMWOxsWdMMXZFpIXHnusV+lloQHJnRz1FEtBD3Jy+cHHN8D9O7zvkf4ztV6Gl3M2+iUYegKUd2OVY0hUAKasHuwCIAEhn/GkpAVOCveUX2d0LAY6H9kl/935HwIDAQAB


2. Data

{ "key":"value", "key2":"value2", "key1":"value2", "sign":"RcqXuiVp1JpwJedRGzTpL8M5mUsfeHL29gV9ycaJwmDoNV21AiaQ41au2qiJ8h+jKn/KBMcrJAzHGBTO3CZ0ffGxmqNz9fKhZX+X1MTntH+MhtKTyKR4ZF8kbAtezdVgPfqT69NPQGbWo57R3KP0m4W4n2ZjgkxkcG3yYtBdAgsyxDNoT8W0wH7nK7Y0zp88O8wIMe7kfBnK59J4y0Xz2EwiFX+bNkfRhf3U5WiHIU2TdRbaYsnzndmOkYkVdFAiUH7zoXnEn8ZVqiDZkK4eFG9H1LxU55dStug1hLtwxOKlu5OYFUi4iGAiq0Vlir01eDR1++KAudOdb1gcUyH2rA==" }


3. Data to be signed

key=value&key1=value2&key2=value2


4. Verify Result

true

Code example


<dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.14</version> </dependency>



package xxx;

import org.apache.commons.codec.binary.Base64;

import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;


public class RSASecureDemo {

  /**
   * verifyRSA
   *
   * @param publicKey the public key
   * @param toBeSignedData  data to be signed
   * @param sign   signature
   * @return
   */
  public static boolean verifyRSA(String publicKey, String toBeSignedData, String sign) {
    try {
      byte[] keyBytes = Base64.decodeBase64(publicKey);
      X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes);
      KeyFactory keyFactory = KeyFactory.getInstance("RSA");
      PublicKey pubKey = keyFactory.generatePublic(keySpec);
      Signature signature = Signature.getInstance("SHA256withRSA");
      signature.initVerify(pubKey);
      signature.update(toBeSignedData.getBytes(StandardCharsets.UTF_8));
      return signature.verify(Base64.decodeBase64(sign));
    } catch (Exception e) {
      throw new RuntimeException("ras verify failed");
    }
  }


  public static void main(String[] args) {


    String publicKey = //"-----BEGIN PUBLIC KEY-----\n" +
      "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2jO3JVlpSTUumUeWZMU\n" +
        "hXjDBbe+GBkZmD6+u1B633OAsxbTfbHLSFKmSVb9ObHzoJ29K5NRu8Mfe/y6sTxB\n" +
        "rOXIXPjavR5DX+VaKTInzkPOY9Ur9VNN9aBBpPjouDEwEeGVpSygUD8ilW+aQj/G\n" +
        "iL9eRkyIiMCSkte82OZkFK18wEkw5OeAwhvXjeC4JGvcc8Eb2mGb5sS4O99hsYyO\n" +
        "UxO/e5AOYMWOxsWdMMXZFpIXHnusV+lloQHJnRz1FEtBD3Jy+cHHN8D9O7zvkf4z\n" +
        "tV6Gl3M2+iUYegKUd2OVY0hUAKasHuwCIAEhn/GkpAVOCveUX2d0LAY6H9kl/935\n" +
        "HwIDAQAB\n"
      //+ "-----END PUBLIC KEY-----"
      ;

    String toBeSignedData = "key=value&key1=value2&key2=value2";
    String sign = "RcqXuiVp1JpwJedRGzTpL8M5mUsfeHL29gV9ycaJwmDoNV21AiaQ41au2qiJ8h+jKn/KBMcrJAzHGBTO3CZ0ffGxmqNz9fKhZX+X1MTntH+MhtKTyKR4ZF8kbAtezdVgPfqT69NPQGbWo57R3KP0m4W4n2ZjgkxkcG3yYtBdAgsyxDNoT8W0wH7nK7Y0zp88O8wIMe7kfBnK59J4y0Xz2EwiFX+bNkfRhf3U5WiHIU2TdRbaYsnzndmOkYkVdFAiUH7zoXnEn8ZVqiDZkK4eFG9H1LxU55dStug1hLtwxOKlu5OYFUi4iGAiq0Vlir01eDR1++KAudOdb1gcUyH2rA==";
    boolean b = verifyRSA(publicKey, toBeSignedData, sign);
    System.out.println(b);

  }

}


SHA256

Process

  1. Get the key;
  2. Concatenate the data string to be signed and the key string;
  3. Convert the above string in UTF-8 format;
  4. sha-256 digest;
  5. Convert byte to hexadecimal;
  6. verify the signed.

Data to be signed

Sort all parameters whose "Signed" column is "Yes" and not empty according to the ASCII code of the parameter name, and then concatenate the values in the way of vaule1vaule2vaule3...;

For example


1. The Key

3b5e10b65bff4172a5b9ca2d2ec00a6e


2. Data

{ "merchantNo":"800135", "test":"dsaaass1dsag", "bizContent":"yesdas1dsa", "as":"12334567", "bc":"098754", "sign":"0ce84cc90742e79b3af76da6b6909dc158a2e933057562639fe6a5a8e73f5350" }


3. Data to be signed

12334567098754yesdas1dsa800135dsaaass1dsag


4. Verify Result

true

Code example


<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.6</version> </dependency>



package xxx;

import org.apache.commons.lang3.StringUtils;

import java.security.MessageDigest;
import java.util.TreeMap;


public class SHA256SecureDemo {

  public static void main(String[] args) throws Exception{
    TreeMap data = new TreeMap();
    data.put("merchantNo","800135");
    data.put("test","yesdas1dsa");
    data.put("bizContent","dsaaass1dsag");
    data.put("as","12334567");
    data.put("bc","098754");

    String toBeSignedData =strcatValueSign(data);
    String key= "3b5e10b65bff4172a5b9ca2d2ec00a6e";
    String sign= "0ce84cc90742e79b3af76da6b6909dc158a2e933057562639fe6a5a8e73f5350";
    boolean b = verifySha256(key, toBeSignedData, sign);
    System.out.println(b);

  }

  private static String strcatValueSign(TreeMap treeMap) {
    StringBuffer buffer = new StringBuffer();
    treeMap.forEach((k, v) -> {
      if (StringUtils.isNotBlank(v)) {
        buffer.append(v);
      }
    });
    return buffer.toString();
  }


  public static boolean verifySha256(String key, String toBeSignedData ,String sign){
    String sha256 = signSha256(key , toBeSignedData);
    return sha256.equals(sign);
  }



  public static String signSha256(String key, String toBeSignedData){

    String str=toBeSignedData + key;
    MessageDigest messageDigest;
    String encodestr = "";
    try {
      messageDigest = MessageDigest.getInstance("SHA-256");
      messageDigest.update(str.getBytes("UTF-8"));
      encodestr = byte2Hex(messageDigest.digest());
    } catch (Exception e) {
      e.printStackTrace();
    }
    return encodestr;
  }

  /**
   * Convert byte to hexadecimal
   *
   * @param bytes
   * @return
   */
  private static String byte2Hex(byte[] bytes) {
    StringBuffer stringBuffer = new StringBuffer();
    String temp = null;
    for (int i = 0; i < bytes.length; i++) {
      temp = Integer.toHexString(bytes[i] & 0xFF);
      if (temp.length() == 1) {
        stringBuffer.append("0");
      }
      stringBuffer.append(temp);
    }
    return stringBuffer.toString();
  }

}


JS Cashier

Instructions for JS-SDK

1. Import Js files


Method 1: Import a JS file to the page that needs to call the JS interface,Download link: https://v3-doc.pacypay.com/javascripts/pacypay-1.0.2.zip
<script src="pacypay.js"></script>


Method 2: Import in the way of import / require import Pacypay from './pacypay.js' or const Pacypay = require('./pacypay.js')

2. Add a div element block with an id of pacypay_checkout to the desired page as a container embedded in the cashier


<div id='pacypay_checkout'></div>

3. Start calling the 'Submit Order' interface, and after success, use the transactionId returned by the interface and the following method to initialize the JS-SDK


new Pacypay(transactionId, options);

Code example
const transactionId = '1544197674849067008'; //current transaction id const pacypay = new Pacypay(transactionId, { locale: 'zh-cn', // en, zh-cn environment: 'sandbox', // sandbox、production config: { checkoutTheme: 'light', // light, dark customCssURL: '', // Custom style link address, after configuring this value, checkoutTheme is invalid variables: { "colorBackground": "black", // Theme background color "colorPrimary": "red", // Accent colors, such as input box highlighting, cursor color "colorText": "white", // Font color "colorDanger": "#FF1493", // Error message color "borderRadius": "2px", // Enter the box angle "fontSizeBase": "16px", // The base font size, which is scaled according to that baseline "fontFamily": "Arial, sans-serif", // Font style }, // If you want to customize all the styles, just configure 'styles'.No need to pass in 'checkoutTheme', 'customCssURL', 'variables'. // For details, please refer to the 'styles' property description styles: { ".pacypay-checkout__button--pay": { // Pay button style "background-color": "red", }, } }, onPaymentCompleted: function (data) { // Callback method after successful payment const txtInfo = res.data; // Return transaction result details const respCode = res.respCode; // Response code const respMsg = res.respMsg; // Response information if(respCode === '20000') { // respCode 为 20000 Indicates that the transaction is normal switch (txtInfo.status) { // Transaction status judgment case 'S': // status 'S' Indicates success // The final payment status is subject to the asynchronous notification result break; case 'R': // status 'R' Indicates that 3DS authentication is required // When the transaction status is 'R', the merchant needs to redirect to the URL to complete some transactions, including 3DS authentication window.location.href = txtInfo.redirectUrl; break; } } else { // Transaction failed } }, onError: function (err) { // Callback method after abnormal payment console.log(err); } });

Field Description

Attributes Type Required Description
transactionId string Yes The transaction ID obtained by the merchant through the interface
options object No See the following options description for details

options

Attributes Type Required Description
locale string No Language, 'zh-cn', 'en'
environment string No 环境类型,'sandbox',The default is'production'
config object No Configuration items, see the following config description for details
onPaymentCompleted function No Request successful completion callback method
onError function No Request exception callback method

config

Attributes Type Required Description
checkoutTheme string No Theme type, 'light', 'dark'
customCssURL string No Supports custom styles for merchants, the custom style link address can be configured here; after configuration, the checkoutTheme value is invalid
variables object No Customize the accent color, See the variables description below
styles object No Custom styles, See the styles description below
showPayButton boolean No The default is true, if it is set to false, please see 4. Supplementary Instructions

variables

Attributes Type Required Description
colorBackground string No Theme background color
colorPrimary string No Accent colors, such as input box highlighting, cursor color
colorText string No Font color
colorDanger string No Error message color
borderRadius string No Enter the box angle
fontSizeBase string No The base font size, which is scaled according to that baseline
fontFamily string No Font style

styles

Attributes Type Required Description
.pacypay-checkout__payment-method object No Cashier payment method container
.pacypay-checkout_payment-method_header object No Title bar
.pacypay-checkout_payment-methodheader_title object No Title block name
.pacypay-checkout_payment-methodimage_wrapper object No Title bar picture container
.pacypay-checkout_payment-method_brands object No The bank card type container on the right side of the title bar
.pacypay-checkout_payment-method_image object No Title bar picture
.pacypay-checkout_payment-method_brand object No The picture of the bank card on the right side of the title bar
.pacypay-checkout_payment-method_name object No Title block title name
.pacypay-checkout_payment-method_details object No Form content container
.pacypay-checkout__field-wrapper object No Form item container
.pacypay-checkout__field object No The picture of the bank card on the right side of the title bar
.pacypay-checkout_payment-method_brand object No Form items
.pacypay-checkout__field--cardNumber object No Form item - card number
.pacypay-checkout__field--expire object No Form item - expiration time
.pacypay-checkout__field--cvv object No Form Item - CVV
.pacypay-checkout__field--lastName object No Form item -name
.pacypay-checkout__label-text object No Form item title
.pacypay-checkout__label-text--require object No Form item titles are required to identify
.pacypay-checkout__input object No Form item input box
.pacypay-checkout__error-text object No Form item error copy
.pacypay-checkout__button object No Button
.pacypay-checkout__button--pay object No Pay button
.pacypay-checkout_button_text object No Button text
.pacypay-checkout__loading object No Button Loading container
.pacypay-checkout__spinner object No Button Loading animation

4. Supplementary Instructions: When showPayButton is false, at the custom payment button, please call the following method to pay


pacypay.submit();

5. The following are the payment synchronization response parameters, the merchant needs to process the payment result message (the final payment status is subject to the asynchronous notification)

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TxnInfo json object

TxnInfo

Name Type Signed Description
transactionId String Yes The transaction order number created by Onerway,corresponding to the merchant order number
responseTime String Yes Interface response time, the format is yyyy-MM-dd HH:mm:ss
txnTime String Yes Transaction completion time, the format is yyyy-MM-dd HH:mm:ss
txnTimeZone String Yes Transaction completion time zone, for example: +08:00
orderAmount String Yes The amount of the transaction order
orderCurrency String Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
txnAmount String Yes The transaction amount in settlement currency
txnCurrency String Yes The settlement currency. Please refer to ISO 4217 Currency Codes
status String Yes Transaction processing result. Please refer toTxnStatusEnum
redirectUrl String Yes when the transaction status is R, the merchant needs to redirect to this URL to complete part of the transaction, including 3ds verification, local payment cashier and so on
periodValue String No Number of installments
contractId String Yes Subscription contract id , returned when paying for the first subscription
tokenId String Yes Subscription token id , returned when paying for the first subscription
eci String Yes transfer of responsibility
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Submit Order

POST /v1/sdkTxn/doTransaction

Example requests

{
"merchantNo":"800035",
"merchantTxnId":"1654675447527",
"merchantTxnTime":null,
"merchantTxnTimeZone":null,
"productType":"CARD",
"subProductType":"DIRECT",
"txnType":"SALE",
"orderAmount":"22.1",
"orderCurrency":"USD",
"originTransactionId":null,
"risk3dsStrategy":null,
"txnOrderMsg":"{\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"[{\\\"name\\\":\\\"iphone 11\\\",\\\"price\\\":\\\"5300.00\\\",\\\"num\\\":\\\"2\\\",\\\"currency\\\":\\\"CNY\\\"},{\\\"name\\\":\\\"macBook\\\",\\\"price\\\":\\\"1234.00\\\",\\\"num\\\":\\\"1\\\",\\\"currency\\\":\\\"USD\\\"}]\",\"transactionIp\":\"127.0.0.1\",\"appId\":1451012088483221504,\"javaEnabled\":false,\"colorDepth\":\"24\",\"screenHeight\":\"1080\",\"screenWidth\":\"1920\",\"timeZoneOffset\":\"-480\",\"accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\",\"contentLength\":\"340\",\"language\":null}",
"shippingInformation":"{\"firstName\":\"Shipping\",\"lastName\":\"Name\",\"phone\":\"188888888888\",\"email\":\"taoyun15@gmail.com\",\"postalCode\":\"888888\",\"address\":\"Shipping Address Test\",\"country\":\"CN\",\"province\":\"HB\",\"city\":\"WH\",\"street\":\"833 Cheung Sha Wan Road\",\"number\":\"1\",\"identityNumber\":\"82962612865\"}","billingInformation":"{\"firstName\":\"test\",\"lastName\":\"test\",\"phone\":\"18600000000\",\"email\":\"taoyun15@gmail.com\",\"postalCode\":\"430000\",\"address\":\"Unit 1113, 11/F, Tower 2, Cheung Sha Wan Plaza, 833 Cheung Sha Wan Road, Lai Chi Kok\",\"country\":\"CN\",\"province\":\"HB\",\"city\":\"HK\"}",
"sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String 64 Yes Yes Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
merchantTxnTime String / No Yes The time when the merchant transaction order occurred. The format is yyyy-MM-dd HH:mm:ss
merchantTxnTimeZone String 64 No Yes The time zone when the merchant transaction order occurred. For example: +08:00
productType String 16 Yes Yes Product Type, Please refer to ProductTypeEnum
subProductType String 16 Yes Yes Sub product type, Please refer to SubProductTypeEnum
txnType String 16 Yes Yes Transaction type, Please refer to TxnTypeEnum
paymentMode String 16 No Yes Payment mode. Please refer to PaymentModeEnum. Default as WEB
osType String 16 No Yes Operating system type. Please refer to OsTypeEnum. Required when paymentMode is not WEB
orderAmount String 19 Yes Yes The amount of the transaction order
orderCurrency String 8 Yes Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
originTransactionId String 20 No Yes The original transaction order number sourced from Onerway, often used for reverse transactions such as refunds, to find the corresponding forward transaction order number
risk3dsStrategy String 16 No Yes 3ds risk control strategy. Please refer toRisk3dsStrategyEnum
subscription String / No Yes Subscription information required for subscription payment. The format is json string. Please refer to Subscription object
mpiInfo String / No Yes Mpi information, 3ds verification result set, required when risk3dsStrategy is EXTERNAL. The format is json string. Please refer to MpiInfo object
txnOrderMsg String / No Yes Transaction business information, required except for subscription payment repurchase. The format is json string. Please refer to TxnOrderMsg object
billingInformation String / No Yes Transaction billing information, required except for subscription payment repurchase. The format is json string. Please refer to TransactionAddress object
shippingInformation String / No Yes Transaction mailing information, required except for subscription payment repurchase. The format is json string. Please refer to TransactionAddress object
lpmsInfo String / No Yes Local payment method information, required when product type is LPMS, The format is json string. Please refer to LpmsInfo object
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

TxnOrderMsg

Name Type Length Required Signed Description
returnUrl String 256 Yes No The URL of the merchant's side
products String 1024 Yes No Product information list. The format is json string. For example:[{"name":"iphone11","price":"5300.00","num":"2","currency":"CNY"}, {"name":"macBook","price":"1234.00","num":"1","currency":"USD"}]
transactionIp String 64 Yes No The transaction IP of the cardholder
appId String 20 Yes No Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant
javaEnabled Boolean / No No The cardholder's browser enable java or not
colorDepth String 64 No No The cardholder's screen color depth
screenHeight String 64 No No The cardholder's screen resolution
screenWidth String 64 No No The cardholder's screen resolution
timeZoneOffset String 64 No No The time zone of the cardholder's browser
accept String 2048 No No The Accept request header of the cardholder's browser
userAgent String 2048 No No the cardholder's browser type
contentLength String 64 No No The content length other than content length header of the cardholder's browser
language String 64 No No The language of the cardholder's browser
periodValue String / No No Number of installments. Required when subProductType is INSTALLMENT.

TransactionAddress

Name Type Length Required Signed Description
firstName String 64 No No The first name
lastName String 64 No No The laset name
phone String 32 No No Phone number
email String 256 Yes No Email
postalCode String 32 No No Postal code
address String 256 No No address
country String 64 Yes No Country. Please refer to ISO. For example: the United States is US
province String 64 No No State. Required when the country is the United States (US) or Canada (CA). Please refer to ISO. For example: American Samoa is AS
city String 64 No No city
street String 64 No No street
number String 64 No No house number
identityNumber String 64 No No ID number
birthDate String 64 No No date of birth, the format is yyyy/MM/dd

Subscription

Name Type Length Required Signed Description
requestType String 1 Yes No Subscription request Type. The enum is as follows: 0 - first purchase 1 - repurchase
merchantCustId String 50 No No Merchant customer id, required when requestType is 0.
expireDate String 10 No No Expiration date, required when requestType is 0. The format is yyyy-MM-dd
frequencyType String 1 No No Subscription frequency type, required when requestType is 0. The enum is as follows: D - day
frequencyPoint String 2 No No Subscription frequency point, required when requestType is 0.
contractId String 20 No No Subscription contract id, required when requestType is 1.
tokenId String 300 No No Subscription token id, required when requestType is 1.

MpiInfo

Name Type Length Required Signed Description
eci String 2 Yes No transfer of responsibility
cavv String 128 Yes No Created by issuer
xid String 128 No No 3D-Secure v1 version Mpi transaction id (choose one of dsTransID to fill in)
dsTransID String 128 No No 3D-Secure v2 version Mpi transaction id (choose one of xid to fill in)

LpmsInfo

Name Type Length Required Signed Description
lpmsType String 64 Yes No Local payment method. Please refer to LpmsTypeEnum
bankName String 128 No No Bank name, required for some payment methods
iBan String 64 No No Bank account, required for transfer in some areas

Example responses

{
  "respCode":"20000",
  "respMsg":"Success",
  "data":{
    "transactionId":"1534446161027346432",
    "responseTime": "2022-07-08 11:22:31",
    "txnTimeZone": "+08:00",
    "status":"U",
    "sign":"..."
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TxnInfo json object

TxnInfo

Name Type Signed Description
transactionId String Yes The transaction order number created by Onerway,corresponding to the merchant order number
responseTime String Yes Interface response time, the format is yyyy-MM-dd HH:mm:ss
txnTimeZone String Yes Transaction completion time zone, for example: +08:00
status String Yes Transaction processing result. Please refer toTxnStatusEnum
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Update Order

POST /v1/sdkTxn/updateOrder

Example requests

{
"merchantNo":"800035",
"merchantTxnId":"1654675447527",
"transactionId":"1534446161027346432",
"orderAmount":"20",
"sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String 64 No Yes Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions. required at least one of transactionId and merchantTxnId
transactionId String 20 No Yes The transaction order number created by Onerway,corresponding to the merchant order number. required at least one of transactionId and merchantTxnId
orderAmount String 19 No Yes The transaction order amount that needs to be modified.
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode":"20000",
  "respMsg":"Success",
  "data":{
    "transactionId":"1534446161027346432",
    "sign":"..."
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TxnInfo json object

TxnInfo

Name Type Signed Description
transactionId String Yes The transaction order number created by Onerway,corresponding to the merchant order number
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Cashier Payment

Cashier Payment

POST /txn/payment

Example requests

{
  "billingInformation":"{\"country\":\"US\",\"email\":\"test@qq.com\"}",
  "merchantNo":"800037",
  "merchantTxnId":"1654675447527",
  "merchantTxnTime":"2022-03-08 16:04:07",
  "merchantTxnTimeZone":"+08:00",
  "orderAmount":"35",
  "orderCurrency":"USD",
  "productType":"CARD",
  "shippingInformation":"{\"country\":\"US\",\"email\":\"test@qq.com\"}",
  "subProductType":"DIRECT",
  "txnOrderMsg":"{\"appId\":\"1458672763818790912\",\"returnUrl\":\"http://v1-demo.test.com/\",\"products\":\"[{\\\"price\\\":\\\"110.00\\\",\\\"num\\\":\\\"1\\\",\\\"name\\\":\\\"iphone11\\\",\\\"currency\\\":\\\"USD\\\"}]\"}",
  "txnType":"SALE",
  "sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String 64 Yes Yes Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
merchantTxnTime String / No Yes The time when the merchant transaction order occurred. The format is yyyy-MM-dd HH:mm:ss
merchantTxnTimeZone String 64 No Yes The time zone when the merchant transaction order occurred. For example: +08:00
productType String 16 Yes Yes Product Type, Please refer to ProductTypeEnum
subProductType String 16 Yes Yes Sub product type, Please refer to SubProductTypeEnum
txnType String 16 Yes Yes Transaction type, Please refer to TxnTypeEnum
orderAmount String 19 Yes Yes The amount of the transaction order
orderCurrency String 8 Yes Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
subscription String / No Yes Subscription information required for subscription payment. The format is json string. Please refer to Subscription object
mpiInfo String / No Yes Mpi information, 3ds verification result set, required when risk3dsStrategy is EXTERNAL. The format is json string. Please refer to MpiInfo object
txnOrderMsg String / No Yes Transaction business information, required except for subscription payment repurchase. The format is json string. Please refer to TxnOrderMsg object
billingInformation String / No Yes Transaction billing information, required except for subscription payment repurchase. The format is json string. Please refer to TransactionAddress object
shippingInformation String / No Yes Transaction mailing information, required except for subscription payment repurchase. The format is json string. Please refer to TransactionAddress object
lpmsInfo String / No Yes Local payment method information, required when product type is LPMS, The format is json string. Please refer to LpmsInfo object
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

TxnOrderMsg

Name Type Length Required Signed Description
returnUrl String 256 Yes No The URL of the merchant's side
products String 1024 Yes No Product information list. The format is json string. For example:[{"name":"iphone11","price":"5300.00","num":"2","currency":"CNY"}, {"name":"macBook","price":"1234.00","num":"1","currency":"USD"}]
appId String 20 Yes No Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant

TransactionAddress

Name Type Length Required Signed Description
firstName String 64 No No The first name
lastName String 64 No No The laset name
phone String 32 No No Phone number
email String 256 Yes No Email
postalCode String 32 No No Postal code
address String 256 No No address
country String 64 Yes No Country. Please refer to ISO. For example: the United States is US
province String 64 No No State. Required when the country is the United States (US) or Canada (CA). Please refer to ISO. For example: American Samoa is AS
city String 64 No No city
street String 64 No No street
number String 64 No No house number
identityNumber String 64 No No ID number
birthDate String 64 No No date of birth, the format is yyyy/MM/dd

Subscription

Name Type Length Required Signed Description
requestType String 1 Yes No Subscription request Type. The enum is as follows: 0 - first purchase, Cashier only supports first purchase.
merchantCustId String 50 No No Merchant customer id, required when requestType is 0.
expireDate String 10 No No Expiration date, required when requestType is 0. The format is yyyy-MM-dd
frequencyType String 1 No No Subscription frequency type, required when requestType is 0. The enum is as follows: D - day
frequencyPoint String 2 No No Subscription frequency point, required when requestType is 0.

MpiInfo

Name Type Length Required Signed Description
eci String 2 Yes No transfer of responsibility
cavv String 128 Yes No Created by issuer
xid String 128 No No 3D-Secure v1 version Mpi transaction id (choose one of dsTransID to fill in)
dsTransID String 128 No No 3D-Secure v2 version Mpi transaction id (choose one of xid to fill in)

LpmsInfo

Name Type Length Required Signed Description
lpmsType String 64 Yes No Local payment method. Please refer to LpmsTypeEnum
bankName String 128 No No Bank name, required for some payment methods
iBan String 64 No No Bank account, required for transfer in some areas

Example responses

{
  "respCode":"20000",
  "respMsg":"Success",
  "data":{
    "transactionId":"1534446161027346432",
    "merchantTxnId":"1654675447527",
    "merchantNo":"800037",
    "responseTime":"",
    "txnTime":"",
    "orderAmount":"35.00",
    "orderCurrency":"USD",
    "txnAmount":"",
    "txnCurrency":null,
    "txnTimeZone":null,
    "status":"U",
    "reason":null,
    "redirectUrl":"https://test-v3-checkout.ronhan.com/checkout/67c32c03db894932a97c05f9d9068a64",
    "sign":"..."
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TxnInfo json object

TxnInfo

Name Type Signed Description
transactionId String Yes The transaction order number created by Onerway,corresponding to the merchant order number
merchantNo String Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String Yes Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
responseTime String Yes Interface response time, the format is yyyy-MM-dd HH:mm:ss
txnTime String Yes Transaction completion time, the format is yyyy-MM-dd HH:mm:ss
txnTimeZone String Yes Transaction completion time zone, for example: +08:00
orderAmount String Yes The amount of the transaction order
orderCurrency String Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
txnAmount String Yes The transaction amount in settlement currency
txnCurrency String Yes The settlement currency. Please refer to ISO 4217 Currency Codes
status String Yes Transaction processing result. Please refer toTxnStatusEnum
reason String Yes Reason for transaction failure
redirectUrl String Yes When the transaction status is U, the merchant needs to be redirected to this to open the cashier page(url needs to be decoded by URLDecoder)
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

API Payment

Consult Payment

POST /v1/txn/consultPaymentMethod

Example requests

{
  "merchantNo": "800037",
  "appId":"1514185267394957312",
  "country":"PH",
  "orderAmount":"0.2",
  "orderCurrency":"USD",
  "sign": "..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
appId String 20 Yes Yes Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant
country String 64 Yes Yes Country. Please refer to ISO. For example: the United States is US
paymentMode String 16 No Yes Payment mode. Please refer to PaymentModeEnum. Default as WEB
osType String 16 No Yes Operating system type. Please refer to OsTypeEnum. Required when paymentMode is not WEB
orderAmount String 19 Yes Yes The amount of the transaction order
orderCurrency String 8 Yes Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode":"20000",
  "respMsg":"Success",
  "data":[
    {
      "productType":"CARD",
      "paymentMethod":"AE",
      "paymentMethodDetail":null
    },
    {
      "productType":"CARD",
      "paymentMethod":"MASTERCARD",
      "paymentMethodDetail":null
    },
    {
      "productType":"CARD",
      "paymentMethod":"VISA",
      "paymentMethodDetail":null
    },
    {
      "productType":"LPMS",
      "paymentMethod":"Alipay+",
      "paymentMethodDetail":{
        "paymentMethodName":"Alipay+",
        "logos":[
          {
            "logoName": "AlipayPlus",
            "logoUrl": "https://cdn.marmot-cloud.com/storage/aplus-checkout-prod/icon/prod/CONNECT_WALLET.png",
            "logoPattern": "default",
            "logoWidth": "810",
            "logoHeight": "190"
          }
        ],
        "promoNames": [
          "{\"en_US\":\"RM1 Voucher\", \"zh_CN\":\"1 元 红包\"}"
        ]
      }
    }
  ]
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data List No Response data. Please refer to PaymentMethod json object

PaymentMethod

Name Type Signed Description
productType String No Product Type, Please refer to ProductTypeEnum
paymentMethod String No The specific payment method, including card type and local payment type
paymentMethodDetail Map No Payment method details, Please refer to PaymentMethodDetail json object

PaymentMethodDetail

Name Type Signed Description
paymentMethodName String No Payment method brand name
logos List No Payment method logos information. Please refer to Logo json object
promoNames List No List of the promotion names. The key is the languages, such as en_US, while the value is the promotion name, such as RM1 Voucher. The format is json string.
Commonly used values of the languages include:
zh_CN: Simplified Chinese
zh_HK: Traditional Chinese
en_US: English
ko_KR: Korean
fil_PH: Filipino
ms_MY: Malay
id_ID: Indonesian
th_TH: Thai

Logo

Name Type Signed Description
logoName String No The logo name
logoUrl String No The logo URL
logoPattern String No The pattern of the logo. This parameter corresponds to the name of the logo that is specified by the merchant
logoWidth String No The width of the logo. Unit: px
logoHeight String No The height of the logo. Unit: px

Bind Card

POST /v1/txn/bindCard

Example requests

{
  "merchantNo":"800037",
  "appId":"1458672763818790912",
  "merchantCustId":"custId_1640247522000",
  "cardInfo":"{\"cardNumber\":\"4000027891380961\",\"cvv\":\"789\",\"month\":\"12\",\"year\":\"2022\",\"holderName\":\"CL BRW2\"}",
  "email":"shipping@test.com",
  "country":"US",
  "transactionIp":"127.0.0.1",
  "sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
appId String 20 Yes Yes Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant
merchantCustId String 50 Yes Yes Merchant's customer id
cardInfo String / Yes Yes Transaction card information of merchant's customer , The format is json string. Please refer to TxnCardInfo object
email String 256 Yes Yes The email of merchant's customer
country String 64 Yes Yes The country of merchant's customer. Please refer to ISO. For example: the United States is US
transactionIp String 64 Yes Yes The transaction IP of merchant's customer
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

TxnCardInfo

Name Type Length Required Signed Description
holderName String 64 Yes No The cardholder's Name
cardNumber String 128 Yes No The cardholder's card number
month String 64 Yes No The month of card number, for example: 03
year String 64 Yes No The year of card number, for example: 2021
cvv String 64 Yes No The cvv of card number

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1573856617225345201",
    "tokenId": "2a6f9b7720403a161860b6cc9e2121e3bf0e2c59bad870501e51233ce7f34f6a",
    "sign": "..."
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TokenInfo json object

TokenInfo

Name Type Signed Description
transactionId String Yes The transaction order number created by Onerway
tokenId String Yes Token id
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

API Payment

POST /v1/txn/doTransaction

Example requests

{
  "//": "Direct card payment",
  "merchantNo": "800037",
  "merchantTxnId": "1640229747000",
  "merchantTxnTime": "2021-12-22 15:30:30",
  "merchantTxnTimeZone": "+08:00",
  "productType": "CARD",
  "subProductType": "DIRECT",
  "txnType": "SALE",
  "orderAmount": "20",
  "orderCurrency": "USD",
  "txnOrderMsg": "{\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"test\",\"transactionIp\":\"127.0.0.1\",\"appId\":1458672763818790912,\"javaEnabled\":false,\"colorDepth\":\"24\",\"screenHeight\":\"1080\",\"screenWidth\":\"1920\",\"timeZoneOffset\":\"-480\",\"accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\",\"contentLength\":\"340\",\"language\":\"zh-CN\"}",
  "cardInfo": "{\"cardNumber\":\"4000027891380961\",\"cvv\":\"789\",\"month\":\"12\",\"year\":\"2022\",\"holderName\":\"test sandbox\"}",
  "shippingInformation": "{\"firstName\":\"ShippingFirstName\",\"lastName\":\"ShippingLastName\",\"phone\":\"188888888888\",\"email\":\"shipping@test.com\",\"postalCode\":\"888888\",\"address\":\"ShippingAddress\",\"country\":\"CN\",\"province\":\"SH\",\"city\":\"SH\",\"street\":\"lujiazui\",\"number\":\"1\",\"identityNumber\":\"110000\"}",
  "billingInformation": "{\"firstName\":\"billingFirstName\",\"lastName\":\"billingLastName\",\"phone\":\"18600000000\",\"email\":\"billing@test.com\",\"postalCode\":\"430000\",\"address\":\"BillingAddress\",\"country\":\"CN\",\"province\":\"HK\",\"city\":\"HK\",\"street\":\"jianshazui\",\"number\":\"2\",\"identityNumber\":\"220000\"}",
  "sign": "..."
}

{
  "//": "Subscription first purchase",
  "merchantNo":"800037",
  "merchantTxnId":"1640247522000",
  "merchantTxnTime":"2021-12-22 15:30:30",
  "merchantTxnTimeZone":"+08:00",
  "productType":"CARD",
  "subProductType":"SUBSCRIBE",
  "txnType":"SALE",
  "orderAmount":"200",
  "orderCurrency":"USD",
  "txnOrderMsg":"{\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"test\",\"transactionIp\":\"127.0.0.1\",\"appId\":1458672763818790912,\"javaEnabled\":false,\"colorDepth\":\"24\",\"screenHeight\":\"1080\",\"screenWidth\":\"1920\",\"timeZoneOffset\":\"-480\",\"accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\",\"contentLength\":\"340\",\"language\":\"zh-CN\"}",
  "cardInfo":"{\"cardNumber\":\"4000027891380961\",\"cvv\":\"789\",\"month\":\"12\",\"year\":\"2022\",\"holderName\":\"CL BRW2\"}",
  "shippingInformation":"{\"firstName\":\"ShippingFirstName\",\"lastName\":\"ShippingLastName\",\"phone\":\"188888888888\",\"email\":\"shipping@test.com\",\"postalCode\":\"888888\",\"address\":\"Shipping Address\",\"country\":\"CN\",\"province\":\"SH\",\"city\":\"SH\",\"street\":\"lujiazui\",\"number\":\"1\",\"identityNumber\":\"110000\"}",
  "billingInformation":"{\"firstName\":\"billingFirstName\",\"lastName\":\"billingLastName\",\"phone\":\"18600000000\",\"email\":\"billing@test.com\",\"postalCode\":\"430000\",\"address\":\"Billing Address\",\"country\":\"CN\",\"province\":\"HK\",\"city\":\"HK\",\"street\":\"jianshazui\",\"number\":\"2\",\"identityNumber\":\"220000\"}",
  "subscription":"{\"merchantCustId\":\"custId_1640247522000\",\"requestType\":\"0\",\"expireDate\":\"2022-11-11\",\"frequencyType\":\"D\",\"frequencyPoint\":1}",
  "sign":"..."
}

{
  "//": "Subscription repurchase",
  "merchantNo": "800037",
  "merchantTxnId": "1640323631000",
  "merchantTxnTime":"2021-12-22 15:30:30",
  "merchantTxnTimeZone":"+08:00",
  "productType":"CARD",
  "subProductType":"SUBSCRIBE",
  "txnType": "SALE",
  "orderAmount": "163",
  "orderCurrency": "USD",
  "txnOrderMsg":"{\"products\":\"test\"}",
  "cardInfo": null,
  "shippingInformation": null,
  "billingInformation":null,
  "subscription":"{\"requestType\":\"1\",\"tokenId\":\"2a6f9b7720403a161860b6cc9e2121e3bf0e2c59bad870501e51233ce7f34f6a\",\"contractId\":\"1473942457062490112\"}",
  "sign":"..."
}

{
  "//": "Local payment",
  "merchantNo": "800037",
  "merchantTxnId": "1646043155000",
  "merchantTxnTime":"2022-02-28 15:30:30",
  "merchantTxnTimeZone":"+08:00",
  "productType":"LPMS",
  "subProductType":"DIRECT",
  "txnType": "SALE",
  "orderAmount": "20",
  "orderCurrency":  "BRL",
  "txnOrderMsg": "{\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"[{\\\"name\\\":\\\"iphone 11\\\",\\\"price\\\":\\\"5300.00\\\",\\\"num\\\":\\\"2\\\",\\\"currency\\\":\\\"CNY\\\"}]\",\"transactionIp\":\"2600:1700:f0f1:1e30:d08f:c6da:976c:45cd\",\"appId\":1493520562615545856}",
  "lpmsInfo":"{\"lpmsType\":\"Boleto\",\"bankName\":\"\",\"iban\":\"\"}",
  "shippingInformation":"{\"firstName\":\"da\",\"lastName\":\"xiong\",\"phone\":\"8522847000\",\"email\":\"shipping@example.com\",\"postalCode\":\"123456\",\"address\":\"HHHEEII\",\"country\":\"MY\",\"province\":\"BABA\",\"city\":\"BALALA\",\"street\":\"1010\",\"number\":\"20-1202\",\"identityNumber\":\"11112223333\",\"birthDate\":\"2020/12/28\"}",
  "billingInformation":"{\"firstName\":\"José\",\"lastName\":\"Silva\",\"phone\":\"8522847035\",\"email\":\"jose@example.com\",\"postalCode\":\"61919-230\",\"address\":\"Rua E\",\"country\":\"BR\",\"province\":\"CE\",\"city\":\"Maracanaú\",\"street\":\"1040\",\"identityNumber\":\"853.513.468-93\",\"birthDate\":\"2000/12/20\"}",
  "sign":"..."
}

{
  "//": "Local payment for Alipay+",
  "merchantNo": "800037",
  "merchantTxnId": "1648711802000",
  "merchantTxnTime":"2022-03-31 15:30:00",
  "merchantTxnTimeZone":"+08:00",
  "productType":"LPMS",
  "subProductType":"DIRECT",
  "txnType": "SALE",
  "orderAmount": "2",
  "orderCurrency":  "CNY",
  "txnOrderMsg": "{\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"[{\\\"name\\\":\\\"iphone 11\\\",\\\"price\\\":\\\"5300.00\\\",\\\"num\\\":\\\"2\\\",\\\"currency\\\":\\\"CNY\\\"}]\",\"transactionIp\":\"127.0.0.1\",\"appId\":1509428893066776576}",
  "lpmsInfo":"{\"lpmsType\":\"Alipay+\",\"bankName\":\"\",\"iban\":\"\"}",
  "shippingInformation": "{\"email\":\"shipping@test.com\",\"country\":\"CN\"}",
  "billingInformation":  "{\"firstName\":\"José\",\"lastName\":\"Silva\",\"phone\":\"8522847035\",\"email\":\"customer@email\",\"country\":\"CN\"}",
  "sign":"..."
}

{
  "//": "token payment",
  "merchantNo":"800037",
  "merchantTxnId":"16402473654230",
  "merchantTxnTime":"2022-07-12 17:39:30",
  "merchantTxnTimeZone":"+08:00",
  "productType":"CARD",
  "subProductType":"TOKEN",
  "txnType":"SALE",
  "orderAmount":"200",
  "orderCurrency":"USD",
  "txnOrderMsg":"{\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"test\",\"transactionIp\":\"127.0.0.1\",\"appId\":1458672763818790912,\"javaEnabled\":false,\"colorDepth\":\"24\",\"screenHeight\":\"1080\",\"screenWidth\":\"1920\",\"timeZoneOffset\":\"-480\",\"accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\",\"contentLength\":\"340\",\"language\":\"zh-CN\"}",
  "shippingInformation":"{\"firstName\":\"ShippingFirstName\",\"lastName\":\"ShippingLastName\",\"phone\":\"188888888888\",\"email\":\"shipping@test.com\",\"postalCode\":\"888888\",\"address\":\"Shipping Address\",\"country\":\"CN\",\"province\":\"SH\",\"city\":\"SH\",\"street\":\"lujiazui\",\"number\":\"1\",\"identityNumber\":\"110000\"}",
  "billingInformation":"{\"firstName\":\"billingFirstName\",\"lastName\":\"billingLastName\",\"phone\":\"18600000000\",\"email\":\"billing@test.com\",\"postalCode\":\"430000\",\"address\":\"Billing Address\",\"country\":\"CN\",\"province\":\"HK\",\"city\":\"HK\",\"street\":\"jianshazui\",\"number\":\"2\",\"identityNumber\":\"220000\"}",
  "tokenInfo":"{\"tokenId\":\"2a6f9b7720403a161860b6cc9e2121e3bf0e2c59bad870501e51233ce7f34f6a\"}",
  "sign":"..."  
}

{
  "//": "offline payment (user payment code)",
  "merchantNo":"800058",
  "merchantTxnId":"16402473654231",
  "merchantTxnTime":"2022-8-12 17:51:24",
  "merchantTxnTimeZone":"+08:00",
  "productType":"PAYMENT_CODE",
  "subProductType":"DIRECT",
  "txnType":"SALE",
  "orderAmount":"10.1",
  "orderCurrency":"CNY",
  "lpmsInfo":"{\"bankName\":\"banco_agrario\",\"lpmsType\":\"Alipay+\",\"iban\":\"02\",\"walletAccountId\":\"281666025563970651556390\"}",
  "risk3dsStrategy":"",
  "txnOrderMsg":"{\"terminalId\":\"122222\",\"returnUrl\":\"https://www.ronhan.com/\",\"products\":\"[{\\\"name\\\":\\\"iphone 11\\\",\\\"price\\\":\\\"5300.00\\\",\\\"num\\\":\\\"2\\\",\\\"currency\\\":\\\"CNY\\\"},{\\\"name\\\":\\\"macBook\\\",\\\"price\\\":\\\"1234.00\\\",\\\"num\\\":\\\"1\\\",\\\"currency\\\":\\\"USD\\\"}]\",\"transactionIp\":\"127.0.0.1\",\"appId\":1559440595840868352,\"javaEnabled\":false,\"colorDepth\":\"24\",\"screenHeight\":\"1080\",\"screenWidth\":\"1920\",\"timeZoneOffset\":\"-480\",\"accept\":\"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\",\"userAgent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\",\"contentLength\":\"340\",\"language\":null}",
  "shippingInformation":"{\"firstName\":\"Shipping\",\"lastName\":\"Name\",\"phone\":\"188888888888\",\"email\":\"taoyun15@gmail.com\",\"postalCode\":\"888888\",\"address\":\"Shipping Address Test\",\"country\":\"CN\",\"province\":\"HB\",\"city\":\"WH\",\"street\":\"833 Cheung Sha Wan Road\",\"number\":\"1\",\"identityNumber\":\"82962612865\"}",
  "billingInformation":"{\"firstName\":\"test\",\"lastName\":\"test\",\"phone\":\"18600000000\",\"email\":\"taoyun15@gmail.com\",\"postalCode\":\"430000\",\"address\":\"Unit 1113, 11/F, Tower 2, Cheung Sha Wan Plaza, 833 Cheung Sha Wan Road, Lai Chi Kok\",\"country\":\"CN\",\"province\":\"HB\",\"city\":\"HK\"}",
  "sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String 64 Yes Yes Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
merchantTxnTime String / No Yes The time when the merchant transaction order occurred. The format is yyyy-MM-dd HH:mm:ss
merchantTxnTimeZone String 64 No Yes The time zone when the merchant transaction order occurred. For example: +08:00
productType String 16 Yes Yes Product Type, Please refer to ProductTypeEnum
subProductType String 16 Yes Yes Sub product type, Please refer to SubProductTypeEnum
txnType String 16 Yes Yes Transaction type, Please refer to TxnTypeEnum
paymentMode String 16 No Yes Payment mode. Please refer to PaymentModeEnum. Default as WEB
osType String 16 No Yes Operating system type. Please refer to OsTypeEnum. Required when paymentMode is not WEB
orderAmount String 19 Yes Yes The amount of the transaction order
orderCurrency String 8 Yes Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
originTransactionId String 20 No Yes The original transaction order number sourced from Onerway, often used for reverse transactions such as refunds, to find the corresponding forward transaction order number
risk3dsStrategy String 16 No Yes 3ds risk control strategy. Please refer toRisk3dsStrategyEnum
subscription String / No Yes Subscription information required for subscription payment. The format is json string. Please refer to Subscription object
mpiInfo String / No Yes Mpi information, 3ds verification result set, required when risk3dsStrategy is EXTERNAL. The format is json string. Please refer to MpiInfo object
txnOrderMsg String / No Yes Transaction business information, required except for subscription payment repurchase. The format is json string. Please refer to TxnOrderMsg object
cardInfo String / No Yes Transaction card information, required when product type is CARD and except for subscription payment repurchase and token payment. The format is json string. Please refer to TxnCardInfo object
billingInformation String / No Yes Transaction billing information, required except for subscription payment repurchase. The format is json string. Please refer to TransactionAddress object
shippingInformation String / No Yes Transaction mailing information, required except for subscription payment repurchase. The format is json string. Please refer to TransactionAddress object
lpmsInfo String / No Yes Local payment method information, required when product type is LPMS, The format is json string. Please refer to LpmsInfo object
tokenInfo String / No Yes Token information, required when subProductType is TOKEN, format is json string. Please refer to TokenInfo object
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

TxnOrderMsg

Name Type Length Required Signed Description
returnUrl String 256 Yes No The URL of the merchant's side
products String 1024 Yes No Product information list. The format is json string. For example:[{"name":"iphone11","price":"5300.00","num":"2","currency":"CNY"}, {"name":"macBook","price":"1234.00","num":"1","currency":"USD"}]
transactionIp String 64 Yes No The transaction IP of the cardholder
appId String 20 Yes No Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant
javaEnabled Boolean / No No The cardholder's browser enable java or not
colorDepth String 64 No No The cardholder's screen color depth
screenHeight String 64 No No The cardholder's screen resolution
screenWidth String 64 No No The cardholder's screen resolution
timeZoneOffset String 64 No No The time zone of the cardholder's browser
accept String 2048 No No The Accept request header of the cardholder's browser
userAgent String 2048 No No the cardholder's browser type
contentLength String 64 No No The content length other than content length header of the cardholder's browser
language String 64 No No The language of the cardholder's browser
periodValue String / No No Number of installments. Required when subProductType is INSTALLMENT.
terminalId String 64 No No The unique ID that is assigned by the merchant to identify a store terminal, required when productType is PAYMENT_CODE.

TxnCardInfo

Name Type Length Required Signed Description
holderName String 64 Yes No The cardholder's Name
cardNumber String 128 Yes No The cardholder's card number
month String 64 Yes No The month of card number, for example: 03
year String 64 Yes No The year of card number, for example: 2021
cvv String 64 Yes No The cvv of card number

TransactionAddress

Name Type Length Required Signed Description
firstName String 64 No No The first name
lastName String 64 No No The laset name
phone String 32 No No Phone number
email String 256 Yes No Email
postalCode String 32 No No Postal code
address String 256 No No address
country String 64 Yes No Country. Please refer to ISO. For example: the United States is US
province String 64 No No State. Required when the country is the United States (US) or Canada (CA). Please refer to ISO. For example: American Samoa is AS
city String 64 No No city
street String 64 No No street
number String 64 No No house number
identityNumber String 64 No No ID number
birthDate String 64 No No date of birth, the format is yyyy/MM/dd

Subscription

Name Type Length Required Signed Description
requestType String 1 Yes No Subscription request Type. The enum is as follows: 0 - first purchase 1 - repurchase
merchantCustId String 50 No No Merchant customer id, required when requestType is 0.
expireDate String 10 No No Expiration date, required when requestType is 0. The format is yyyy-MM-dd
frequencyType String 1 No No Subscription frequency type, required when requestType is 0. The enum is as follows: D - day
frequencyPoint String 2 No No Subscription frequency point, required when requestType is 0.
contractId String 20 No No Subscription contract id, required when requestType is 1.
tokenId String 300 No No Subscription token id, required when requestType is 1.

MpiInfo

Name Type Length Required Signed Description
eci String 2 Yes No transfer of responsibility
cavv String 128 Yes No Created by issuer
xid String 128 No No 3D-Secure v1 version Mpi transaction id (choose one of dsTransID to fill in)
dsTransID String 128 No No 3D-Secure v2 version Mpi transaction id (choose one of xid to fill in)

LpmsInfo

Name Type Length Required Signed Description
lpmsType String 64 Yes No Local payment method. Please refer to LpmsTypeEnum
bankName String 128 No No Bank name, required for some payment methods
iBan String 64 No No Bank account, required for transfer in some areas
walletAccountId String 128 No No Wallet account id (payment code), required when productType is PAYMENT_CODE.

TokenInfo

Name Type Length Required Signed Description
tokenId String 300 No No Token id obtained by binding the card

Example responses

{
  "//": "Direct card payment",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1473856517125345280",
    "responseTime": "2021-12-23 11:22:31",
    "txnTime": "2021-12-23 11:22:31",
    "txnTimeZone": "+08:00",
    "orderAmount": "20.00",
    "orderCurrency": "USD",
    "txnAmount": "20.00",
    "txnCurrency": "USD",
    "status": "S",
    "redirectUrl": null,
    "periodValue": null,
    "contractId": null,
    "tokenId": null,
    "eci": null,
    "sign": "..."
  }
}

{
  "//": "Subscription first purchase",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1473942456961826816",
    "responseTime": "2021-12-23 17:04:01",
    "txnTime": "2021-12-23 17:04:01",
    "txnTimeZone": "+08:00",
    "orderAmount": "200.00",
    "orderCurrency": "USD",
    "txnAmount": null,
    "txnCurrency": null,
    "status": "R",
    "redirectUrl": "https://sandbox-v3-gw-dmz.pacypay.com//3dsSecure/direct/3DS_1473942457892581377I",
    "contractId": "1473942457062490112",
    "tokenId": "2a6f9b7720403a161860b6cc9e2121e3bf0e2c59bad870501e51233ce7f34f6a",
    "eci": null,
    "sign": "..."
  }
}

{
  "//": "Subscription repurchase",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1474250301443518464",
    "responseTime": "2021-12-24 13:27:17",
    "txnTime": "2021-12-24 13:27:17",
    "txnTimeZone": "+08:00",
    "orderAmount": "163.00",
    "orderCurrency": "USD",
    "txnAmount": "163.00",
    "txnCurrency": "USD",
    "status": "S",
    "redirectUrl": null,
    "contractId": "1473942457062490112",
    "tokenId": "2a6f9b7720403a161860b6cc9e2121e3bf0e2c59bad870501e51233ce7f34f6a",
    "eci": null,
    "sign": "..."
  }
}

{
  "//": "Local payment",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1498239706186051584",
    "responseTime": "2022-02-28 18:12:37",
    "txnTime": "2022-02-28 18:12:36",
    "txnTimeZone": "+08:00",
    "orderAmount": "20.00",
    "orderCurrency": "BRL",
    "txnAmount": null,
    "txnCurrency": null,
    "status": "R",
    "redirectUrl": "https://sandbox.ebanxpay.com/print/?hash=621ca01414557c5009067504858cd223b90efca03add5c94",
    "contractId": null,
    "tokenId": null,
    "eci": null,
    "periodValue": null,
    "sign": "..."
  }
}

{
  "//": "Local payment for Alipay+",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1509432822252380160",
    "responseTime": "2022-03-31 15:30:04",
    "txnTime": "2022-03-31 15:30:03",
    "txnTimeZone": "+08:00",
    "orderAmount": "2.00",
    "orderCurrency": "CNY",
    "txnAmount": null,
    "txnCurrency": null,
    "status": "R",
    "redirectUrl": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?charset=UTF-8&codeValue=281666040090cylL0chma8X6eA30FRz0bbed&loadMode=2",
    "contractId": null,
    "tokenId": null,
    "eci": null,
    "periodValue": null,
    "sign": "..."
  }
}

{
  "//": "token payment",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1563942450861823816",
    "responseTime": "2022-07-12 17:39:32",
    "txnTime": "2022-07-12 17:39:31",
    "txnTimeZone": "+08:00",
    "orderAmount": "200.00",
    "orderCurrency": "USD",
    "txnAmount": null,
    "txnCurrency": null,
    "status": "R",
    "redirectUrl": "https://sandbox-v3-gw-dmz.pacypay.com//3dsSecure/direct/3DS_1563942450861823816",
    "contractId": null,
    "tokenId": "2a6f9b7720403a161860b6cc9e2121e3bf0e2c59bad870501e51233ce7f34f6a",
    "eci": null,
    "sign": "..."
  }    
}

{
  "//": "offline payment (user payment code)",
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
      "transactionId": "1559475985037299712",
      "responseTime": "2022-08-16 17:51:26",
      "txnTime": "2022-08-16 17:51:24",
      "txnTimeZone": "+08:00",
      "orderAmount": "10.10",
      "orderCurrency": "CNY",
      "txnAmount": "1.50",
      "txnCurrency": "USD",
      "status": "S",
      "redirectUrl": null,
      "contractId": null,
      "tokenId": null,
      "eci": null,
      "periodValue": null,
      "sign": "..."
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TxnInfo json object

TxnInfo

Name Type Signed Description
transactionId String Yes The transaction order number created by Onerway,corresponding to the merchant order number
responseTime String Yes Interface response time, the format is yyyy-MM-dd HH:mm:ss
txnTime String Yes Transaction completion time, the format is yyyy-MM-dd HH:mm:ss
txnTimeZone String Yes Transaction completion time zone, for example: +08:00
orderAmount String Yes The amount of the transaction order
orderCurrency String Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
txnAmount String Yes The transaction amount in settlement currency
txnCurrency String Yes The settlement currency. Please refer to ISO 4217 Currency Codes
status String Yes Transaction processing result. Please refer toTxnStatusEnum
redirectUrl String Yes when the transaction status is R, the merchant needs to redirect to this URL to complete part of the transaction, including 3ds verification, local payment cashier and so on
periodValue String No Number of installments
contractId String Yes Subscription contract id , returned when paying for the first subscription
tokenId String Yes Subscription token id , returned when paying for the first subscription
eci String Yes transfer of responsibility
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Customs Declaration

Customs Declaration

POST /v1/txn/declareCustoms

Example requests

{
  "merchantNo":"800058",
  "originTxnId":"1524994590991003648",
  "isUpdate":false,
  "merCustomsNo":"hanguo",
  "merCustomsName":"jwyhanguo_card",
  "customs":"NINGBO",
  "isSplit":false,
  "subOrderNo":"",
  "productAmount":"10",
  "transportAmount":"0",
  "amount":"18.29",
  "currency":"CNY",
  "buyer":"{\"certType\":\"ID_CARD\",\"idNo\":\"230227198707200000\",\"name\":\"TEST\"}",
  "sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
originTxnId String 20 Yes Yes The transaction order number sourced from Onerway that needs to be declared .
isUpdate Boolean / Yes Yes The merchant can decide whether to update customs declaration information. The value of this field is true means to update, and false means to add.
merCustomsNo String 128 Yes Yes The merchant code that is registered in the customs system.
merCustomsName String 256 Yes Yes The merchant name that is registered in the customs system.
customs String 64 Yes Yes The customs code. Please refer to CustomsCodeEnum
amount String 19 Yes Yes The amount to be declared.
currency String 8 Yes Yes The currency of the amount to be declared. Please refer to ISO 4217 Currency Codes. Currently only supports CNY
buyer String / Yes Yes The buyer information. The format is json string. Please refer to Buyer object
isSplit Boolean / Yes Yes The merchant can decide whether the order is split for declaration. If the value of this field is true, order splitting is allowed.
subOrderNo String 64 No Yes The unique ID that is assigned by the merchant to identify an order. When isSplit is true, this field is required and is used as the order ID to be declared to the customs.
productAmount String 19 No Yes The amount of the product. When isSplit is true, this field is required
transportAmount String 19 No Yes The amount of logistics costs. When isSplit is true, this field is required
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Buyer

Name Type Length Required Signed Description
certType String 64 Yes No Identification type. Please refer to CredentialsTypeEnum. Currently only supports ID_CARD
idNo String 64 Yes No Identification Number
name String 64 Yes No Buyer full name

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "declareCustomsId": "1524997122043752448",
    "sign": "..."
  }
}


Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to DeclareCustoms json object

DeclareCustoms

Name Type Signed Description
declareCustomsId String Yes The customs declaration order number created by Onerway. This field can be used to query customs declaration results
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Cancel

Cancel Transaction

The following points need to be paid attention to when using this interface:
(1) The cancellation application can only be initiated within 5 minutes to 30 minutes after the payment is completed and the transaction status is still in processing.
(2) According to the application, we will verify the final status of the original transaction, and the processing method of cancellation will vary according to the actual final status of the original transaction.
(3) If it is determined that the original transaction is actually unsuccessful, the merchant will be notified directly that the cancellation is successful; if it is determined that the original transaction is actually successful, then we will initiate a refund, and notify the merchant that the cancellation is successful after the refund is successful.

POST /v1/txn/cancelTxn

Example requests

{
  "merchantNo": "800058",
  "originTransactionId": "1484408335541923840",
  "sign": "..."
}

Request parameters

Name Type Length Required Signed Description
originTransactionId String 20 Yes Yes The original transaction order number sourced from Onerway, often used for reverse transactions, to find the corresponding forward transaction order number
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "transactionId": "1484409612279672832",
    "status": "I"
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to TxnCancelInfo json object

TxnCancelInfo

Name Type Signed Description
transactionId String No Cancellation order number
status String No The status of applying for cancellation. Please refer to TxnStatusEnum

Cancel Subscription

POST /v1/txn/sub/cancel

Example requests

{
  "merchantNo": "800037",
  "contractId": "1473942457062490112",
  "sign": "..."
}

Request parameters

Name Type Length Required Signed Description
contractId String 20 Yes Yes Subscription contract id
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": "3"
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data String No contract status. Please refer to ContractStatusEnum

Refund

Apply Refund

POST /v1/txn/onlineRefund

Example requests

{
  "merchantNo": "800037",
  "refundType": "0",
  "merchantTxnId": "1640241780000",
  "originTransactionId":"1473906683882672128",
  "refundAmount": "20",
  "sign": "..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
refundType String 1 Yes Yes Transaction Refund Type, The enum is as follows: 0 - apply for a refund 1 - cancel the refund
merchantTxnId String 64 No Yes Merchant refund transaction order number created by the merchant.Different order numbers are regarded as different transactions
originTransactionId String 20 Yes Yes The original transaction order number sourced from Onerway. It is a forward transaction order number when refundType is 0. And it is a refund transaction order number when refundType is 1.
refundAmount String 19 Yes Yes Refund transaction amount, the currency of this amount should correspond to the order currency sent during the forward transaction
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": "1473906993397141504"
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
transactionId String No Refund transaction order number created by Onerway, returned when applying for refund

Transaction Search

Inquiry Transactions

POST /v1/txn/list

Example requests

{
  "merchantNo": "800037",
  "merchantTxnIds": "1640244407000,1640244473000",
  "transactionIds": "",
  "txnTypes": "",
  "startTime": "",
  "endTime": "",
  "current": "1",
  "sign": "..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnIds String / No Yes Merchant transaction order number, which can be multiple, separated by commas, for example: "554815,684541"
transactionIds String / No Yes Onerway transaction order number which can be multiple, separated by commas
txnTypes String / No Yes Transaction type which can be multiple, separated by commas
startTime String / No Yes transaction start time, the format is yyyy-MM-dd HH:mm:ss
endTime String / No Yes transaction end time, the format is yyyy-MM-dd HH:mm:ss. The maximum interval is 90 days.
current String / Yes Yes The current page number of the query
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "content": [
      {
        "transactionId": "1473918047031586816",
        "merchantTxnId": "1640244407000",
        "txnTime": "2021-12-23 15:27:01",
        "originTransactionId": null,
        "productType": "CARD",
        "subProductType": "DIRECT",
        "txnType": "0006",
        "status": "S",
        "cardType": "VISA",
        "orderAmount": "20.00",
        "orderCurrency": "USD",
        "txnAmount": "20.00",
        "txnCurrency": "USD",
        "arn": null,
        "appId": "1458672763818790912",
        "website": "800037.sc.com",
        "cardBinCountry": "US",
        "cardNumber": "400002******0961",
        "reason": null
      },
      {
        "transactionId": "1473918280901783552",
        "merchantTxnId": "1640244473000",
        "txnTime": "2021-12-23 15:27:56",
        "originTransactionId": null,
        "productType": "CARD",
        "subProductType": "DIRECT",
        "txnType": "0006",
        "status": "S",
        "cardType": "VISA",
        "orderAmount": "20.00",
        "orderCurrency": "USD",
        "txnAmount": "20.00",
        "txnCurrency": "USD",
        "arn": null,
        "appId": "1458672763818790912",
        "website": "800037.sc.com",
        "cardBinCountry": "US",
        "cardNumber": "400002******0961",
        "reason": null
      }
    ],
    "current": "1",
    "size": "10",
    "totalPages": "1",
    "totalElements": "2"
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to Page json object

Page

Name Type Signed Description
content List No Transaction information list, Please refer to TxnInfo json object
current String No The current page number
size String No The current page size
totalPages String No Total pages
totalElements String No Total items

TxnInfo

Name Type Signed Description
transactionId String No The transaction order number created by Onerway,corresponding to the merchant order number
merchantTxnId String No Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
txnTime String No Transaction completion time
originTransactionId String No The original transaction order number sourced from Onerway.
productType String No Product Type, Please refer to ProductTypeEnum
subProductType String No Sub product type, Please refer to SubProductTypeEnum
txnType String No Transaction type, Please refer to TxnTypeEnum
status String No Transaction processing result. Please refer toTxnStatusEnum
reason String No Reason for transaction failure
paymentMethod String No The specific payment method, including card type and local payment type
walletTypeName String No Wallet type brand name
orderAmount String No The amount of the transaction order
orderCurrency String No The currency of the transaction order. Please refer to ISO 4217 Currency Codes
txnAmount String No The transaction amount in settlement currency
txnCurrency String No The settlement currency. Please refer to ISO 4217 Currency Codes
customsDeclarationAmount String No Amount available for customs declaration
customsDeclarationCurrency String No The currency of the amount available for customs declaration. Please refer to ISO 4217 Currency Codes
arn String No ARN
appId String No Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant
website String No Transaction website
cardBinCountry String No Country of card bin
cardNumber String No Transaction card number

Inquiry Chargebacks

POST /v1/chargeback/list

Example requests

{
  "chargebackIds":"",
  "current":"1",
  "importTimeEnd":"",
  "importTimeStart":"",
  "merchantNo":"800037",
  "merchantTxnIds":"",
  "originTransactionIds":"1535176982304575488",
  "sign":"…"
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnIds String / No Yes Merchant transaction order number, which can be multiple, separated by commas, for example: "554815,684541"
originTransactionIds String / No Yes The original transaction order number sourced from Onerway, which can be multiple, separated by commas
chargebackIds String / No Yes The chargeback transaction order number, sourced from Onerway, which can be multiple, separated by commas
importTimeStart String / No Yes The start time for chargeback transactions to be imported into onerway, the format is yyyy-MM-dd HH:mm:ss
importTimeEnd String / No Yes The end time for chargeback transactions to be imported into onerway, the format is yyyy-MM-dd HH:mm:ss. The maximum interval is 90 days.
current String / Yes Yes The current page number of the query
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode":"20000",
  "respMsg":"Success",
  "data":{
    "content":[
      {
        "merchantNo":"800037",
        "chargebackId":"1535178069061324800",
        "importTime":"2022-06-10 16:32:29",
        "merchantTxnId":"1654849689044",
        "originTransactionId":"1535176982304575488",
        "txnAmount":"30.90",
        "txnCurrency":"EUR",
        "txnTime":"2022-06-10 16:28:10",
        "paymentMethod":"VISA",
        "chargebackAmount":"1.00",
        "chargebackCurrency":"USD",
        "chargebackDate":"2022-06-10",
        "chargebackReason":"chargeback occurs",
        "chargebackArn":"123",
        "disputeDueDate":"2022-09-10",
        "chargebackStatus":"NEW"
      }
    ],
    "current":"1",
    "size":10,
    "totalPages":1,
    "totalElements":1
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to Page json object

Page

Name Type Signed Description
content List No Transaction information list, Please refer to ChargebackInfo json object
current String No The current page number
size String No The current page size
totalPages String No Total pages
totalElements String No Total items

ChargebackInfo

Name Type Signed Description
merchantNo String No Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String No Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
originTransactionId String No The original transaction order number sourced from Onerway.
txnAmount String No The original transaction amount in settlement currency
txnCurrency String No The original transaction settlement currency. Please refer to ISO 4217 Currency Codes
txnTime String No The original transaction completion time
paymentMethod String No The specific payment method, including card type and local payment type
chargebackId String No The chargeback transaction order number created by Onerway
importTime String No The time for chargeback transactions to be imported into onerway
chargebackAmount String No Chargeback amount that occurred
chargebackCurrency String No The currency of the chargeback amount. Please refer to ISO 4217 Currency Codes
chargebackDate String No The date the chargeback occurred
chargebackStatus String No Chargeback transaction status. Please refer toChargebackStatusEnum
chargebackReason String No Reason for chargeback
chargebackArn String No ARN
disputeDueDate String No Appeal information submission deadline

Inquiry Customs Declaration

POST /v1/txn/getCustomsResult

Example requests

{
  "declareCustomsId":"1524997122043752448",
  "merchantNo":"800058",
  "sign":"..."
}

Request parameters

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
declareCustomsId String 20 Yes Yes The customs declaration order number created by Onerway when merchant sends customs declaration request
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "declareCustomsId": "1524997122043752448",
    "updateTime": "2022-05-13 14:20:40",
    "status": "S",
    "reason": null,
    "verifyDepartment": "CUP",
    "verifyDepartmentTxnId": "202108120000000808000000",
    "actualAmount": "18.29",
    "payCode": "31222699S7",
    "subOrderNo": null,
    "sign": "..."
  }
}

Response parameters

Name Type Signed Description
respCode String No Response code sourced from Onerway
respMsg String No Response message sourced from Onerway
data Map No Response data. Please refer to CustomsResult json object

CustomsResult

Name Type Signed Description
declareCustomsId String Yes The customs declaration order number created by Onerway when merchant sends customs declaration request
updateTime String Yes Customs declaration completion time, the format is yyyy-MM-dd HH:mm:ss
status String Yes Customs declaration processing result. Please refer toTxnStatusEnum
reason String Yes Reason for customs declaration failure
verifyDepartment String Yes The clearing organization. Please refer to VerifyDepartmentEnum
verifyDepartmentTxnId String Yes The clearing organization's clearing serial number. Can be verified by organizations trusted by the People's Bank of China.
actualAmount String Yes Actual customs declaration amount. Currency is CNY.
payCode String Yes The wallet's registration ID in the customs system.
subOrderNo String Yes The unique ID that is assigned by the merchant to identify an order.
sign String No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Notification

Notification

The notify url should be provided by the merchant when the merchant registers, the merchant needs to develop according to the following parameters and respond to the asynchronous notification. Please add v1/txn/notifyResult to the URI part of notify url.

POST {notifyUrl}

Example requests

{
  "notifyType": "TXN",
  "transactionId": "1530009844336164864",
  "txnType": "SALE",
  "merchantNo": "800067",
  "merchantTxnId": "T205271653617741988",
  "responseTime": "2022-05-27 10:15:51",
  "txnTime": "2022-05-27 10:15:47",
  "txnTimeZone": "+08:00",
  "orderAmount": "5.00",
  "orderCurrency": "USD",
  "txnAmount": "5.00",
  "txnCurrency": "USD",
  "customsDeclarationAmount": null,
  "customsDeclarationCurrency": null,
  "status": "S",
  "contractId": null,
  "tokenId": null,
  "eci": null,
  "reason": "{\"respCode\":\"20000\",\"respMsg\":\"Success\"}",
  "sign": "..."
}

Request parameters

Name Type Length Signed Description
notifyType String / Yes Notification type. Please refer to NotifyTypeEnum
txnType String / Yes Transaction type, Please refer to TxnTypeEnum. Returned when notifyType is TXN
transactionId String 20 Yes The transaction order number created by Onerway,corresponding to the merchant order number
merchantNo String 20 Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
merchantTxnId String 64 Yes Merchant transaction order number created by the merchant.Different order numbers are regarded as different transactions
originMerchantTxnId String 64 No The merchant's original transaction order number, corresponding forward transaction, will be returned in the notification of reverse transactions such as refunds
responseTime String / Yes Interface response time, the format is yyyy-MM-dd HH:mm:ss
txnTime String / Yes Transaction completion time, the format is yyyy-MM-dd HH:mm:ss
txnTimeZone String / Yes Transaction completion time zone, for example: +08:00
orderAmount String 19 Yes The amount of the transaction order
orderCurrency String 8 Yes The currency of the transaction order. Please refer to ISO 4217 Currency Codes
txnAmount String 19 Yes The transaction amount in settlement currency
txnCurrency String 8 Yes The settlement currency. Please refer to ISO 4217 Currency Codes
customsDeclarationAmount String 19 No Amount available for customs declaration
customsDeclarationCurrency String 8 No The currency of the amount available for customs declaration. Please refer to ISO 4217 Currency Codes
paymentMethod String 64 No The specific payment method, including card type and local payment type
walletTypeName String 128 No Wallet type brand name
status String 1 Yes Transaction processing result. The enum is as follows: S - Transaction success/cancel transaction success F - Transaction failed/approval not pass/cancel transaction failed
reason String 512 Yes Reason for transaction failure
periodValue String / No Number of installments
contractId String 20 Yes Subscription contract id , returned when paying for the first subscription
tokenId String 300 Yes Subscription token id , returned when paying for the first subscription
eci String 2 Yes transfer of responsibility
sign String / No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Example responses

"1530009844336164864"

Response parameters

Name Type Signed Description
transactionId String No The transaction order number created by Onerway,corresponding to the merchant order number

Just return the value of transactionId !

File

Download Settlement File

The following points need to be paid attention to when using this interface:
(1) The interface returns a file stream, and the Content-Type in the response header is application/octet-stream
(2) The character set only supports UTF-8
(3) It is recommended to write the file stream to a file with a suffix of csv, please refer to settlement_800037_20220408_USD.csv and settlement_800037_20220325_GBP.csv

GET /v1/settlementFile/download

Http header parameter

Name Type Length Required Signed Description
merchantNo String 20 Yes Yes Merchant number. When a merchant registers, Onerway will create a merchant number for the merchant
date String 8 Yes Yes Settlement date, the format is yyyyMMdd
currency String 8 Yes Yes Settlement currency. Please refer to ISO 4217 Currency Codes
sign String / Yes No Signature string. The scope of the signed field is those parameters for which the signed column is Yes and not empty

Document content

Settlement batch

Name Description
Settlement Date The settlement date calculated according to the settlement cycle
Settlement Currency Merchant settlement currency
Transaction Amount The transaction amount in the settlement currency
Refund Amount The amount for which a refund transaction occurred and the refund was successful
Transaction Processing Fee handling fee charged in direct payment transactions
Refund Processing Fee handling fee charged in refund transaction
Fee Fee charged in direct payment transactions
Interchange Fee Only in IC++ mode
Scheme Fee Only in IC++ mode
Markup Only in IC++ mode
Deposit Release The amount returned when the deposit is released
Deposit A certain amount of risk charged according to the contract, which will be returned after expiration
Settlement Amount In a batch, the netted amount of transaction amount and handling fee

Settlement details

Name Description
Settlement Date The settlement date calculated according to the settlement cycle
Settlement Batch ID A settlement batch will only generate one batch number
Transaction ID A transaction generates a transaction serial number
Merchant Order ID Merchant's transaction order number
Production Type CARD/LPMS
Card Type Card type and local payment method
APP ID Merchant application id. When a merchant registers a website, Onerway will create an application id for the merchant
Transaction URL Merchant transaction website
Order_Currency Transaction order currency
Order Amount Transaction order amount
Transaction Type /
Transaction Status /
Settlement Currency Merchant settlement currency
Transaction Amount The transaction amount in the settlement currency
Processing Fee handling fee
Fee transaction fee
Interchange Fee Only in IC++ mode
Scheme Fee Only in IC++ mode
Markup Only in IC++ mode
Deposit A certain amount of risk charged according to the contract, which will be returned after expiration
Settlement Amount In a transaction detail, the netted amount of transaction amount and handling fee
Settlement Status Settlement successful / Settlement failed
Wallet Type Code The code corresponding to the wallet type (currently exists when the local payment method is Alipay+)
Merchant Order Time Merchant transaction order occurrence time

Transaction Type

Code Description
SALE Pay directly
REFUND Refund
CB Chargeback
CB_CANCEL Chargeback Cancellation
CB_VOID Chargeback void
CB_APPEAL Chargeback Appeal
CB_APPEAL_SUCCESS Chargeback appeal successful
CB_APPEAL_SECOND Second Chargeback Appeal
CB_APPEAL_SECOND_SUCCESS Second chargeback appeal successful
CB_APPEAL_SECOND_FAILURE Second chargeback appeal failed

Code example



    public void downLoad(@RequestParam("localFileName") String localFileName,HttpServletResponse response) {
        HttpClient client = new HttpClient();
        GetMethod get = null;
        FileOutputStream output = null;
        try {
            get = new GetMethod("https://sandbox-v3-acquiring.pacypay.com/v1/settlementFile/download");
            get.setRequestHeader("merchantNo", "500010");
            get.setRequestHeader("date", "20211026");
            get.setRequestHeader("currency", "USD");
            get.setRequestHeader("sign","...");
            MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
            HttpConnectionManagerParams params = new HttpConnectionManagerParams();
            params.setConnectionTimeout( 20000 );
            params.setSoTimeout( 20000 );
            connectionManager.setParams(params);
            client = new HttpClient(connectionManager);
            HttpClientParams clientParams = new HttpClientParams();
            clientParams.setParameter("http.protocol.allow-circular-redirects", true);
            clientParams.setParameter("http.protocol.max-redirects", 4);
            client.setParams(clientParams);
            int i = client.executeMethod(get);
            if (200 == i) {
                File storeFile = new File(localFileName);
                output = new FileOutputStream(storeFile);
                output.write(get.getResponseBody());
            } else {
                System.out.println("DownLoad file occurs exception, the error code is :" + i);
            }
            InputStream inStream = new FileInputStream(localFileName);
            response.reset();
            response.setContentType("application/octet-stream");
            response.addHeader("Content-Disposition", "attachment; filename=\"" + localFileName + "\"");
            byte[] b = new byte[100];
            int len;
            try {
                while ((len = inStream.read(b)) > 0)
                    response.getOutputStream().write(b, 0, len);
                inStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if(output != null){
                    output.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            get.releaseConnection();
            client.getHttpConnectionManager().closeIdleConnections(0);
        }
    }



Response Codes

Common Response Codes

code message Further action
20000 Success N/A
40004 API that does not exist N/A
40000 Illegal parameter [] N/A
40013 Abnormal parameters (cannot be read) N/A
40005 Unsupported request method N/A
40015 Unsupported media type N/A
50000 Unknown exception Human intervention is usually needed. It is recommended that you contact the technical support team to troubleshoot the issue.
50001 Merchant was not found It is recommended that you contact the technical support team to troubleshoot the issue.
50002 Repeated order transactions! N/A
50003 The query condition cannot be empty! (Order number or start and end time, both cannot be empty at the same time) Please ensure that the request parameters meet the requirements.
50005 The cumulative refund amount cannot be greater than the transaction amount! N/A
50006 The source transaction does not support online refunds! It is recommended that you contact the technical support team to troubleshoot the issue.
50007 The time range of transaction inquiry cannot exceed ninety days! N/A
50008 The initiating transaction ip is not in the configured whitelist! Human intervention is usually needed. It is recommended that you contact the technical support team to troubleshoot the issue.
50012 Repurchase initiation failed, contract information verification failed! It is recommended that you contact the technical support team to troubleshoot the issue.
50015 Online refund failed, this transaction does not support the initiation of a refund! N/A
50016 Online refund failed, there are unapproved orders! Please wait for the refund review to complete.
50017 Online refund failed, the source transaction was unsuccessful! N/A
50018 Non-existent transaction order! Check if the transaction ID or source transaction ID in the request is correct.
50020 Forced refund failed, the channel does not support online refund! It is recommended that you contact the technical support team to troubleshoot the issue.
50021 Failed to cancel the refund request, the refund has been processed and cannot be canceled! N/A
50023 Card number cannot be empty! Please ensure that the request parameters meet the requirements.
50028 Invalid product format Please ensure that the request parameters meet the requirements.
50029 Card year/month is invalid Check if the card info in the request is correct.
50031 Card expired card Check if the card info in the request is correct.
50032 Invalid card number Check if the card info in the request is correct.
50033 Unsupported currency Check if the currency in the request is correct.
50034 Invalid transaction type Please ensure that the request parameters meet the requirements.
50035 Invalid transaction amount Check if the amount in the request is correct.
50036 Incorrect card information Please ensure that the request parameters meet the requirements.
50037 Merchant not enabled It is recommended that you contact the technical support team to troubleshoot the issue.
50045 Transaction Website is invalid Check if the website in the request is correct.
50047 Refund transaction must go through the designated interface for refund! Please use the refund interface for refund transactions.
50048 Invalid productType! Please ensure that the request parameters meet the requirements.
50049 Invalid subProductType! Please ensure that the request parameters meet the requirements.
50070 Subscription contract unavailable The subscription contract has been closed or cancelled, please create a new subscription.
50071 Subscription contract expired The subscription contract has expired, please create a new subscription.
50072 Subscription frequency is illegal The frequency of repurchase does not match the subscription contract information, please confirm the repurchase frequency.
50073 Subscription contract param can not be null Please ensure that the request parameters meet the requirements.
50074 Transaction number does not match merchant number N/A
50090 Subscription failed! Merchant customer number cannot be empty! Please ensure that the request parameters meet the requirements.
50091 Repurchase failed! The contract number or token cannot be empty! Please ensure that the request parameters meet the requirements.
50092 Transaction failed Human intervention is usually needed. It is recommended that you contact the technical support team to troubleshoot the issue.
50120 billingInformation cannot be empty or email and country cannot be empty Please ensure that the request parameters meet the requirements.
50121 risk3dsStrategy is EXTERNAL, mpiInfo not be null Please check the risk3dsStrategy.
50201 Account is disabled or does not exist! Please contact the operation personnel to confirm the merchant account status.
50204 Appid is invalid! Please contact the operation personnel to confirm the app id status.
53001 Invalid 3DS service The 3DS service is faulty. Please contact technical support.
53002 3DS permission is not available The 3DS service is usually faulty at the issuer or acquirer . Please contact technical support.
53003 No such issuer There is a problem with the credit card number, for example, the credit card BIN doesn't match the range of any issuer in the acquirer's list.
53004 Timeout A timeout occurred between the acquirer and the issuer. Please try again.
54001 Invalid transaction This code is generated by the issuer when no specific decline reason/code is returned.
54002 Invalid merchant Typically, this does not indicate any general issue with the merchant This decline reason is usually the result of an issue regarding an internal standard.
54003 Duplicate transmission. Indicates that a transaction was sent twice. Please modify it and try again.
54004 Payment failed. Generic error, an error caused by a failed transaction.
54005 Common decline Common error, unknown error.
54006 Invalid request parameter value. Please ensure that the request parameters meet the requirements.
55001 3DS Authentication failure 3DS verification failed.
55002 Invalid billing information Some information in the billing information is unavailable. Please check and try again.
55003 Decline for CVV2 failure Failure due to CVV input error, please cardholder check it and retry.
55004 Incorrect PIN or PIN missing This error is due to a PIN problem, and may indicate that the card is being blocked due to a security issue, such as exceeding the limit of PIN entry attempts at a point of sale.
55005 Lost card or Stolen card This error code is returned when the card is listed as lost or stolen on the issuer's side.
55006 High risk Failed transactions due to risk control.
55007 Exceeds withdrawal frequency limit The transaction amount or count exceeds the permitted frequency for this card or account.
55008 Strong customer authentication requried. This error means that stronger customer authentication is required.
55009 Invalid amount or currency conversion field overflow This error code is the result of an issue with the transaction amount or currency. This code may be triggered as a result of the currency or financial reasons such as insufficient funds.
55010 Refer to card issuer Please refers to the card issuer. It is possible that such transactions could be authorized with voice AuthCode.
55011 Card Authentication failed This error is the card information verification failure, please the cardholder check the card information and try again.
55012 Card not effective Invalid card, please the cardholder check the card information and try again.
55013 Card processing is forbidden Forbidden card, please the cardholder check the card information and try again.
55014 No credit account This usually indicates that there is an issue with the account connected to the credit card, for example, the account is expired, cancelled, or does not exist.
55015 No checking account This usually indicates that there is an issue with the account connected to the credit card, for example, the account is expired, cancelled, or does not exist.
55016 No savings account This usually indicates that there is an issue with the account connected to the credit card, for example, the account is expired, cancelled, or does not exist.
55017 Missing or invalid CardData data Missing or invalid CardData data, please the cardholder check the card information and try again.
55018 Expired card or expiration date is missing The credit card is no longer valid or expiration date is missing. It is also possible that the expiration date does not match the card details.
55019 Do not honor The most common and general issuer decline code. This code is generated by the issuer when no specific decline reason/code is returned.
55020 Retain Card Retain Card, please the cardholder check the card information and try again.
55021 Restricted card Restricted card, please the cardholder check the card information and try again.
55022 Rejected by customer N/A
55023 Custom Fraud Screen Filter. N/A
55024 Suspected fraud The transaction is suspected to be fraudulent.
55025 Transaction not permitted to cardholder The issuer did not allow this transaction against this card based on internal reasons, such as the transaction originated from a specifically restricted industry or country.
55026 Insufficient funds The credit card holder lacks sufficient funds to complete the transaction.
55027 Transaction failed trying again later. Please try again.
55028 Soft Decline – Authentication is Advised. User error - general cause - please try again.
55029 Cardholder withdrawal frequency limit User error - general cause - please try again.
55030 Invalid issuing account N/A
55031 Abnormal issuing account N/A
55032 Invalid Card Number User error - incorrect card number.
55033 Cryptographic failure User error -- incorrect password.

Reference

RSA Key generation

1. Generate pkcs1 private key

openssl genrsa -out private.pem 2048

2. Convert pkcs1 private key to pkcs8 private key

openssl pkcs8 -topk8 -inform PEM -in private.pem -outform pem -nocrypt -out pkcs8.pem

3. Generate the public key of pkcs8

openssl rsa -in private.pem -pubout -out public_pkcs8.pem

Enumeration

Product type

ProductTypeEnum

Code Description
ALL It can only be used in the cashier payment scenario, indicating that the aggregated cashier will be opened
CARD Credit card
LPMS Local payment method
PAYMENT_CODE Payment code (The merchant scans the user's payment code)

Sub product type

SubProductTypeEnum

Code Description
DIRECT direct payment
SUBSCRIBE subscription payment
INSTALLMENT installment payment
TOKEN token payment

Transaction type

TxnTypeEnum

Code Description
SALE direct payment
REFUND Refund, only for transaction inquiries
BIND_CARD Bind card, only for transaction inquiries

Payment mode

PaymentModeEnum

Code Description
WEB The client-side terminal type is a website that is opened via a PC browser.
WAP The client-side terminal type is an HTML page that is opened via a mobile browser.

Operating system type

OsTypeEnum

Code Description
IOS iOS
ANDROID Android

Notification type

NotifyTypeEnum

Code Description
TXN Transaction asynchronous notification
REFUND_AUDIT Refund review notification
CANCEL Transaction cancellation notification

Transaction Status

TxnStatusEnum

Code Description
S Transaction successful
F Transaction failed / review failed
P The transaction result is unknown (processing)
R 3ds verification required
N transaction cancelled
I Refund pending review/cancellation pending
U Pending payment, only in the cashier payment

Contract status

ContractStatusEnum

Code Description
0 pending
1 enable
2 disable
3 cancelled

3ds risk strategy

Risk3dsStrategyEnum

Code Description
INNER Internal 3ds (using 3ds provided by Onerway)
EXTERNAL External 3ds (using 3ds provided by merchant)
NONE None (doesn't go 3ds)
DEFAULT Default (not passed as this value, depends on Onerway to judge whether it needs to go 3ds)

Customs code

CustomsCodeEnum

Code Description
GUANGZHOU Guangzhou Customs
HANGZHOU Hangzhou Customs
NINGBO Ningbo Customs
ZHENGZHOU_BS Zhengzhou (Bonded Logistics Center)
CHONGQING Chongqing Customs
SHANGHAI Shanghai Customs
SHENZHEN Shenzhen Customs
ZHENGZHOU_ZH_ZS Zhengzhou integrated Bonded Area
TIANJIN Tianjin Customs

Identification type

CredentialsTypeEnum

Code Description
ID_CARD ID card

Verify Department

VerifyDepartmentEnum

Code Description
CUP indicates that the clearing channel is Unionpay
NUCC indicates that the clearing channel is NetsUnion
OTHER indicates that the clearing channel is others

Chargeback Status

ChargebackStatusEnum

Code Description
NEW Indicates that a new chargeback occurs
FA In the first appeal
FAF The first appeal failed
FAS The first appeal success
FAT Timeout for first appeal
SA In the second appeal
SAF The second appeal failed
SAS The second appeal success
SAT Timeout for second appeal
ACCEPT Chargeback accepted
REVOKE Chargeback revoked

Local payment method

LpmsTypeEnum

lpmsType Country(ISO) Currencys Required fields
Alipay+ Support all country EUR, USD, GBP email, country
WeChat GB GBP email, country
Klarna AU, AT, BE, FI, FR, DE, GR, IE, IT, NL, PT, ES, CZ, DK, NO, PL, SE, CH, GB AUD, EUR, CZK, DKK, NOK, PLN, SEK, CHF, GBP email, country, language, products
Boleto BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
BankTransfer BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
Banrisul BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
Bradesco BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
BancoDoBrasil BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
Itau BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
MercadoPago BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
PIX BR BRL, EUR, USD email, country, identityNumber, province, street, city, postalCode
Rapipago AR ARS, USD email, country, identityNumber
PagoFacil AR ARS, USD email, country, identityNumber
Cupon AR ARS, USD email, country, identityNumber
MercadoPago AR ARS, USD email, country, identityNumber
Servipag CL CLP, EUR, USD email, country
Sencillito CL CLP, EUR, USD email, country
Webpay CL CLP, EUR, USD email, country
Multicaja CL CLP, EUR, USD email, country
Baloto CO COP, EUR, USD email, country
EFT CO COP, EUR, USD email, country, identityNumber, eftCode
Efecty CO COP, EUR, USD email, country
SPEI MX MXN, USD email, country
OXXO MX MXN, USD email, country
oxxopay MX MXN, USD email, country
MercadoPago MX MXN, USD email, country
PagoEfectivo PE PEN, USD email, country
safetypay-cash PE PEN, USD email, country
safetypay-online PE PEN, USD email, country
PayU PL,CZ PLN, CZK email, country
Przelewy24 PL PLN email, country, eftCode
safetypay-cash EC USD email, country
safetypay-online EC USD email, country
Pagosnet BO BOB, USD email, country
Sofort AT, BE, FR, DE, IT, NL, PL, SK, ES, CH, GB EUR, GBP email, country
Giropay DE EUR email, country
iDEAL NL AUD, CAD, DKK, EUR, GBP, HKD, NOK, SEK, USD email, country
Konbini JP JPY email, country
Payeasy JP JPY email, country
POLI AU AUD email, country
bancontact BE EUR email, country
OVO ID IDR email, country
MyBank IT EUR email, country
Dragonpay Worldwide PHP email, country
skrill Worldwide EUR, GBP, USD email, country
eNETS SG SG email, country
PayseraWallet LT, LV, EE EUR email, country
LithuanianBanks LT EUR email, country
Paysafecard AT, AU, BE, BG, CA, CH, CY, CZ, DE, DK, ES, FI, FR, GB, GE, GI, GR, HR, HU, IE, IT, LI, LT, LU, MT, MX, NL, NZ, NO, PE, PL, PT, RO, SE, SI, SK, UY AUD, CAD, CHF, EUR, GBP, NOK, PLN, RON, SEK, USD email, country
Paysafecash AT, BE, CA, CH, CY, CZ, DK, ES, FR, GB, GR, HR, HU, IE, IT, LU, LT, MT, NL, PL, PT, RO, SE, SI, SK AUD, CAD, CHF, EUR, GBP, NOK, PLN, RON, SEK, USD email, country
Payconiq BE, NL, LU EUR email, country
Trustly DE, DK, EE, ES, FI, GB, LT, LV, NL, NO, PL, SE, SK DKK, EUR, GBP, NOK, PLN, SEK email, country