You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I want to understand the concept of the Iyzico and I have experienced some issue and I hope you can help me out.
1- SSL:
I had to use this to overcome SSL cerficaition problem.
Terminal code:
/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)
However, it is not valid approach for production environment.
2- Working pipeline of Iyzico and models. To understand better I created a visualization:
So what we need to create payment: payment_card, buyer, address and basket_items. These and options creates inside of "iyzipay.Payment().create". However, I still did not get how the process goes. So I also created visual for that:
In samples folder, there is no a simple way of usage I can find. Please help me to find where is this simple process:
1- User comes, selects item, add basket. (So far, it is easy)
2- User goes to checkout, enter credit card info, clicks PayNow(we are assuming), then this information goes to Iyzico. After this, including this, I am lost. Which parameters I useful? How do I check return of Iyzico? I believe we need to confirm some tokens. There are files in the samples folder but there is not any directive guide how to use them.
Problems I am having is lack of direction actually.
Iyzico needs Bin number, why? How do we use them?
What is working pipeline of 3D and non-3D secure?
What are their differences in code-wise?
Where the conversation IDs are created?
Can we generate our unique conversation IDs and baskedIDs? Is there any format we should be take care of for not get fail by Iyzico?
To able to mimic sample code in first page, XXX, I did this:
def r_(barcode, report = True):
if report == True:
print("Current Barcode:", str(barcode))
@router.post("/api/pay", tags=["payments"])
async def create_payment(payment_request: PaymentCardModel,
current_user: dict = Depends(get_current_user)):
print("-----------------")
print("Current User:", current_user["email_DB"])
try:
r_(1)
current_payment_request = payment_request.model_dump()
print("Current Payment Request Dict:", current_payment_request)
r_(2)
# Assuming `test_Buyer`, `test_Address`, and `test_BasketItem` are already populated correctly
# Convert the single basket item to a list for the basketItems field
basket_items_list = [test_BasketItem.model_dump()]
# Structure merged_data with the correct field names and data
merged_data = {
"paymentCard": test_card.model_dump(), # Directly assigning the dictionary of payment card details
"buyer": test_Buyer.model_dump(), # Assuming this returns a dictionary of buyer details
"shippingAddress": test_Address.model_dump(), # Assuming this returns a dictionary of address details
"billingAddress": test_Address.model_dump(), # Re-using the same address for billing; adjust as needed
"basketItems": basket_items_list, # Assigning the list of basket item dictionaries
# Add any other missing fields required by PaymentRequestModel here
}
request = PaymentRequestModel(**merged_data).model_dump()
print("Current request:", request)
r_(3)
payment_response = iyzipay.Payment().create(request, options)
print("Payment Response:", payment_response)
r_(4)
payment_response = json.loads(payment_response.read().decode('utf-8'))
print("Payment Response:", payment_response)
r_(5)
if payment_response.get("status") == "success":
r_(6)
# Handle successful payment
return {"status": "Success", "message": "Payment successful", "paymentResponse": payment_response}
else:
r_(7)
# Handle payment failure
return {"status": "Failure", "message": "Payment failed", "paymentResponse": payment_response}
except HTTPException as e:
return {"status": "Failure", "message": "Payment failed", "paymentResponse": e.detail}
Do not mind the current_user because it is about auth. system of user. That part works. But I send information directly from test data as you can see. This is so weird: "Payment Response: {'status': 'failure', 'errorCode': '1000', 'errorMessage': 'Geçersiz imza', 'locale': 'tr', 'systemTime': 1709401195452, 'conversationId': '123456789'}"
Hi,
I want to understand the concept of the Iyzico and I have experienced some issue and I hope you can help me out.
1- SSL:
I had to use this to overcome SSL cerficaition problem.
Terminal code:
To overcome this issue, I temporarily did this:
However, it is not valid approach for production environment.
2- Working pipeline of Iyzico and models. To understand better I created a visualization:
So what we need to create payment: payment_card, buyer, address and basket_items. These and options creates inside of "iyzipay.Payment().create". However, I still did not get how the process goes. So I also created visual for that:
In samples folder, there is no a simple way of usage I can find. Please help me to find where is this simple process:
1- User comes, selects item, add basket. (So far, it is easy)
2- User goes to checkout, enter credit card info, clicks PayNow(we are assuming), then this information goes to Iyzico. After this, including this, I am lost. Which parameters I useful? How do I check return of Iyzico? I believe we need to confirm some tokens. There are files in the samples folder but there is not any directive guide how to use them.
Problems I am having is lack of direction actually.
Iyzico needs Bin number, why? How do we use them?
What is working pipeline of 3D and non-3D secure?
What are their differences in code-wise?
Where the conversation IDs are created?
Can we generate our unique conversation IDs and baskedIDs? Is there any format we should be take care of for not get fail by Iyzico?
To able to mimic sample code in first page, XXX, I did this:
and I used these models:
However, result was:
Do not mind the current_user because it is about auth. system of user. That part works. But I send information directly from test data as you can see. This is so weird:
"Payment Response: {'status': 'failure', 'errorCode': '1000', 'errorMessage': 'Geçersiz imza', 'locale': 'tr', 'systemTime': 1709401195452, 'conversationId': '123456789'}"
I tried to be specific as much as I can. You can check my current code: https://github.com/OrcunSamiTandogan/paymentSystem
I will be so glad, if you can help me out.
Best!
Systems:
python 3.10.11
Macbook M2.
VScode.
Backend: FastAPI
Frontend: React
Database: MongoDB (not integrated yet)
annotated-types==0.6.0
anyio==4.2.0
bcrypt==4.1.2
cachetools==5.3.2
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
cryptography==42.0.3
dnspython==2.6.0
exceptiongroup==1.2.0
fastapi==0.109.2
google-auth==2.28.0
h11==0.14.0
httpcore==1.0.3
httpx==0.26.0
idna==3.6
jwt==1.3.1
passlib==1.7.4
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycparser==2.21
pydantic==2.6.1
pydantic_core==2.16.2
PyJWT==2.8.0
pymongo==4.6.1
python-multipart==0.0.9
requests==2.31.0
rsa==4.9
sniffio==1.3.0
starlette==0.36.3
typing==3.7.4.3
typing_extensions==4.9.0
urllib3==1.26.7
uuid==1.30
uvicorn==0.27.1
numpy
boto3==1.28.57
botocore==1.31.57
python-dotenv
services
iyzipay
certifi
The text was updated successfully, but these errors were encountered: