**申请退款需要两步接口**
1.加载订单信息
~~~
/plugins/printer/api/v1_order_refund_apply_option.php
~~~
* id 订单ID
返回结果参考:
~~~
{
"data": {
"id": "4",
"order_num": "P2022031604470",
"ori_total_price": null,
"num": "1",
"total_price": "0.03",
"desc": null,
"from": null,
"user_id": "5",
"status": "20",
"type": "3",
"user_address": "[]",
"created_at": "2022-03-16 17:53:31",
"paid_time": null,
"shop_id": "1",
"par1": {
"shop_id": "1",
"shop_name": "演示",
"printer_id": "1",
"printer_name": "演示打印机"
},
"par2": [],
"refund_amount": null,
"earn_amount": null,
"tag": "printer",
"store_id": null,
"detail": [{
"id": "4",
"order_id": "4",
"num": "1",
"product_id": "0",
"product_name": "tmp_2142af7d42474d9d1fd8aa0006711e07.docx",
"product_num": "",
"product_price": "0.03",
"product_line_price": null,
"product_img": "https:// /uploads/22e0146a7553.docx",
"par1": {
"dmColor": "2",
"deviceId": "lc01cy39959900",
"dmCopies": 1,
"dmDuplex": "1",
"isPreview": 0,
"ddeviceKey": "X5wrpsNooBTLc92M",
"devicePort": 1,
"htmlKernel": "chrome",
"callbackUrl": "https:....plugins\/printer\/api/v1_printer_callback.php",
"dmMediaType": 1,
"dmPaperSize": 9,
"jpPageRange": 1,
"duplexAction": "rev",
"printerModel": "Canon GX6000 series",
"dmOrientation": "1",
"dmPrintQuality": -4,
"dmDefaultSource": 1
},
"par2": {
"pages": 1
},
"amount": null,
"total_price": "0.03"
}],
"status_txt": "已支付",
"can_refund_amount": "0.03"
},
"can_fee": "0.03",
"option": ["打印机缺纸", "打印效果差", "打印机缺纸", "打印效果差", "打印机缺纸", "打印效果差"],
"code": 0,
"type": "success"
}
~~~
2.提交申请
~~~
/plugins/printer/api/v1_order_refund_apply.php
~~~
* id 订单ID
* amount 申请退款金额 单位元
* desc 原因
* text 备注