是否可以从Flutter更改Razorpay状态?我正在为我的应用程序使用razorpay,在获得成功状态后,Razorpay支付的状态是“授权”。我需要将此状态更改为“已捕获”。
hkmswyz61#
可以,您可以使用capture API /payments/:id/capture转换状态。来源
capture
/payments/:id/capture
import 'package:http/http.dart' as http; import 'dart:convert'; final paymentId = 'your_payment_id'; final apiKey = 'your_razorpay_api_key'; final url = 'https://api.razorpay.com/v1/payments/$paymentId/capture'; final response = await http.post( Uri.parse(url), headers: { 'Authorization': 'Basic ' + base64Encode(utf8.encode('$apiKey:')), 'Content-Type': 'application/json', }, ); if (response.statusCode == 200) { // Payment captured successfully } else { // Error occurred while capturing payment }
1条答案
按热度按时间hkmswyz61#
可以,您可以使用
capture
API/payments/:id/capture
转换状态。来源