Я проверял его на предмет действующей карты, а также несколько раз воссоздавал ключи транзакции, но это беспомощно.
Я проверил все форумы по этому поводу.
У меня есть ошибка кода 007, которая гласит:
Публикация идентификатор входа в API реального аккаунта и ключ транзакции в тестовую среду по адресу https://apitest.authorize.net/xml/v1/request.api. Для реальных учетных записей отправьте сообщение по адресу https://api.authorize.net/xml/v1/request.api.
Размещение идентификатора входа в API тестовой учетной записи и ключа транзакции в действующую среду по адресу https://api. .authorize.net/xml/v1/request.api. Для тестовых учетных записей отправьте сообщение по адресу https://apitest.authorize.net/xml/v1/request.api.
Идентификатор входа в API или ключ транзакции содержат ошибки.
Я уверен, что все мои учетные данные верны. правильно, я проверял это 100 раз.
прежде всего я создаю платежный профиль клиента, если он еще не существует
def create_customer_profile(cls, user: User, merchant_auth):
if not user.customer_profile_id:
customer_data = {
"merchantCustomerId": str(user.id),
"email": user.email,
}
create_customer_profile = apicontractsv1.createCustomerProfileRequest()
create_customer_profile.merchantAuthentication = merchant_auth
create_customer_profile.profile = apicontractsv1.customerProfileType(
**customer_data
)
controller = createCustomerProfileController(create_customer_profile)
controller.execute()
response = controller.getresponse()
if response.messages.resultCode == "Ok":
user.customer_profile_id = response.customerProfileId
user.save()
return response.customerProfileId
else:
raise TransactionCanceled(
message=str(response.messages.message[0]["text"].text)
)
return user.customer_profile_id
после этого я пытаюсь создать платежный профиль клиента со всеми данными кредитной карты и платежными данными
@classmethod
def create_customer_payment_profile(
cls, card_details, billing_address, user: User, default: bool
):
merchant_auth = cls.merchant_auth()
payment = apicontractsv1.paymentType()
credit_card = apicontractsv1.creditCardType()
credit_card.cardNumber = card_details["card_number"]
credit_card.expirationDate = card_details["mm_yy"]
credit_card.cardCode = card_details["cvv"]
payment.creditCard = credit_card
profile = apicontractsv1.customerPaymentProfileType()
profile.payment = payment
profile.billTo = apicontractsv1.customerAddressType()
profile.billTo.address = billing_address["address_1"]
profile.billTo.city = billing_address["city"]
profile.billTo.state = billing_address["state"]
profile.billTo.zip = billing_address["postal_code"]
create_payment_profile_request = (
apicontractsv1.createCustomerPaymentProfileRequest()
)
create_payment_profile_request.merchantAuthentication = merchant_auth
create_payment_profile_request.paymentProfile = profile
create_payment_profile_request.customerProfileId = str(
cls.create_customer_profile(user, merchant_auth)
)
create_payment_profile_request.defaultPaymentProfile = default
controller = createCustomerPaymentProfileController(
create_payment_profile_request
)
controller.execute()
response = controller.getresponse()
return response.customerPaymentProfileId
Тело как?
{
"payment_method": {
"card_holder": "name surname",
"card_number": "valid card numbers",
"mm_yy": "valid exp",
"cvv": "valid cvv"
},
"billing_address": {
"address_1": "valid adr1",
"city": "valid City",
"state": "valdi state",
"postal_code": "valid postal_code"
}
}
Подробнее здесь: https://stackoverflow.com/questions/788 ... tication-v
Authorize.Net выдает сообщение «Ошибка аутентификации пользователя из-за неверных значений аутентификации», но работает ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение