post https://example.com/orders//initializePayment
The Initialize Payment service is used to create a payment session for a previously created order in Paynova's system. You will receive an identifier (GUID) for the payment session.
HTTP Request
POST /orders/{orderId}/initializePayment
When a payment session is successfully created, Paynova will POST-redirect the customer back to your server upon completion of the payment session using one of the URLs provided. For more information see
POST-redirect
.
Request Parameters
Property | Type | Description |
---|---|---|
orderId required | guid | The unique order identifier that you received from Paynova in the Create Order response. Example: "1bee7570-76c0-495b-bc0a-a43300d0410c" |
totalAmount required | decimal | The total amount that should be processed for this payment. Constraints:
Example: 125.00 |
paymentChannelId required | int | The id of the payment channel. See paymentChannelId page for possible values. Example: 1 |
profilePaymentOptions optional | profilePaymentOptions | See http://developers.paynova.com/docs/profile-payments-1 for information about profile payments. |
paymentMethods required | array | The id's for the payments methods to display on the hosted payment page. The full list of available payment methods are available here. Example: 311 { "id": "311" } You can select specific credit product: Example for Direct invoice: [{ "id":311, "products":[{"id":"DirectInvoice"}] }] Example for Installments: [{"id":311, "products":[{"id":" InstallmentsThreeMonths "},{"id": " InstallmentsSixMonths "}, {"id": "InstallmentsTwelveMonths"}] }] |
customData optional | customData | Collection of up to 10 private key-value data fields to store as metadata on the transaction. This data can be viewed in Merchant Services and is returned in the GetOrder response object. We do not use this data for processing transactions. Example: { key: AAAAA, value: 123456 } |
sessionTimeout optional | int | The time-to-live (TTL) of the session, in seconds, before the session times out. (Note that TTL starts once the link is generated) Constraints: > sessionTimeout must be between 180 and 28800 seconds. Example: 900 |
routingIndicator conditional | string | The name or id of the routing table to use when processing payments. Conditions: > This field is used for advanced configurations and should only be provided if asked to do so by Paynova. Providing an invalid value in this field may result in payment failures. Example: "4658" |
fraudScreeningProfile conditional | string | The name or id of the fraud screening profile (named set of fraud screening rules) to use. Conditions: > This field is used for advanced configurations and should only be provided if asked to do so by Paynova. Providing an invalid or incorrect value in this field may result in transactions being incorrectly accepted/declined by the fraud screening provider. |
interfaceOptions optional | interfaceoption | Interface options for the hosted payment page. Example: { "interfaceId":5, "layoutName":"Paynova_Responsive_2", "customerLanguageCode":"SWE", "urlRedirectSuccess":"http://myshop.com/success", "urlRedirectCancel":"http://myshop.com/cancel", "urlRedirectPending":"http://myshop.com/pending", "urlCallback":"https://postb.in/YourBinNumber" } |
lineItems conditional | lineitem | Line items included in this payment. Conditions: > Line items are required when initializing a payment session for an amount less than the original order total. Example: { "Id":"1", "ArticleNumber":1000, "Name":"Some product", "Description":"Some product description", "ProductUrl":"http://myshop.com/products/1000", "Quantity":4, "UnitMeasure":"st", "UnitAmountExcludingTax":20, "TaxPercent":25, "TotalLineTaxAmount":20, "TotalLineAmount":100, "LineItemGroupKey":null } |
Response Parameters
Status required | status | API operation status. Example: { "isSuccess":true, "errorNumber":0, "statusKey":"SUCCESS "statusMessage":"The operation was successful."} |
SessionId conditional | guid | The id of the payment session. Conditions: > This parameter is not returned in error situations. Example: "ce0a6ef0-63b3-4ae4-8001-a3b100b23ffe" |
Url conditional | string | The url to which the user should be redirected to complete the payment. Conditions: > This parameter is not returned in error situations. Example: "https://paygate.paynova.com/Aero/Payment/2/ce0a6ef0-63b3-4ae4-8001-a3b100b23ffe" |