main.tea 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. model Context {
  2. config: map[string]any,
  3. certEnvironment: any
  4. }
  5. init(context: Context);
  6. function getTimestamp(): string;
  7. function getConfig(key: string): string;
  8. function getSdkVersion(): string;
  9. function toUrlEncodedRequestBody(bizParams: map[string]any): bytes;
  10. async function readAsJson(response: $Response, method: string): map[string]any;
  11. function toRespModel(respMap: map[string]any): map[string]any;
  12. function getRandomBoundary(): string;
  13. function toMultipartRequestBody(textParams: map[string]string, fileParams: map[string]string, boundary: string): readable;
  14. function generatePage(method: string, systemParams: map[string]string, bizParams: map[string]any, textParams: map[string]string, sign: string): string;
  15. function getMerchantCertSN(): string;
  16. function getAlipayCertSN(respMap:map[string]any): string;
  17. function getAlipayRootCertSN(): string;
  18. function isCertMode(): boolean;
  19. function extractAlipayPublicKey(alipayCertSN:string): string;
  20. function verify(respMap: map[string]any, alipayPublicKey: string): boolean;
  21. function sign(systemParams: map[string]string, bizParams: map[string]any, textParams: map[string]string, merchantPrivateKey: string): string;
  22. function aesEncrypt(plainText: string, encryptKey: string): string;
  23. function aesDecrypt(cipherText: string, encryptKey: string): string;
  24. function generateOrderString(systemParams: map[string]string, bizParams: map[string]any, textParams: map[string]string, sign: string): string;
  25. function concatStr(a: string, b: string): string;
  26. function verifyParams(parameters: map[string]string, publicKey: string): boolean;
  27. function sortMap(randomMap: map[string]string): map[string]string;