I'm trying to implement a deferred payment system using authorize's "Authorize a Credit Card" (authorize) and "Capture a Previously Authorized Amount" (capture) functionalities with the following transaction types:
- Authorization: authOnlyTransaction
- Capture: priorAuthCaptureTransaction
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: ProcessPaymentDTO,
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()```