API Dokümantasyonu

API Uç Noktaları ve Kimlik Doğrulaması

All requests to the Digital Wallet API are sent via the HTTP POST method to one of our API endpoint URLs.

All calls to the Digital Wallet API require merchant authentication and merchant access key. Sign up for a account to quickly get started.
Sandbox payment can be also initiated while merchant set the service mode as test in merchant dashboard. It will be live while the mode will be set as active mode.

API Access Key

Register as a merchant in our system. In your merchant dashboard you will find the option for API access key.

Example access key : 51a4bd18-5bc1-4eaa-97b0-c09323398883

Payment Transaction Initiate

Aşağıdaki örnek kod, nasıl yapılandırdığınıza bağlı olarak bir ödeme başlatmanıza olanak tanır. Perametre detayları da aşağıdadır.

Parametre Adı Parametre Türü Tanım
custom string Sonunuzun belirlenmesi Gerekli
amount decimal İşlem yapmak istediğiniz tutar Gerekli
details string Satınalma detayları String Max 255
web_hook string Anında ödeme bildirimi URL'si Gerekli
cancel_url string Ödeme iptali iade URL'si Gerekli
success_url string Ödeme başarılı dönüş URL'si Gerekli
customer_email string Müşteri e-posta adresi Gerekli
access_key string Access_key'i başlıkla birlikte taşıyıcı belirteci olarak gönder Gerekli
                                
    
            <?php
                $parameters = [
                    'custom' => 'DFU80XZIKS',
                    'currency_code' => 'USD',
                    'amount' => 280.00,
                    'details' => 'Digital Product',
                    'web_hook' => 'http://yoursite.com/web_hook.php',
                    'cancel_url' => 'http://yoursite.com/cancel_url.php',
                    'success_url' => 'http://yoursite.com/success_url.php',
                    'customer_email' => 'customer@mail.com',
                ];
                
                $url = 'http://yourwallet.com/payment/process';
                
                $headers = [
                    "Accept: application/json",
                    "Authorization: Bearer access_key",
                ];
                
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_POSTFIELDS,  http_build_query($parameters));
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                $response = curl_exec($ch);
                curl_close($ch);
            ?>
    
                            

Örnek Ödeme başlatıldıktan sonraki yanıt

                                
        
        
            //Success Response.
            {
                "code": 200,
                "status": "ok",
                "payment_id": "AIYmQIOAz0GlmsjfhgiOeu304",
                "message": "Your payment has been processed. Please follow the URL to complete the payment.",
                "url":"https://wallet.tooyour.com/process-checkout?payment_id=AIYmQIOAz0GlmsjfhgiOeu304"
            }

            //Error Response.
            {
                "code": 401,
                "status": "error",
                "message": "Invalid API credentials."
            }
            
            
        
                            

Başarılı ödeme sonrasında yanıt

                                
        
        
            //Success Response.
            {
                "code": 200,
                "status": "ok",
                "payment_id": "AIYmQIOAz0GlmsjfhgiOeu304",
                "transaction": "AIYmQIOAz0G",
                "amount": 100.00,
                "charge": 5.00,
                "currency": "USD",
                "custom": "BVSUZ545XCS",
                "date"  : "22-05-2022"
            }

            
        
                            

Ödemeyi Doğrula

You can verify the payment whether it is valid or not. After successful payment transaction you will have the response where you find the Payment ID. With this payment id and your access key you need make a request to our server for verify the payment. Example code is below.

Payment verify end point : https://wallet.tooyour.com/payment/check-validity

                                
    
            <?php
                $parameters = [
                    'payment_id' => 'AIYmQIOAz0GlmsjfhgiOeu304',
                ]
                
                $url = 'https://wallet.tooyour.com/payment/check-validity';
                
                $headers = [
                    "Accept: application/json",
                    "Authorization: Bearer access_key",
                ];
                
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_POSTFIELDS,  $parameters);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                $response = curl_exec($ch);
                curl_close($ch);
            ?>
    
                            

Geçerlilik Yanıtı

                                
        
        
            //Success Response.
            {
                "code": 200,
                "status": "ok",
                "message": "Transaction is valid",
                
            }

            //Error Response.
            {
                "code": 401,
                "status": "error",
                "message": "Invalid API credentials."
            }

            //or
            {
                "code": 404,
                "status": "error",
                "message": "Transaction not found"
            }

            
        
                            

Desteklenen Para Birimleri

Şu anda sistemimizde aşağıdaki para birimleri desteklenmektedir. Daha da güncellenebilir.

Para Birimi Adı Para Birimi Sembolü Para Birimi Kodu
United State Dollar $ USD
European Currency EUR
Greate British Pound £ GBP
Bangladeshi Taka BDT
Bitcoin BTC
Indian Rupee INR
Japanese Yen ¥ JPY
Nigerian naira NGN
Türk Lirası TRY