Working flow authorize

This commit is contained in:
2025-09-16 12:45:22 -04:00
parent 47e3fb443b
commit 630584512e
5 changed files with 132 additions and 61 deletions

View File

@@ -106,7 +106,8 @@ def create_customer_profile(customer: schemas.Customer, card_info: schemas.CardC
paymentProfile = apicontractsv1.customerPaymentProfileType(
billTo=billTo,
payment=apicontractsv1.paymentType(creditCard=creditCard)
payment=apicontractsv1.paymentType(creditCard=creditCard),
defaultPaymentProfile=True
)
customerProfile = apicontractsv1.customerProfileType(
@@ -187,7 +188,8 @@ def add_payment_profile_to_customer(customer_profile_id: str, customer: schemas.
paymentProfile = apicontractsv1.customerPaymentProfileType(
billTo=billTo,
payment=apicontractsv1.paymentType(creditCard=creditCard)
payment=apicontractsv1.paymentType(creditCard=creditCard),
defaultPaymentProfile=True
)
request = apicontractsv1.createCustomerPaymentProfileRequest(
@@ -230,10 +232,9 @@ def authorize_customer_profile(customer_profile_id: str, payment_profile_id: str
merchantAuth = apicontractsv1.merchantAuthenticationType(name=API_LOGIN_ID, transactionKey=TRANSACTION_KEY)
profile_to_authorize = apicontractsv1.profileTransAuthOnlyType(
customerProfileId=customer_profile_id,
paymentProfileId=payment_profile_id
)
profile_to_authorize = apicontractsv1.customerProfilePaymentType()
profile_to_authorize.customerProfileId = customer_profile_id
profile_to_authorize.customerPaymentProfileId = payment_profile_id
transactionRequest = apicontractsv1.transactionRequestType(
transactionType="authOnlyTransaction",
@@ -274,4 +275,4 @@ def capture_authorized_transaction(transaction_req: schemas.TransactionCapture):
controller = createTransactionController(createtransactionrequest)
controller.execute()
return controller.getresponse()
return controller.getresponse()