import 'dart:convert';

import 'package:json_annotation/json_annotation.dart';

part 'wechat_payment_sign_bean.g.dart';

@JsonSerializable()
class WechatPaymentSignBean {
  @JsonKey(name: 'appid')
  String appId;

  @JsonKey(name: 'noncestr')
  String nonceStr;

  @JsonKey(name: 'package')
  String package;

  @JsonKey(name: 'partnerid')
  String partnerId;

  @JsonKey(name: 'prepayid')
  String prepayId;

  @JsonKey(name: 'sign')
  String sign;

  @JsonKey(name: 'timestamp')
  String timeStamp;

  WechatPaymentSignBean({
    this.appId = '',
    this.nonceStr = '',
    this.package = '',
    this.partnerId = '',
    this.prepayId = '',
    this.sign = '',
    this.timeStamp = '',
  });

  static WechatPaymentSignBean stringToBean(String jsonStr) {
    final Map<String, dynamic> json = jsonDecode(jsonStr);
    return WechatPaymentSignBean.fromJson(json);
  }

  factory WechatPaymentSignBean.fromJson(Map<String, dynamic> json) =>
      _$WechatPaymentSignBeanFromJson(json);
}
