Ödeme Doğrulama


PreAuth ödemede sistemde Ön-Provizyon/Pre-Authorization olarak işlem oluşturulur. Bu işlemi Başarısız/Failed veya Başarılı/Completed yapmak için aşağıdaki istek parametreleri kullanılarak bu API çağrılmalıdır.

Method URL İçerik-Türü
Post /api/confirmPayment application/json

URL

URL
https://app.iqmoneytr.com/ccpayment/api/confirmPayment

Parametreler

Tür Parametreler Data Türü Şart
HEADER Authorization string Zorunlu
HEADER Accept string Zorunlu
HEADER invoice_id string Zorunlu
KEY merchant_key string Zorunlu
KEY status string Zorunlu
KEY hash_key string Zorunlu
KEY total double Opsiyone

Authorization

Authorization bağlantı girişimine izin verildiğini doğrulayan bir başlık anahtarıdır. Method “Bearer” olmalıdır.

Örnek Veri


Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Im
RlMGVlZGFiZjdhZDhkODYzYTgyMzQ4Nzk5NTFkYzFlMDZkZ
TUxYjU0NWRjYmU3MzRjMmQ1OGNkMWFlOWE4YjliZTkyMjd
lZGVmZDdlMDliIn0.eyJhdWQiOiIxNSIsImp0aSI6ImRlMGVlZGF
iZjdhZDhkODYzYTgyMzQ4Nzk5NTFkYzFlMDZkZTUxYjU0NWR
jYmU3MzRjMmQ1OGNkMWFlOWE4YjliZTkyMjdlZGVmZDdlMD
liIiwiaWF0IjoxNTczNzUyNDcyLCJuYmYiOjE1NzM3NTI0NzIsImV
4cCI6MTYwNTM3NDg3Miwic3ViIjoiMSIsInNjb3BlcyI6W119.mDtd
zcv15p8SnYjZYJUJrhdskO5NohXbkcAxKWWZ72lNtrg86RZ1yxQwf
QlRu6IPoa1rfG3M4jfsNeH
    

Acceept

Accept ,müşteri tarafında ne tür bir temsilin istendiğini belirler. Değer "application / json" olmalıdır.

invoice_id

invoice_id üye iş yeri tarafından gönderilen eşsiz sipariş id'sidir.

merchant_key

merchant_key Iqmoney tarafından üye iş yerine sağlanan eşsiz bir anahtardır.

status

status 1 veya 2 şeklinde olabilir (1=onaylandı, 2 = iptal)

total

toplam parametrenin değeri, preauth/ön doğrulama işleminin ürün fiyatından küçük veya ona eşit olmalıdır

hash_key

hash_key, giriş değeri kullanılarak üretilmesi gereken benzersiz bir anahtardır. hash_key oluşturmak için method aşağıdaki gibidir

	private function generateCashOutAPIHashKey($sum_of_amount_column, $first_row_iban,
$first_row_amount, $first_row_currency, $first_row_gsm, $app_secret ){

    //remove plus(+) sign from gsm number.
    $data = $sum_of_amount_column.'|'.$first_row_iban.'|'.$first_row_amount.'|'.$first_row_currency.'|'.$first_row_gsm;

    $iv = substr(sha1(mt_rand()), 0, 16);
    $password = sha1($app_secret);

    $salt = substr(sha1(mt_rand()), 0, 4);
    $saltWithPassword = hash('sha256', $password . $salt);

    $encrypted = openssl_encrypt(
        "$data", 'aes-256-cbc', "$saltWithPassword", null, $iv
    );
    $msg_encrypted_bundle = "$iv:$salt:$encrypted";
    $hash_key = str_replace('/', '__', $msg_encrypted_bundle);
    return $hash_key;
}
    

Başarısız Yanıt


  {
    "status_code": 105,
    "status_description": " The transaction is not Approved",
    "transaction_status": "Pending",
    "order_id": "162435924998223",
    "invoice_id": "50781624359247
}
	

Başarılı Yanıt


  {
    "status_code": 105,
    "status_description": " The transaction is not Approved",
    "transaction_status": "Pending",
    "order_id": "162435924998223",
    "invoice_id": "50781624359247
}