Postman
Postman ile Paylox API'yi test etmek için hazır collection ve environment dosyaları.
Collection dosyası: paylox-api.postman_collection.json
Hızlı Başlangıç
- Postman indirin ve kurun
- Collection dosyasını indirip import edin
- Environment değişkenlerini ayarlayın
- İstekleri çalıştırın
Environment Değişkenleri
Postman'de yeni bir environment oluşturun ve aşağıdaki değişkenleri ekleyin:
| Değişken | Sandbox Değeri | Production Değeri |
|---|---|---|
base_url | https://testapi.jetcheckout.com/api/v1 | https://api.jetcheckout.com/api/v1 |
api_key | Sandbox API Key'iniz | Production API Key'iniz |
session_id | (otomatik doldurulur) | (otomatik doldurulur) |
Collection İstekleri
1. Session Oluştur
| Alan | Değer |
|---|---|
| Method | POST |
| URL | {{base_url}}/embedded/session |
| Body | Aşağıdaki JSON |
{
"merchant_api_key": "{{api_key}}",
"amount": 15000,
"currency": "TRY",
"customer": {
"name": "Test",
"surname": "Kullanici",
"email": "[email protected]"
},
"success_url": "https://example.com/success",
"fail_url": "https://example.com/fail"
}
Post-response Script (session_id'yi otomatik kaydet):
if (pm.response.code === 200) {
var data = pm.response.json();
pm.environment.set("session_id", data.session_id);
}
2. Taksit Sorgula
| Alan | Değer |
|---|---|
| Method | POST |
| URL | {{base_url}}/payment/installment |
{
"session_id": "{{session_id}}",
"bin_number": "538888",
"amount": 15000
}
3. Ödeme Yap
| Alan | Değer |
|---|---|
| Method | POST |
| URL | {{base_url}}/payment/pay |
{
"session_id": "{{session_id}}",
"payment_type": "creditcard",
"card_holder_name": "TEST KULLANICI",
"card_number": "5388880000000055",
"expire_month": "12",
"expire_year": "2030",
"cvc": "000",
"is_3d": false,
"installment_count": "1"
}
4. Ödeme Durumu
| Alan | Değer |
|---|---|
| Method | GET |
| URL | {{base_url}}/payment/status/{{order_id}}?session_id={{session_id}} |
İpuçları
- Sandbox ortamında test kartlarını kullanın
- Post-response script'leri ile değişkenleri otomatik kaydedin
- Collection Runner ile toplu test çalıştırabilirsiniz