purchaseIos static method
购买iOS的商品
Implementation
static Future<AWResponseModel<AWOrder>> purchaseIos(AWProduct product) async {
// 需要把product解析成安卓需要的数据格式
final iosString = product.toIosJson();
var result =
await _channel.invokeMethod('purchase', {"product": iosString});
final model = getResponseModel(result);
if (!model.result) {
return AWResponseModel.sendFailed(model.msg);
}
final purchaseInfo = AWOrder.fromIosJson(model.data);
return AWResponseModel.sendSuccess(purchaseInfo);
}