You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
2.2 KiB

*** Settings ***
Library urllib3
Library String
Library Collections
Library RequestsLibrary
Library DatabaseLibrary
*** Keywords ***
查询${dating}权益列表
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating dating-agency-mall/user/page/product/by/customer params={}
${records} Get From Dictionary ${reps.json()['data']} records #权益购买列表
END
购买${dating}项目的学历权益
#选择学历权益
FOR ${equity} IN @{records}
${subCategory} Get From Dictionary ${equity} subCategory #产品名称
${productSpecId} Get From Dictionary ${equity} productSpecId #权益规格id
${unitSellingPrice} Get From Dictionary ${equity} unitSellingPrice #产品现价
Exit For Loop If ${subCategory}==101 #学历认证权益:101
END
Set Global Variable ${productSpecId}
Set Global Variable ${unitSellingPrice}
#创建订单
FOR ${miId} ${client_header} IN ZIP ${miId_list} ${Cheader_list}
Create Session dating' ${${dating}.dating域名} ${client_header}
${orderData} Set Variable {"miId":"${miId}","productSpecId":"${productSpecId}"}
${reps} POST On Session dating dating-agency-mall/user/submit/order ${orderData.encode('utf-8')}
${orderId} Get From Dictionary ${reps.json()['data']} orderId #订单id
${paymentOrderId} Get From Dictionary ${reps.json()['data']} paymentOrderId #第三方支付单id
Set Global Variable ${orderId}
Set Global Variable ${paymentOrderId}
END
#支付订单
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${payData} Set Variable {"paymentOrderId":"${paymentOrderId}","paymentMethod":1}
${reps} POST On Session dating dating-agency-mall/user/pre-pay/third-party ${payData.encode('utf-8')}