I'm trying to implement a deferred payment system using authorize.net's "Authorize a Credit Card" (authorize) and "Capture a Previously Authorized Amount" (capture) functionalities with the following transaction types:
My plan is for the authorization step to place a hold on the funds without immediately charging the card, and then to process and record the charge only when the capture is executed within the 30-day validity period.
However, I’ve noticed that as soon as I call the authorize endpoint, the issuing bank immediately processes the charge and the transaction appears in the billing records—even though I haven't executed a capture yet. When I subsequently void the transaction, it refunds an already processed payment.
Could there be any account settings or API configuration issues causing the authorization to finalize the charge immediately? How can I adjust my implementation so that the charge occurs only when the capture is executed?
Any insights or suggestions would be greatly appreciated.
class TransactionType(Enum): AUTH_ONLY = "authOnlyTransaction" PRIOR_AUTH_CAPTURE = "priorAuthCaptureTransaction" @classmethod def _set_transaction_info(
cls, db: Session, dto: AuthorizedPaymentDTO, transaction_type: TransactionType, ): ... transaction_request = apicontractsv1.transactionRequestType() transaction_request.transactionType = transaction_type.value @classmethod def authorize_credit_card(
cls, auth: AuthHeader db: Session, dto: AuthorizedPaymentDTO, ) -> ProcessPaymentResponse: try: txDto = cls._set_transaction_info( db=db, dto=dto, transaction_type=TransactionType.AUTH_ONLY, ) ctrl = createTransactionController(txDto) ctrl.setenvironment(constants.constants.PRODUCTION) ctrl.execute() response: apicontractsv1.createTransactionResponse = ctrl.getresponse()
03-31-2025 04:15 PM - edited 03-31-2025 04:18 PM