コード例 #1
0
 def goods_detail(self, value):
     if isinstance(value, list):
         self._goods_detail = list()
         for i in value:
             if isinstance(i, GoodsDetail):
                 self._goods_detail.append(i)
             else:
                 self._goods_detail.append(GoodsDetail.from_alipay_dict(i))
コード例 #2
0
    client = DefaultAlipayClient(alipay_client_config=alipay_client_config,
                                 logger=logger)
    """
    系统接口示例:alipay.trade.pay
    """
    # 对照接口文档,构造请求对象
    model = AlipayTradePayModel()

    #  支付授权码
    model.auth_code = "282877775259787048"

    # 订单描述 可选
    model.body = "Iphone6 16G"
    # goods_list 订单所含商品列表 可选
    goods_list = list()
    goods1 = GoodsDetail()
    goods1.goods_id = "apple-01"
    goods1.goods_name = "ipad"
    goods1.price = 10
    goods1.quantity = 1
    goods_list.append(goods1)
    model.goods_detail = goods_list

    # 商户操作员编号 可选
    model.operator_id = "yx_001"

    # 商户订单号 必填
    model.out_trade_no = "20180510AB014"

    # 产品码 可选
    model.product_code = "FACE_TO_FACE_PAYMENT"