NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

public ActionResult callback()
{
try
{
// ####### Bu kısımda herhangi bir değişiklik yapmanıza gerek yoktur. #######
//
// POST değerleri ile hash oluştur.
string merchant_oid = Request.Form["merchant_oid"];
string status = Request.Form["status"];
string total_amount = Request.Form["total_amount"];
string hash = Request.Form["hash"];

string Birlestir = string.Concat(merchant_oid, merchant_salt, status, total_amount);
HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(merchant_key));
byte[] b = hmac.ComputeHash(Encoding.UTF8.GetBytes(Birlestir));
string token = Convert.ToBase64String(b);

// Oluşturulan hash'i, paytr'dan gelen post içindeki hash ile karşılaştır (isteğin paytr'dan geldiğine ve değişmediğine emin olmak için)
// Bu işlemi yapmazsanız maddi zarara uğramanız olasıdır.
if (hash.ToString() != token)
{
Response.Write("PAYTR notification failed: bad hash");
return View();
}

//###########################################################################

// BURADA YAPILMASI GEREKENLER
// 1) Siparişin durumunu $post['merchant_oid'] değerini kullanarak veri tabanınızdan sorgulayın.
// 2) Eğer sipariş zaten daha önceden onaylandıysa veya iptal edildiyse echo "OK"; exit; yaparak sonlandırın.

if (status == "success")
{ //Ödeme Onaylandı

// Bildirimin alındığını PayTR sistemine bildir.
Response.Write("OK");

// BURADA YAPILMASI GEREKENLER ONAY İŞLEMLERİDİR.
// 1) Siparişi onaylayın.
// 2) iframe çağırma adımında merchant_oid ve diğer bilgileri veri tabanınıza kayıp edip bu aşamada karşılaştırarak eğer var ise bilgieri çekebilir ve otomatik sipariş tamamlama işlemleri yaptırabilirsiniz.
// 2) Eğer müşterinize mesaj / SMS / e-posta gibi bilgilendirme yapacaksanız bu aşamada yapabilirsiniz. Bu işlemide yine iframe çağırma adımında merchant_oid bilgisini kayıt edip bu aşamada sorgulayarak verilere ulaşabilirsiniz.
// 3) 1. ADIM'da gönderilen payment_amount sipariş tutarı taksitli alışveriş yapılması durumunda
// değişebilir. Güncel tutarı Request.Form['total_amount'] değerinden alarak muhasebe işlemlerinizde kullanabilirsiniz.

}
else
{
//Ödemeye Onay Verilmedi

// Bildirimin alındığını PayTR sistemine bildir.
ViewBag.Sonuc = "OK";

// BURADA YAPILMASI GEREKENLER
// 1) Siparişi iptal edin.
// 2) Eğer ödemenin onaylanmama sebebini kayıt edecekseniz aşağıdaki değerleri kullanabilirsiniz.
// $post['failed_reason_code'] - başarısız hata kodu
// $post['failed_reason_msg'] - başarısız hata mesajı
}
}
catch (Exception)
{
ViewBag.Sonuc = "ERROR";
Response.Write("ERROR");
}
return View();
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.