Data dictionary

BaseError

Field

Data type

Required

Description

code

String

Yes

Error code. For more information, refer to the Error codes section of the specific SPI.

errorMsg

String

No

Error description.

BaseServiceResult

Field

Data type

Required

Description

showFlutterPage

bool

No

Whether to show a Flutter page. Valid values are:

  • true: Show a Flutter page.
  • false: Remain inside the mini program.

flutterPageRoute

String

No

The unique route of the Flutter page you need to open. Specify this parameter when showFlutterPage is set to true.

extendedInfo

Map<String, String>

No

An extended attribute that is used to provide additional information if necessary.

error

BaseError

No

Common error. Specify this parameter if the request fails.

MemberInfo

Note: If the strategy request parameter is set to localUserIdOnly, specify userId only. For other strategy values, it is recommended to specify optional parameters if they are available.

Field

Data type

Required

Description

userId

String

Yes

The unique ID that is specified by the super app to identify a user.

avatar

String

No

The URL of the user's avatar.

extendedInfo

Map<String, dynamic>

No

An extended attribute that is used to provide additional information if necessary. This parameter is specified in key-value pairs with the following valid key:

  • nickName: Optional String. The user's nickname.

MemberInfoFetchResult

MemberInfoFetchResult extends the BaseServiceResult data model and includes the following declared parameters:

Field

Data type

Required

Description

memberInfo

MemberInfo

No

The actual object that contains the user information.

MemberInfoScope

Field

Data type

Required

Description

appId

String

No

The unique ID that is assigned by Mini Program Platform to identify a mini program. This parameter is specified if the user information request is from mini programs.

scopes

List<String>

No

The type of user information that is requested. The only valid value is auth_user, which indicates all available basic user information is requested. This is the default value.

extendInfo

Map<String, dynamic>

No

An extended attribute that is used to provide additional information if necessary.

OAuthResult

OAuthResult extends the BaseServiceResult data model and includes the following declared parameters:

Field

Data type

Required

Description

authCode

String

Yes

The authorization code that is generated by the super app.

authErrorScopes

Map<String, String>

No

The authorization scopes that are failed to be granted. The parameter value is in the key-value format. The key is the scope and the value is a numeric error code that is specified in the Error codes section of OAuthService. For example, "auth_user":"1000".

Specify this parameter if any requested scopes are denied.

authSuccessScopes

List<String>

No

The authorization scopes that are successfully granted. Specify this parameter if any requested scopes are granted.

OAuthScopeQueryResult

OAuthScopeQueryResult extends the BaseServiceResult data model and includes the following declared parameters:

Field

Data type

Required

Description

authorizedScopes

List<String>

Yes

A list of scopes that the super app supports. The super app can implement and define the scopes to meet your specific requirements. However, it is recommended to follow the guidelines and implement the values that are stated in the Scopes section of OAuthService.

PaymentRequest

Field

Data type

Required

Description

type

PaymentType

Yes

The type of payment certificate. Valid values are:

  • orderId: A unique ID that identifies an order.
  • paymentId: A unique ID that identifies a payment.
  • cashierUrl: The URL of the cashier page.
  • orderStr: A string of complete payment parameters.

paymentString

String

Yes

The payment certificate, which corresponds to the value of the type parameter.

PaymentResult

PaymentResult extends the BaseServiceResult data model and includes the following declared parameters:

Field

Data type

Required

Description

resultCode

String

Yes

The result code for the payment request. Valid values are:

  • CODE_PENDING: The payment is pending. The underlying result code is 8000 (PAY_PENDING).
  • CODE_FAILURE: The payment has failed. The underlying result code is 4000 (PAY_FAILURE).
  • CODE_SUCCESS: The payment has succeeded. The underlying result code is 9000 (PAY_SUCCESS).
  • CODE_USER_CANCEL: The user cancels the payment. The underlying result code is 6001 (USER_CANCEL).

resultMessage

String

No

The result message for the payment request.

ScannerOption

Field

Data type

Required

Description

type

ScannerCodetype

Yes

The type of code that the mini program requests to scan. Valid values are:

  • qrCode: The mini program requests to scan a QR code. This is the default value.
  • barCode: The mini program requests to scan a barcode.

hideAlbum

bool

Yes

Whether the mini program needs to display an album entry on the code scan page for users to read and scan from albums. Valid values are:

  • true: The mini program does not need to display an album entry.
  • false: The mini program needs to hide an album entry.

The value defaults to false.

extendedInfo

Dictionary<String,String>

No

An extended attribute that is used to provide additional information if necessary.

ScannerResult

ScannerResult extends the BaseServiceResult data model and includes the following declared parameters:

Field

Data type

Required

Description

code

String

No

The scan result, which is a code string extracted from the QR code or barcode image. Specify this parameter if the scanning operation is successful. Return null if scan error happens.