telr payment python
1.0.0

이 모듈은 API의 TelR 결제 서비스를 구현하기위한 PIP 패키지입니다. 이 모듈을 사용하려면 PIP 명령 또는 설정을 통해 설치해야합니다.
pip install telr_payment프로젝트로 패키지 가져 오기 :
from telr_payment.api import Telr모듈을 사용하려면 예제와 문서를 살펴보십시오.
쉬운 구현을 위해 두 가지 간단한 예제를 제공했습니다. 하나는 트랜잭션 생성과 하나는 이와 같은 점검을위한 것입니다.
# order_sample.py
from telr_payment . api import Telr
from pprint import pprint
# if you dont want it to run in test mode change the test option according to docs
telr = Telr ( auth_key = "YOUR_AUTH_KEY" , store_id = "YOUR_STORE_ID" , test = 1 )
order_response = telr . order (
order_id = "ORDER_ID_TOKEN" ,
amount = 54.5 ,
return_url = "http://domain.com/path/to/url" ,
return_decl = "http://domain.com/path/to/url" ,
return_can = "http://domain.com/path/to/url" ,
description = "testing"
)
pprint ( order_response ) # check_sample.py
from telr_payment . api import Telr
from pprint import pprint
# if you dont want it to run in test mode change the test option according to docs
telr = Telr ( auth_key = "YOUR_AUTH_KEY" , store_id = "YOUR_STORE_ID" , test = 1 )
status_response = telr . status (
order_reference = "ORDER_REF_TOKEN"
)
pprint ( status_response )거래 점검 상태 표
| 주문 상태 | 설명 |
|---|---|
| 1 | 보류 중 |
| 2 | 승인 된 (인증 거래 또는 판매와 같은 거래되지 않음 보류 된 거래) |
| 3 | 유료 (거래 캡처, 판매 거래, 보류되지 않음) |
| -1 | 만료되었습니다 |
| -2 | 취소 |
| -3 | 거절했다 |
| 카드 번호 | 유형 | CVV | MPI |
|---|---|---|---|
| 4000 0000 0000 0002 | 비자 | 123 | 아니요 |
| 4111 1111 1111 1111 | 비자 | 123 | 예 |
| 4444 3333 2222 1111 | 비자 | 123 | 예 |
| 4444 4244 4444 4440 | 비자 | 123 | 예 |
| 4444 4444 4444 4448 | 비자 | 123 | 예 |
| 4012 8888 8888 1881 | 비자 | 123 | 예 |
| 5105 1051 0510 5100 | 마스터 카드 | 123 | 아니요 |
| 5454 5454 5454 5454 | 마스터 카드 | 123 | 예 |
| 5555 5555 5555 4444 | 마스터 카드 | 123 | 예 |
| 5555 5555 5555 5557 | 마스터 카드 | 123 | 예 |
| 5581 5822 2222 2229 | 마스터 카드 | 123 | 예 |
| 5641 8209 0009 7002 | Maestro UK | 123 | 예 |
| 6767 0957 4000 0005 | 독주 | 123 | 아니요 |
| 3434 343434 34343 | 아멕스 카드 | 1234 | 아니요 |
| 3566 0020 2014 0006 | JCB | 123 | 아니요 |
| 3111 1111 1111 1111 | 마다 | 123 | 아니요 |
테스트 카드와 함께 사용할 카드 보안 코드 (CVV)는 123 (American Express 제외, 1234)입니다. 승인 된 응답의 경우 다른 코드가 거부됩니다.
MPI 열에 '예'를 표시하는 카드는 시뮬레이션 된 3D 보안 인증 페이지를 사용하여 비자 또는 마스터 카드 SecureCode로 확인할 때 트랜잭션 흐름을 테스트 할 수 있습니다.
{ 'method' : 'create' ,
'order' : { 'ref' : 'ORDER_REF_TOKEN' ,
'url' : 'https://secure.telr.com/gateway/process.html?o=ORDER_REF_TOKEN' } ,
'trace' : 'xxxx/xxxx/xxxxxxxx' } {
"method" : "create" ,
"error" : {
"message" : "Exx: Error Name" ,
"note" : "Message according to error"
}
} { 'method' : 'check' ,
'order' : { 'amount' : '4.50' ,
'card' : { 'country' : 'AE' ,
'expiry' : { 'month' : x , 'year' : xxxx } ,
'first6' : 'xxxxxx' ,
'last4' : 'xxxx' ,
'type' : 'Visa Credit' } ,
'cartid' : 'ORDER_ID_TOKEN' ,
'currency' : 'AED' ,
'customer' : { 'address' : { 'city' : 'xxxxx' ,
'country' : 'AE' ,
'line1' : 'xxxx,xxx,xxx' ,
'mobile' : '1234567890' } ,
'email' : '[email protected]' ,
'name' : { 'forenames' : 'FIRST_NAME' , 'surname' : 'LAST_NAME' } } ,
'description' : 'testing' ,
'paymethod' : 'Card' ,
'ref' : 'ORDER_REF_TOKEN' ,
'status' : { 'code' : 3 , 'text' : 'Paid' } ,
'test' : 1 ,
'transaction' : { 'class' : 'ECom' ,
'code' : '924861' ,
'date' : '04 Aug 2022 12:56 GST' ,
'message' : 'Authorised' ,
'ref' : 'REF_TOKEN' ,
'status' : 'A' ,
'type' : 'sale' } } ,
'trace' : 'xxxx/xxxx/xxxxxxxx' } { 'method' : 'check' ,
'order' : { 'amount' : '54.50' ,
'cartid' : 'ORDER_ID_TOKEN' ,
'currency' : 'AED' ,
'description' : 'TRANSACTION_DESCRIPTION' ,
'ref' : 'ORDER_REF_TOKEN' ,
'status' : { 'code' : 1 , 'text' : 'Pending' } ,
'test' : 1 ,
'url' : 'https://secure.telr.com/gateway/process.html?o=ORDER_REF_TOKEN' } ,
'trace' : 'xxxx/xxxx/xxxxxxxx' } { 'method' : 'check' ,
'order' : { 'amount' : '54.50' ,
'cartid' : 'ORDER_ID_TOKEN' ,
'currency' : 'AED' ,
'description' : 'TRANSACTION_DESCRIPTION' ,
'ref' : 'ORDER_REF_TOKEN' ,
'status' : { 'code' : - 2 , 'text' : 'Cancelled' } ,
'test' : 1 } ,
'trace' : 'xxxx/xxxx/xxxxxxxx' }