Create session for payment product
Products
Products is your entry on all things related to payment products. You will be able to retrieve all relevant payment products, based on your configuration and provided filters, their associated fields and potential directories. You can retrieve all of the information in one call or do calls on individual payment products. The data returned is designed to give you all the required information to build up your interface towards your consumers in a dynamic fashion. By doing it like that you know that you will be ready for future changes and new payment products without much effort.
Request
In case you use your own payment pages and you want to host Apple Pay on the Web, Apple requires that a session is created by a valid merchant. This API allows you to retrieve an Apple Pay merchant session with the validationUrl that Apple has provided you.
PayloadCreatePaymentProductSessionRequest
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
object | depends | read close | |
close
DescriptionObject containing details for creating an Apple Pay session.
|
|||
displayName | string | no | read close |
close
DescriptionUsed as an input for the Apple Pay payment button. Provide your company name in a human readable form.
|
|||
domainName | string | depends | read close |
close
DescriptionProvide a fully qualified domain name of your own payment page that will be showing an Apple Pay button.
|
|||
validationUrl | string | depends | read close |
close
DescriptionProvide the validation URL that has been provided by Apple once you have started an Apple Pay session.
|
Request example
This scenario you will probably use the most
-
payment_product_session302_specific_input = MobilePaymentProductSession302SpecificInput() payment_product_session302_specific_input.display_name = 'Worldline' payment_product_session302_specific_input.domain_name = 'pay1.checkout.worldline-solutions.com' payment_product_session302_specific_input.validation_url = '<VALIDATION URL RECEIVED FROM APPLE>' body = CreatePaymentProductSessionRequest() body.payment_product_session302_specific_input = payment_product_session302_specific_input response = client.v1().merchant('merchantId').products().sessions(302, body)
Responses
Please find below an overview of the possible responses.
Response 200 - OKCreatePaymentProductSessionResponse
For every successfully create session resource a HTTP 200 response is returned.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
object | yes | read close | |
close
DescriptionObject containing the Apple Pay session object.
|
|||
sessionObject | string | no | read close |
close
DescriptionObject containing an opaque merchant session object.
|
Response example
This scenario you will probably use the most
-
{ "paymentProductSession302SpecificOutput" : { "sessionObject" : "<SESSION OBJECT>" } }
Response 400 - Bad requestErrorResponse
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
errorId | string | yes | read close |
close
DescriptionUnique reference, for debugging purposes, of this error response
|
|||
array of object | yes | read close | |
close
DescriptionList of one or more errors
|
|||
object | no | read close | |
category | string | no | read close |
close
DescriptionCategory the error belongs to. The category should give an indication of the type of error you are dealing with.
Possible values:
|
|||
code | string | yes | read close |
close
DescriptionError code
|
|||
httpStatusCode | integer | no | read close |
close
DescriptionHTTP status code for this error that can be used to determine the type of error
|
|||
id | string | no | read close |
close
DescriptionID of the error. This is a short human-readable message that briefly describes the error.
|
|||
message | string | no | read close |
close
DescriptionHuman-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
|
|||
propertyName | string | no | read close |
close
DescriptionReturned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query. Some common examples:
|
|||
requestId | string | no | read close |
close
DescriptionID of the request that can be used for debugging purposes
|
Response example
This scenario you will probably use the most
-
{ "errorId" : "15eabcd5-30b3-479b-ae03-67bb351c07e6-00000092", "errors" : [ { "code" : "20000000", "propertyName" : "bankAccountBban.accountNumber", "message" : "PARAMETER_NOT_FOUND_IN_REQUEST" } ] }
Response 404 - Not foundErrorResponse
When no session can be created matching the input criteria a HTTP 404 response is returned.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
errorId | string | yes | read close |
close
DescriptionUnique reference, for debugging purposes, of this error response
|
|||
array of object | yes | read close | |
close
DescriptionList of one or more errors
|
|||
object | no | read close | |
category | string | no | read close |
close
DescriptionCategory the error belongs to. The category should give an indication of the type of error you are dealing with.
Possible values:
|
|||
code | string | yes | read close |
close
DescriptionError code
|
|||
httpStatusCode | integer | no | read close |
close
DescriptionHTTP status code for this error that can be used to determine the type of error
|
|||
id | string | no | read close |
close
DescriptionID of the error. This is a short human-readable message that briefly describes the error.
|
|||
message | string | no | read close |
close
DescriptionHuman-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
|
|||
propertyName | string | no | read close |
close
DescriptionReturned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query. Some common examples:
|
|||
requestId | string | no | read close |
close
DescriptionID of the request that can be used for debugging purposes
|
Response example
This scenario you will probably use the most
-
{ "errorId" : "3caa7750-a076-48b2-9402-3cb9eea613a6-00001532", "errors" : [ { "code" : "1426", "message" : "CREATE_SESSION_NOT_AVAILABLE_FOR_PRODUCT" } ] }