Para yatırma
Oyuncu kasada A-ZPay/manuel banka transferini seçtiğinde para yatırma oluşturun.
İstek
POST /v1/deposits
Content-Type: application/json
X-Api-Key: pk_live_xxx
X-Timestamp: 1778940000
X-Signature: ...
{
"amount": "100.00",
"currency": "TRY",
"externalReference": "casino-deposit-1001",
"redirectUrl": "https://casino.example/cashier/deposits/1001",
"customer": {
"id": "player-42",
"username": "turbo_player",
"fullName": "Ada Yilmaz",
"email": "player@example.com"
}
}
Deposit isteği gönder
const payload = {
amount: '100.00',
currency: 'TRY',
externalReference: 'casino-deposit-1001',
redirectUrl: 'https://casino.example/cashier/deposits/1001',
customer: { id: 'player-42', username: 'turbo_player', fullName: 'Ada Yilmaz', email: 'player@example.com' },
};
const path = '/v1/deposits';
const body = JSON.stringify(payload);
const response = await fetch('https://api.azpay.example' + path, {
method: 'POST',
headers: signAZPayRequest('POST', path, body),
body,
});
const result = await response.json();
if (!response.ok) throw new Error(result.error || 'Deposit başarısız');
return result.transaction.hostedUrl;<?php
$payload = [
'amount' => '100.00',
'currency' => 'TRY',
'externalReference' => 'casino-deposit-1001',
'redirectUrl' => 'https://casino.example/cashier/deposits/1001',
'customer' => ['id' => 'player-42', 'username' => 'turbo_player', 'fullName' => 'Ada Yilmaz', 'email' => 'player@example.com'],
];
$path = '/v1/deposits';
$body = json_encode($payload, JSON_UNESCAPED_SLASHES);
$ch = curl_init('https://api.azpay.example' . $path);
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_HTTPHEADER => signAZPayRequest('POST', $path, $body), CURLOPT_POSTFIELDS => $body, CURLOPT_RETURNTRANSFER => true]);
$result = json_decode(curl_exec($ch), true);
$hostedUrl = $result['transaction']['hostedUrl'];redirectUrl zorunludur. Oyuncu Türkçe hosted sayfada Transferi gönderdim butonuna bastıktan sonra A-ZPay oyuncuyu bu adrese azpayTransactionId, azpayStatus ve externalReference query parametreleriyle geri yönlendirir.
Yanıt
{
"transaction": {
"id": "txn_...",
"type": "deposit",
"status": "waiting_payment",
"amountCents": 10000,
"requestedAmountCents": 10000,
"actualAmountCents": null,
"commissionCents": 1000,
"netAmountCents": 9000,
"playerAmountCents": 9000,
"balanceImpactCents": 9000,
"externalReference": "casino-deposit-1001",
"referenceCode": "BP-A1B2C3D4",
"redirectUrl": "https://casino.example/cashier/deposits/1001",
"hostedUrl": "https://pay.example/pay/txn_..."
}
}
Partner uygulama notları
- Oluşturma sonrası oyuncuyu hemen
hostedUrladresine yönlendirin. - Deposit tutarı A-ZPay adminlerinin belirlediği platform geneli min/max dışındaysa API
400döner ve hosted ödeme sayfası oluşturulmaz. Oyuncu para göndermeden önce cashier içinde aralık hatasını gösterin. - Sadece browser redirect oldu diye oyuncuya bakiye eklemeyin.
- Oyuncuya bakiyeyi yalnızca doğrulanmış
deposit.approvedwebhook’u sonrası ekleyin. - Gerçek banka transferi talep edilen
amountdeğerinden farklı olabilir. Gelen brüt tutar içinactualAmountCents, oyuncuya kredilenecek bakiye içinplayerAmountCentskullanın. - Orijinal talep edilen
amountCentsyerineplayerAmountCentsdeğerini kredileyin.
Para yatırma durumları
waiting_payment: işlem oluşturuldu; müşteri transfer gönderildi butonuna basmadı.waiting_confirmation: müşteri butona bastı; A-ZPay operatörü onaylamalı veya reddetmelidir.approved: operatör parayı doğruladı; webhook gönderildi.rejected: operatör reddetti; webhook gönderildi.