attachToPaymentIntent method
- @Deprecated("Use PaymongoClient instead")
- String id,
- PaymentIntentAttach data
Attach payment intent to receive payment status.
Implementation
@Deprecated("Use PaymongoClient instead")
/// {@template attach_payment_intent}
/// Attach payment intent to receive payment status.
///
/// {@endtemplate}
Future<PaymentIntentAttachResponse> attachToPaymentIntent(
String id,
PaymentIntentAttach data,
) async {
if (id.isEmpty) {
throw ArgumentError("Payment Method ID must not be empty");
}
final options = PayMongoOptions(
path: '/payment_intents/$id/attach',
data: {
'attributes': data.toMap(),
},
);
final response = await post<Map<String, dynamic>>(options);
final result = PaymentIntentAttachResponse.fromMap(response);
return result;
}