feat: iap支付方式
This commit is contained in:
@@ -111,6 +111,8 @@ abstract class Api {
|
||||
/// 获取可用支付方式(公开接口)
|
||||
static const String kr_getPublicPaymentMethods = "/v1/public/payment/methods";
|
||||
|
||||
static const String kr_attachAppleIapTransaction = "/v1/public/iap/apple/transactions/attach_by_id";
|
||||
|
||||
/// 获取用户信息(用于获取邀请码等)
|
||||
static const String kr_getUserInfo = "/v1/public/user/info";
|
||||
|
||||
|
||||
@@ -329,4 +329,23 @@ class KRSubscribeApi {
|
||||
|
||||
return right(baseResponse.model);
|
||||
}
|
||||
|
||||
Future<Either<HttpError, bool>> kr_attachAppleIapTransaction(String transactionId, String orderNo) async {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['transaction_id'] = transactionId;
|
||||
data['order_no'] = orderNo;
|
||||
|
||||
BaseResponse<KRStatus> baseResponse =
|
||||
await HttpUtil.getInstance().request<KRStatus>(
|
||||
Api.kr_attachAppleIapTransaction,
|
||||
data,
|
||||
method: HttpMethod.POST,
|
||||
isShowLoading: true,
|
||||
);
|
||||
if (!baseResponse.isSuccess) {
|
||||
return left(HttpError(msg: baseResponse.retMsg, code: baseResponse.retCode));
|
||||
}
|
||||
|
||||
return right(baseResponse.model.kr_bl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user