Widget Payment Preparation and Completion
8. Widget Payment Preparation (Prepare Payment)
Endpoint: POST /b2c/widget/preparePayment
Header
| Alan | Tip | Zorunlu |
|---|---|---|
| Authorization | string | ✔ (Bearer WidgetToken) |
Request Body
card object
| Area | Type | Mandatory | Description |
|---|---|---|---|
| cardNumber | string | ✔ | Card number |
| cardHolderName | string | ✔ | Name on card |
| cvv | string | ✔ | CVV |
| expMonth | int | ✔ | Son kullanma ay |
| expYear | int | ✔ | Expiry year |
Root
| Area | Type | Mandatory | Description |
|---|---|---|---|
| use3D | boolean | ✔ | Using 3D Secure |
| currency | string | ✔ | Para birimi |
| amount | decimal | ✔ | Transaction amount |
| installmentToken | string | ✔ | PaymentOptions’tan gelen token |
Response
| Area | Type | Description |
|---|---|---|
| prepareToken | string | Token created for payment transaction |
Request
{
"card": {
"cardNumber": "4155650100416111",
"cardHolderName": "Test Test",
"cvv": "000",
"expMonth": 12,
"expYear": 2030
},
"use3D": true,
"currency": "TRY",
"amount": 2750,
"installmentToken": "INSTALLMENT_TOKEN"
}
9. Widget Payment Completion
Endpoint: POST /b2c/widget/payment
Header
| Alan | Tip | Zorunlu |
|---|---|---|
| Authorization | string | ✔ (Bearer AccessToken) |
Request Body
| Area | Type | Mandatory | Description |
|---|---|---|---|
| amount | decimal | ✔ | Transaction amount |
| prepareToken | string | ✔ | PreparePayment sonucu |
| returnUrl | string | ✔ | 3D post return URL |
| clientReferenceCode | string | ✔ | Merchant order id |
| customerIpAddress | string | ✔ | User IP |
Response
| Area | Type | Description |
|---|---|---|
| paymentType | string | RedirectUrl / DirectSale |
| redirectTo | string | 3D URL |
| orderId | string | Finrota transaction ID |
| clientReferenceCode | string | Merchant reference |
| success | boolean | Transaction result |
| error | string | Error message |
3D Secure Stream
Request
{
"amount": 2750,
"prepareToken": "PREPARE_TOKEN",
"returnUrl": "https://merchant.com/callback",
"clientReferenceCode": "ORDER123",
"customerIpAddress": "1.1.1.1"
}
Response
{
"paymentType": "RedirectUrl",
"redirectTo": "3D_URL",
"success": false
}
- User must be redirected to this URL
Streaming without 3D
Response
{
"paymentType": "DirectSale",
"success": true
}