admin管理员组文章数量:1399919
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()```
本文标签: pythonauthorizenet authOnlyTransaction immediately charges customer39s cardStack Overflow
版权声明:本文标题:python - authorize.net authOnlyTransaction immediately charges customer's card - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744160884a2593329.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论