auto static method
Implementation
static GeneralPaymentAuth auto({
required String paymentGatewayApiKey,
required String paymentGatewayOwnerId,
}) {
if (RegExp(r"^(xnd_(development|production)_)", caseSensitive: false)
.hasMatch(paymentGatewayApiKey)) {
return GeneralPaymentAuth.xendit(
xenditOwnerId: paymentGatewayOwnerId,
xenditApiKey: paymentGatewayApiKey,
);
}
return GeneralPaymentAuth(
apiKey: "",
ownerId: paymentGatewayOwnerId,
generalPaymentType: GeneralPaymentType.unknown,
);
}