# Ortak Ödeme Sayfası

### MorPOS Yönlendirmeli Ödeme (Hosted Payment)

MorPOS **Hosted Payment** modeli ile kart bilgileri MorPOS’un güvenli ödeme sayfasında alınır.\
Kullanıcı, ödeme başlatıldıktan sonra MorPOS tarafından sunulan ödeme ekranına yönlendirilir.

***

#### Endpoint

```http
POST /v1/HostedPayment/HostedPaymentRedirect
```

***

### Headers

| Anahtar        | Tür    | Açıklama                                 | Örnek                   |
| -------------- | ------ | ---------------------------------------- | ----------------------- |
| x-ClientID     | String | API istemcisi için benzersiz tanımlayıcı | sizin-istemci-id’niz    |
| x-ClientSecret | String | API istemcisi için gizli anahtar         | sizin-gizli-anahtarınız |
| x-GrantType    | String | Kullanılan erişim token türü             | client\_credentials     |
| x-Scope        | String | API kapsamı                              | pf\_write, pf\_read     |
| x-Timestamp    | String | İstek zaman damgası (ISO 8601)           | 2024-12-17T12:34:56Z    |

***

### Request Body

| Alan                                | Zorunlu | Tür     | Açıklama                                | Örnek                          |
| ----------------------------------- | ------- | ------- | --------------------------------------- | ------------------------------ |
| merchantId                          | ✅       | String  | Üye işyeri için benzersiz kimlik        | 100000000000004                |
| returnUrl                           | ✅       | URL     | Başarılı işlem sonrası yönlendirme URL  | <https://www.ornek.com/basari> |
| failUrl                             | ✅       | URL     | Başarısız işlem sonrası yönlendirme URL | <https://www.ornek.com/hata>   |
| paymentMethod                       | ✅       | String  | Ödeme yöntemi                           | EMBEDDEDPAYMENT                |
| paymentInstrumentType               | ✅       | String  | Ödeme aracı türü                        | CARD                           |
| language                            | ✅       | String  | İşlem dili                              | en                             |
| conversationId                      | ✅       | String  | Takip için benzersiz kimlik             | MP20240305001                  |
| sign                                | ✅       | String  | İsteğin dijital imzası                  | ABC123...                      |
| transactionDetails.transactionType  | ✅       | String  | İşlem türü                              | SALE                           |
| transactionDetails.installmentCount | ✅       | Integer | Taksit sayısı (0 = tek çekim)           | 0                              |
| transactionDetails.amount           | ✅       | Decimal | İşlem tutarı                            | 1.00                           |
| transactionDetails.currencyCode     | ✅       | Integer | Para birimi kodu (TRY = 949)            | 949                            |
| transactionDetails.vftFlag          | ❌       | Boolean | VFT kullanım durumu                     | false                          |
| extraParameter.pFSubMerchantId      | ❌       | String  | Alt üye işyeri kimliği                  | 12345                          |

***

#### Örnek Request

```json
{
  "merchantId": "100000000000004",
  "returnUrl": "https://www.ornek.com/basari",
  "failUrl": "https://www.ornek.com/hata",
  "paymentMethod": "HOSTEDPAYMENT",
  "paymentInstrumentType": "CARD",
  "language": "en",
  "conversationId": "MSD2024030500000000123",
  "sign": "AAVWY3RZKJVVCEAD8LDQB4KWJL4QX/IQQRGQ3XIWAAG=",
  "transactionDetails": {
    "transactionType": "SALE",
    "installmentCount": 0,
    "amount": "1.00",
    "currencyCode": "949",
    "vftFlag": false
  },
  "extraParameter": {
    "pFSubMerchantId": "12345"
  }
}
```

#### Örnek Response

```json
{
    "returnUrl": "https://api.morpara.com/hostedpaymentpage/SdL+XGrAcMi+Z+7brD69kMasgWJIPui/nP1CFNETmXo="
}
```

***

#### İşleyiş Notları

* Kart bilgileri **merchant sistemine iletilmez**
* Kullanıcı MorPOS’un **hosted ödeme sayfasına yönlendirilir**
* Kart verileri MorPOS altyapısında işlenir
* PCI-DSS yükümlülüğü minimum seviyededir
* Ödeme sonucuna göre kullanıcı:
  * Başarılı işlemde `returnUrl`
  * Başarısız işlemde `failUrl`\
    adresine yönlendirilir
* Hosted Payment, **3D Secure ve non-3D Secure** senaryoları destekler


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.morpara.com/api-dokumantasyonu/entegrasyon/hostedpaymentpage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
