Geliştirici Merkezi

TR

Third Party Yöntemi

"Third Party" yöntemi, bir müşterinin ödeme yapmak için siteden ayrıldığı ve ödeme işlemi tamamlandığında geri dönmesidir. 

Modülde bulunan sınıf içerisine "area" adında bir fonksiyon tanımlayın. Bu fonksiyon sayesinde müşterinin karşısına bir HTML içerik sunabilirsiniz.

Eğer bir kredi kartı bilgisi tanımlama formuna ihtiyacınız var ise "Merchant" yöntemi belgesine göz atınız.

Eğer ödeme hizmeti sağlayıcınız iade özelliğini destekliyorsa “İade” belgesine göz atınız.

Değişkenler

İhtiyacınız olan sistem değişkenleri, müşteri değişkenleri ve fatura değişkenleri aşağıda açıklanmıştır.

Örnekte belirtilen değişkenleri (config_fields, area, capture) fonksiyonları içinde kullanabilirsiniz.

"Callback" fonksiyonu içerisinde kullanabilmek için "set_checkout" fonksiyonunu önceden çağırmanız gerekir. Aksi halde müşteri değişkenleri ve fatura değişkenleri elde edilemez. "set_checkout" fonksiyonu "callback" belgesinde detaylı olarak açıklanmıştır.

Sistem Değişkenleri

 $this->config["settings"]["...your_field..."] # Custom configuration field
 __("website/index/meta/title")# Company Name
 $this->l_payNow               # “Pay Now” button text
 $this->name                   # Module Name
 $this->lang["invoice-name"]   # Module Display Name
 $this->url                    # Module Directory URL Address
 $this->dir                    # Module Directory Path (eg. /coremio/modules/Payment/SamplePay/)
 $this->lang["example"]        # Calling a field from a language file
 APP_URI                       # Website URL Address
 $this->links["successful"]    # Payment successful page link
 $this->links["failed"]        # Payment failed page link
 $this->links["return"]        # Return link
 $this->links["callback"]      # Callback link

Kullanıcı Değişkenleri

 $this->clientInfo->id              # WISECP Client ID
 $this->clientInfo->name            # First Name
 $this->clientInfo->surname         # Last Name
 $this->clientInfo->full_name       # Full Name
 $this->clientInfo->email           # Email Address
 $this->clientInfo->gsm_cc          # GSM phone country code (eg. 1,44,90, etc.)
 $this->clientInfo->gsm             # GSM phone number (without country code)
 $this->clientInfo->phone           # GSM phone number (including country code)
 $this->clientInfo->lang            # Language Used (eg. en,fr,de, etc.)
 $this->clientInfo->kind            # Account Type (eg. individual, corporate)
 $this->clientInfo->company_name    # Company Name
 $this->clientInfo->company_tax_number # Company TAX Number
 $this->clientInfo->company_tax_office # Company TAX Office
 $this->clientInfo->address->country_code # Country code of the selected address (eg. US,UK,DE, etc.)
 $this->clientInfo->address->country_name # Country name of the selected address
 $this->clientInfo->address->city        # City name of the selected address
 $this->clientInfo->address->counti      # State of the selected address
 $this->clientInfo->address->zipcode    # Postal code of the selected address
 $this->clientInfo->address->address     # Address

Fatura Değişkenleri

 $this->checkout["id"]; // Checkout ID, unique identification number for payment (eg. 1234567)
 $params['amount']; // Total amount payable (eg. 199.99)
 $this->currency($params['currency']); // Currency code (eg. USD, EUR , GBP, etc.)

Yanıt

"area" fonksiyonunda, ödeme işlemi yapabilmesi için müşteriye bir "HTML" içerik sunmanız gerekmektedir. Genellikle bir ödeme formu veya "IFRAME" gösterilmektedir.

Örnek Kaynak Kodu:

public function area($params=[])
{
    $merchant_id = $this->config["settings"]["example1"] ?? 0;
    
    return
        '<form action="https://www.sample.com/checkout" method="POST">
            <input type="hidden" name="merchant_id" value="'.$merchant_id.'">
            <input type="hidden" name="amount" value="'.$params["amount"].'">
            <input type="hidden" name="currency" value="'.$this->currency($params["currency"]).'">
            <input type="hidden" name="custom_id" value="'.$this->checkout_id.'">
            <input type="hidden" name="description" value="Invoice Payment">
            <input type="submit" value="'.$this->lang["pay-button"].'">
        </form>';
}
Ayarlar/Yapılandırma Sayfası Merchant Yöntemi

Bir Sorunuz mu Var?

Bize yazmaktan çekinmeyin. En kısa sürede yanıt göndereceğiz.
Bize Ulaşın.
Copyright © 2024. All Rights Reserved.
Join Our Discord Channel
Top