5) Mobil Ödeme Oluşturma
API hesabına sahip üye işyerleri, aşağıdaki yönergeler ile mobil ödeme işlemi oluşturma isteği gönderebilirler.
post
https://api.paym.es
/v4.6/order_create
order_create
Hash oluşturma işlemi sırasıyla orderId + price + currency + productName + buyerName + buyerPhone + buyerEmail + buyerAddress + secretKey alanlarının string biçiminde ard arda eklenmesi ve elde eliden string'in SHA512 (SHA1 512) ile hash çıktısının alınması, bu çıktının ise base64 ile encode edilmesi ile oluşturulur.
Örneğin aşağıdaki değerler kullanılarak bir hash değeri oluşturulsun:
orderId = "123456789";
price = "1050";
currency = "TRY";
productName = "Ürün İsmi";
buyerName = "Mehmet Yılmaz";
buyerPhone = "05555555555";
buyerEmail = "[email protected]";
buyerAddress = "Örnek adres bilgisi";
secretKey = "111111111";
Bu değişkenler, string concat methodu ile birleştirildiğinde, aşağıdaki gibi bir string elde edilir:
str = orderId + price + currency + productName + buyerName + buyerPhone + buyerEmail + buyerAddress + secretKey;
str = "1234567891050TRYÜrün İsmiMehmet Yılma[email protected]Örnek adres bilgisi111111111";
Bu string'i SHA512 yöntemi ile hashler ve çıktıyı base64 ile encode edilir ise çıktı şu biçimde olacaktır:
hash = "knYih0b6Nrvqvw7yxtt5H9Tb6kkH7RJkYlB450FziSBKfx0q2eZACHLi+ZexDZKcs9rxJ//QCmoaq12LaI5+3g==";
Hash değerini hatalı gönderildiği taktirde istek başarısız olacaktır.
Last modified 10mo ago