Introduction
This documentation is intended for current and future Partners of
Simpay. Before implementation, it is necessary to first define the service in the Partner Panel and wait for its activation.
Other languages
Pre-made libraries
Pagination object
"pagination" : {
"total" : 1 ,
"count" : 1 ,
"per_page" : 15 ,
"current_page" : 1 ,
"total_pages" : 1 ,
"links" : {
"next_page" : null ,
"prev_page" : null
}
}
If pagination is available in the request it is possible to use the following URL Parameters
.
URL parameters
Name
Type
Description
page
integer
Page
limit
integer
Limit of results. default: 15, maximum: 99
Object description
Name
Type
Description
Total
int
Number of all records in the object
Count
int
Number of records on the current page
PerPage
int
Number of records maximum per page
CurrentPage
int
Current page
TotalPages
int
Number of total pages
links.NextPage
string
URL of the next page
links.PrevPage
string
URL of previous page
SMS
val simpay = Simpay ( "0b4dca15" , "3eea38f407073ff0abff956b57d71783" )
val sms = simpay. sms
Simpay(apikey: String, apiPassword: String, hashingKey: String = "") → SimPay
Parameters description
Name
Type
Required?
Description
apiKey
String
Yes
API key from partner panel
apiPassword
String
Yes
API password from partner panel
simpay.sms → sms
Available methods in the sms object
Downloading the list of services
sms. getServiceList ( )
Example response
PaginatedResponse ( success= true , data = [ SmsServiceDTO ( id= 1 , type= ONE_TIME_CODE, status= REJECTED, name= TEST, prefix= SIM, suffix= TEST, adult= false , createdAt= 2021 - 05 - 21T10: 28 : 04 ) ] , pagination= Pagination ( total= 1 , count= 1 , nextPage= null , totalPages= 1 , currentPage= 1 , prevPage= null , links= Links ( nextPage= null , prevPage= null ) ) , errors= null )
getServiceList(page: Int, limit: Int) → PaginatedResponse<Set<SmsServiceDTO>>?
Parameters description
Name
Type
Required?
Description
page
integer
No
Page number
limit
integer
No
Limit of objects per page
Response description
Name
Type
Description
id
integer
Id Services
type
SmsServiceType
Service type
status
ServiceStatus
Service status. service_active - means active status
name
string
Service name
prefix
string
SMS content prefix
suffix
string
Suffix of SMS content
adult
boolean
Is the service 18+
createdAt
LocalDateTime
Date of service creation in the format: ISO 8601
sms. getServiceDetails ( 1676 )
Example response
Response ( success= true , data = SmsServiceDetailsDTO ( type= ONE_TIME_CODE, id= 1 , status= REJECTED, name= TEST, prefix= SIM, suffix= TEST, adult= false , numbers= [ 7055 , 7136 , 7255 , 7355 , 7455 , 7555 , 7636 , 77464 , 78464 , 7936 , 91055 , 91155 , 91455 , 91664 , 91955 , 92055 , 92555 ] , createdAt= 2021 - 02 - 16T21: 00 : 30 ) , errors= null )
getServiceDetails(serviceId: Int) → Response<SmsServiceDetailsDTO>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
No
Service id
Response description
Name
Type
Description
id
integer
Id Services
type
SmsServiceType
Service type
status
ServiceStatus
Service status. service_active - means active status
name
string
Service name
prefix
string
SMS content prefix
suffix
string
Suffix of SMS content
description
string
Service description
adult
boolean
Is the service 18+
numbers
List
List of SMS numbers available in the service
created_at
LocalDateTime
Date of service creation in the format: ISO 8601
Downloading a list of transactions
sms. getTransactions ( 1676 )
Example response
PaginatedResponse ( success= true , data = [ SmsTransactionDTO ( id= 1 , from= 48123123123 , code= ABCDEF, used= false , sendAt= 1970 - 01 - 01T00: 00 ) , SmsTransactionDTO ( id= 2 , from= 48123123123 , code= ABCDEF, used= false , sendAt= 1970 - 01 - 01T00: 00 ) , SmsTransactionDTO ( id= 3 , from= 48123123123 , code= ABCDEF, used= false , sendAt= 1970 - 01 - 01T00: 00 ) ] , pagination= Pagination ( total= 3 , count= 3 , nextPage= null , totalPages= 1 , currentPage= 1 , prevPage= null , links= Links ( nextPage= null , prevPage= null ) ) , errors= null )
getTransactions(serviceId: Int, page: Int, limit: Int) → PaginatedResponse<Set<SmsTransactionDTO>>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
Yes
Service id
page
integer
No
Page
limit
integer
No
Limit of objects per page
Response description
Name
Type
Description
id
integer
Transaction id
from
integer
Number from which SMS was sent
code
string
SMS return code
used
boolean
Was the code used
sendAt
LocalDateTime
Date of sending the SMS in the format: ISO 8601
sms. getTransactionDetails ( 1676 , 2203305 )
Example response
Response ( success= true , data = SmsTransactionDetailsDTO ( id= 1 , from= 48123123123 , code= ABCDEF, used= false , sendNumber= 7636 , value= 6 , sendAt= 1970 - 01 - 01T00: 00 ) , errors= null )
getTransactionDetails(serviceId: Int, transactionId: Int) → Response<SmsTransactionDetailsDTO>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
Yes
Service id
transactionId
integer
No
Transaction id
Response description
Name
Type
Description
id
integer
Transaction id
from
integer
Number from which SMS was sent
code
string
SMS return code
used
bolean
Was the code used
sendNumber
integer
Number to which SMS was sent
value
float
The net cost of a sent SMS
sendAt
LocalDateTime
Date of sending the SMS in the format: ISO 8601
Downloading available numbers for the service
sms. getServiceNumbers ( 1676 )
Example response
PaginatedResponse ( success= true , data = [ NumberDTO ( number= 70908 , value= 0.5 , valueGross= 0.62 , adult= true ) , NumberDTO ( number= 71908 , value= 1.0 , valueGross= 1.23 , adult= true ) , NumberDTO ( number= 72998 , value= 2.0 , valueGross= 2.46 , adult= true ) , NumberDTO ( number= 73908 , value= 3.0 , valueGross= 3.69 , adult= true ) , NumberDTO ( number= 75908 , value= 5.0 , valueGross= 6.15 , adult= true ) , NumberDTO ( number= 76908 , value= 6.0 , valueGross= 7.38 , adult= true ) , NumberDTO ( number= 79908 , value= 9.0 , valueGross= 11.07 , adult= true ) , NumberDTO ( number= 91998 , value= 19.0 , valueGross= 23.37 , adult= true ) , NumberDTO ( number= 92598 , value= 25.0 , valueGross= 30.75 , adult= true ) ] , pagination= Pagination ( total= 9 , count= 9 , nextPage= null , totalPages= 1 , currentPage= 1 , prevPage= null , links= Links ( nextPage= null , prevPage= null ) ) , errors= null )
getServiceNumbers(serviceId: Int, page: Int, limit: Int) → PaginatedResponse<Set<NumberDTO>>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
Yes
Service id
page
integer
No
Page
limit
integer
No
Limit of objects per page
Response description
Name
Type
Description
number
integer
SMS number
value
float
Net amount
valueGross
float
Gross amount
adult
boolean
Is it 18+
sms. getNumberDetails ( 7055 , 1676 )
Example response
Response ( success= true , data = NumberDTO ( number= 70908 , value= 0.5 , valueGross= 0.62 , adult= true ) , errors= null )
getServiceNumbersDetails(serviceId: Int, number: Long) → Response<NumberDTO>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
Yes
Service id
number
integer
Yes
Number
Response description
Name
Type
Description
number
integer
SMS number
value
float
Net amount
valueGross
float
Gross amount
adult
boolean
Is it 18+
Downloading all available numbers
sms. getNumbers ( )
Example response
PaginatedResponse ( success= true , data = [ NumberDTO ( number= 7055 , value= 0.5 , valueGross= 0.62 , adult= false ) , NumberDTO ( number= 7255 , value= 2.0 , valueGross= 2.46 , adult= false ) , NumberDTO ( number= 7136 , value= 1.0 , valueGross= 1.23 , adult= false ) , NumberDTO ( number= 7355 , value= 3.0 , valueGross= 3.69 , adult= false ) , NumberDTO ( number= 7455 , value= 4.0 , valueGross= 4.92 , adult= false ) , NumberDTO ( number= 7555 , value= 5.0 , valueGross= 6.15 , adult= false ) , NumberDTO ( number= 7636 , value= 6.0 , valueGross= 7.38 , adult= false ) , NumberDTO ( number= 77464 , value= 7.0 , valueGross= 8.61 , adult= false ) , NumberDTO ( number= 78464 , value= 8.0 , valueGross= 9.84 , adult= false ) , NumberDTO ( number= 7936 , value= 9.0 , valueGross= 11.07 , adult= false ) , NumberDTO ( number= 91055 , value= 10.0 , valueGross= 12.3 , adult= false ) , NumberDTO ( number= 91155 , value= 11.0 , valueGross= 13.53 , adult= false ) , NumberDTO ( number= 91455 , value= 14.0 , valueGross= 17.22 , adult= false ) , NumberDTO ( number= 91664 , value= 16.0 , valueGross= 19.68 , adult= false ) , NumberDTO ( number= 91955 , value= 19.0 , valueGross= 23.37 , adult= false ) ] , pagination= Pagination ( total= 26 , count= 15 , nextPage= null , totalPages= 2 , currentPage= 1 , prevPage= null , links= Links ( nextPage= https: / / api. simpay. pl/ sms/ numbers? page= 2 , prevPage= null ) ) , errors= null )
getNumbers(page: Int, limit: Int) → PaginatedResponse<Set<NumberDTO>>?
Parameters description
Name
Type
Required?
Description
page
integer
No
Page
limit
integer
No
Limit of objects per page
Response description
Name
Type
Description
number
integer
SMS number
value
float
Net amount
valueGross
float
Gross amount
adult
boolean
Is it 18+
Downloading a single sms number
getNumberDetails(number: Long) → Response<NumberDTO>?
Parameters description
Name
Type
Required?
Description
number
integer
Yes
Number
Response description
Name
Type
Description
number
integer
SMS number
value
float
Net amount
valueGross
float
Gross amount
adult
boolean
Is it 18+
Code validation
sms. verifyCode ( 1636 , 'AF4CXF' )
Example response for new code
Response ( success= true , data = CodeVerifyDTO ( used= true , code= 63D9C7, test= true , from= 123123123 , number= 7055 , value= 0.5 , usedAt= 2021 - 11 - 08T00: 56 ) , errors= null )
Example response for the code used
Response ( success= true , data = CodeVerifyDTO ( used= true , code= 63D9C7, test= true , from= 123123123 , number= 7055 , value= 0.5 , usedAt= null ) , errors= null )
verifyCode(serviceId: Int, code: String, number: Long) -> Response<CodeVerifyDTO>?
Parameters description
Name
Type
Required
Description
serviceId
integer
Yes
Service id
code
string
Yes
Return code from SMS
number
integer
No
The number to which the SMS was to be sent
Response description
Name
Type
Description
used
boolean
Was the SMS used
code
string
Return code from SMS
test
boolean
Is the test SMS
from
integer
Number from which SMS was sent
number
integer
Number to which SMS was sent
value
integer
Net amount of SMS cost
usedAt
LocalDateTime
Date when SMS was used in the format: ISO 8601, only available if used
is equal to true
.
Modele
Znajdziesz tutaj modele typów, statusów itd. do usług SMS
Status usługi
Name
Description
ServiceStatus
service_new
New (to be verified)
NEW
service_active
Active
ACTIVE
service_blocked
Blocked
BLOCKED
service_deleted
Deleted
DELETED
service_second_verify
Re-verification
SECOND_VERIFY
service_rejected
Rejected
REJECTED
service_verify
Verification
VERIFY
service_ongoing_registration
In the course of registration
ONGOING_REGISTRATION
Typ usługi
Name
Description
SmsServiceType
ONE_TIME_CODE
One-time code
ONE_TIME_CODE
CODE_PACK
Packet of codes
CODE_PACK
API_URL
API
API_URL
SMSXML
val simpay = Simpay ( "0b4dca15" , "3eea38f407073ff0abff956b57d71783" , "testKey" )
val smsXml = simpay. smsXml
SmsXml(hashingKey: String) → SmsXml
SMS Api XML allows you to control the entire process of receiving the sms and sending the code on the partner’s side of the service.
The partner prepares the URL link according to the described SimPay specification.
When the user places an order (sends an SMS message), our system queries the URL provided by the partner and downloads the code directly.
Parameters description
Name
Type
Required?
Description
hashKey
String
Yes
Signature creation key located in the partner panel in the service
smsXml. checkParameters ( map: Map< String, Any> )
val smsValue = smsXml. getSmsValue ( "7455" )
val code = smsXml. generateCode ( )
val xml = smsXml. generateXml ( code)
DirectBilling
val simpay = Simpay ( "0b4dca15" , "3eea38f407073ff0abff956b57d71783" )
val directBilling = simpay. directBilling
Simpay(apikey: String, apiPassword: String, hashingKey: String = "") → Simpay
Parameters description
Name
Type
Required?
Description
apiKey
string
Yes
API key from partner panel
apiPassword
string
Yes
API password from partner panel
directbilling → DirectBilling
Available methods in the directbilling object
Downloading the list of services
directbilling. getServiceList ( )
Example response
PaginatedResponse ( success= true , data = [ DirectBillingServiceDTO ( id= 1 , name= Testowa usługa, suffix= TEST1, status= REJECTED, createdAt= 2021 - 10 - 01T12: 57 : 18 ) , DirectBillingServiceDTO ( id= 2 , name= Testowa usługa, suffix= TEST2, status= ACTIVE, createdAt= 2021 - 10 - 01T13: 57 : 18 ) , DirectBillingServiceDTO ( id= 3 , name= Testowa usługa, suffix= TEST3, status= ACTIVE, createdAt= 2021 - 10 - 01T14: 57 : 18 ) ] , pagination= Pagination ( total= 3 , count= 3 , nextPage= null , totalPages= 1 , currentPage= 1 , prevPage= null , links= Links ( nextPage= null , prevPage= null ) ) , errors= null )
getServiceList(page: Int, limit: Int) → PaginatedResponse<Set<DirectBillingServiceDTO>>?
Parameters description
Name
Type
Required?
Description
page
integer
No
Page number
limit
integer
No
Limit of objects per page
Response description
Name
Type
Description
id
integer
Service id
name
string
Name of the service
suffix
string
Service suffix
status
ServiceStatus
Service status, for more information check Models
created_at
LocalDateTime
Date of service creation in the format: ISO 8601
directbilling. getServiceDetails ( 139 )
Example response
Response ( success= true , data = DirectBillingServiceDetailsDTO ( id= 139 , name= test. pl, suffix= test, status= ACTIVE, api= Api ( complete= https: / / test. pl/ wallet, failure= https: / / test. pl/ wallet) , providers= Providers ( tMobile= true , orange= true , play= true , plus= true ) , commissionsPercents= CommissionsPercents ( tMobile= CommissionPercent ( commission0= 60 , commission9= 60 , commission25= 60 ) , orange= CommissionPercent ( commission0= 67 , commission9= 67 , commission25= 70 ) , play= CommissionPercent ( commission0= 55 , commission9= 65 , commission25= 70 ) , plus= CommissionPercent ( commission0= 50 , commission9= 50 , commission25= 60 ) ) , maxValues= OperatorMaxValues ( tMobile= 250 , orange= 300 , play= 600 , plus= 400 ) , createdAt= 2020 - 11 - 25T01: 45 : 28 ) , errors= null )
getServiceDetails(serviceId: Int) → Response<DirectBillingServiceDetailsDTO?>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
No
Service id
Response description
Name
Type
Description
id
integer
Service id
name
string
Name of the service
suffix
string
Service suffix
status
string
Service status, for more information check Models
api.complete
string
Redirection url in case of successful transaction
api.failure
string
Redirection url in case of transaction failure
providers.tMobile
boolean
T-Mobile operator availability
providers.orange
boolean
Orange operator availability
providers.play
boolean
Play operator availability
providers.plus
boolean
Operator availability Plus
commissionsPercents.tMobile.commission0
string
Partner commission in % of T-Mobile operator from the amount of 0.01 PLN to 8.99 PLN
commissionsPercents.tMobile.commission9
string
Partner commission in % of T-Mobile operator from the amount of PLN 9.00 to PLN 24.99
commissionsPercents.tMobile.commission25
string
Partner commission in % of T-Mobile operator from the amount of PLN 25.00 up to the maximum amount
commissionsPercents.orange.commission0
string
Partner’s commission in % of Orange operator from the amount of 0.01 PLN to 8.99 PLN
commissionsPercents.orange.commission9
string
Partner commission in % of Orange operator from the amount of PLN 9.00 to PLN 24.99
commissionsPercents.orange.commission25
string
Partner commission in % of Orange operator from the amount of PLN 25.00 up to the maximum amount
commissionsPercents.play.commission0
string
Partner commission in % of Play operator from the amount of 0.01 PLN to 8.99 PLN
commissionsPercents.play.commission9
string
Partner commission in % of Play operator from the amount of PLN 9.00 to PLN 24.99
commissionsPercents.play.commission25
string
Partner commission in % of Play operator from the amount of 25.00 PLN up to the maximum amount
commissionsPercents.plus.commission0
string
Partner commission in % of Plus operator from the amount of 0.01 PLN to 8.99 PLN
commissionsPercents.plus.commission9
string
Partner commission in % of Plus operator from the amount of PLN 9.00 to PLN 24.99
commissionsPercents.plus.commission25
string
Partner commission in % of Plus operator from the amount of 25.00 PLN up to the maximum amount
maxValues.tMobile
string
Maximum amount of a single transaction for T-Mobile operator
maxValues.orange
string
Maximum amount of a single transaction for the operator Orange
maxValues.play
string
Maximum amount of a single transaction for Play operator
maxValues.plus
string
Maximum amount of a single transaction for Plus operator
createdAt
LocalDateTime
Date of service creation in the format: ISO 8601
Commission calculation
directBilling.calculateCommission(139, 2.0)
Parameters description
Name
Type
Required?
Description
amount
float
Yes
The amount we want to receive
Example response
Response ( success= true , data = CommissionsValuesDTO ( orange= CommissionValue ( netValue= 285.72 , grossValue= 351.44 ) , play= CommissionValue ( netValue= 285.72 , grossValue= 351.44 ) , tMobile= CommissionValue ( netValue= 333.34 , grossValue= 410.01 ) , plus= CommissionValue ( netValue= 333.34 , grossValue= 410.01 ) ) , errors= null )
Response description
Name
Type
Description
orange.net
float
Net amount
orange.gross
float
Gross amount
play.net
float
Net amount
play.gross
float
Gross amount
tMobile.net
float
Net amount
tMobile.gross
float
Gross amount
plus.net
float
Net amount
plus.gross
float
Gross amount
If the operator is not active or the amount is too large a null
will be returned.
Downloading a list of transactions
directbilling. getTransactions ( 139 )
Example response
PaginatedResponse ( success= true , data = [ DirectBillingTransactionsDTO ( id= 552098 , status= ERROR, value= 0.34 , netValue= 0.24 , operator = ORANGE, createdAt= 2021 - 10 - 20T00: 34 : 47 , updatedAt= 2021 - 10 - 19T22: 34 : 47 ) , DirectBillingTransactionsDTO ( id= 552097 , status= NEW, value= 0.34 , netValue= 0.24 , operator = ORANGE, createdAt= 2021 - 10 - 20T00: 34 : 14 , updatedAt= 2021 - 10 - 19T22: 34 : 14 ) , DirectBillingTransactionsDTO ( id= 552096 , status= NEW, value= 0.34 , netValue= 0.24 , operator = ORANGE, createdAt= 2021 - 10 - 20T00: 33 : 53 , updatedAt= 2021 - 10 - 19T22: 33 : 53 ) , DirectBillingTransactionsDTO ( id= 548852 , status= CONFIRMED, value= 34.46 , netValue= 24.12 , operator = ORANGE, createdAt= 2021 - 10 - 05T20: 50 : 25 , updatedAt= 2021 - 10 - 05T18: 50 : 25 ) , DirectBillingTransactionsDTO ( id= 548851 , status= CONFIRMED, value= 34.46 , netValue= 24.12 , operator = ORANGE, createdAt= 2021 - 10 - 05T20: 48 : 26 , updatedAt= 2021 - 10 - 05T18: 48 : 26 ) , DirectBillingTransactionsDTO ( id= 544659 , status= CONFIRMED, value= 13.41 , netValue= 6.7 , operator = PLUS, createdAt= 2021 - 09 - 17T20: 55 : 52 , updatedAt= 2021 - 09 - 17T18: 55 : 53 ) , DirectBillingTransactionsDTO ( id= 544508 , status= CONFIRMED, value= 13.41 , netValue= 8.04 , operator = T_MOBILE, createdAt= 2021 - 09 - 17T10: 31 : 17 , updatedAt= 2021 - 09 - 17T08: 31 : 17 ) , DirectBillingTransactionsDTO ( id= 448984 , status= REJECTED, value= 13.41 , netValue= 6.7 , operator = PLUS, createdAt= 2021 - 01 - 19T21: 08 : 56 , updatedAt= 2021 - 01 - 22T20: 48 : 11 ) , DirectBillingTransactionsDTO ( id= 448931 , status= REJECTED, value= 13.41 , netValue= 8.98 , operator = ORANGE, createdAt= 2021 - 01 - 19T19: 14 : 35 , updatedAt= 2021 - 01 - 22T18: 48 : 11 ) ] , pagination= Pagination ( total= 9 , count= 9 , nextPage= null , totalPages= 1 , currentPage= 1 , prevPage= null , links= Links ( nextPage= null , prevPage= null ) ) , errors= null )
getTransactions(serviceId: Int, page: Int, limit: Int) → PaginatedResponse<Set<DirectBillingTransactionsDTO>>?
Response description
Name
Type
Description
id
integer
Transaction id
status
TransactionStatus
Status of transaction, for more information check Models
value
float
Transaction amount
netValue
float
Net transaction amount
operator
string
Operator, see list of operators in Models
createdAt
LocalDateTime
The date the transaction was created in the format: ISO 8601
updatedAt
LocalDateTime
Transaction update date in the format: ISO 8601
directbilling. getTransactionDetails ( 139 , 552097 )
Example response
Response ( success= true , data = DirectBillingTransactionDetailsDTO ( id= 1 , status= CONFIRMED, phoneNumber= null , value= 16.67 , netValue= 10.0 , operator = T_MOBILE, notification= Notification ( isSend= false , lastSendAt= 1970 - 01 - 01T00: 00 , count= 0 ) , createdAt= 2021 - 09 - 17T12: 01 : 50 , updatedAt= 2021 - 09 - 17T10: 01 : 50 ) , errors= null )
getTransactionDetails(serviceId: Int, transactionId: Int) → Response<DirectBillingTransactionDetailsDTO>?
Response description
Name
Type
Description
id
integer
Transaction id
status
string
Status of transaction, for more information check Models
phoneNumber
string/null
The phone number that was forced when the transaction was generated
control
string
Status of transaction, for more information check Models
value
float
Transaction amount
netValue
float
Net transaction amount
operator
string
Operator, see list of operators in Models
notify
Notification
Server notification board, see below
notification.isSend
boolean
Information whether the notification has been sent
notification.lastSendAt
LocalDateTime
Date the last notification was sent in the format: ISO 8601
notification.count
integer
Number of notifications sent
createdAt
LocalDateTime
The date the transaction was created in the format: ISO 8601
updatedAt
LocalDateTime
Transaction update date in the format: ISO 8601
Generating transaction
val request = GenerateTransactionRequest ( 2.0 , "" , " " , "" , RedirectURL ( "" , "" ) , "" )
directBilling. generateTransaction ( 1636 , request)
Example response
Response ( success= true , data = DirectBillingGenerateTransactionDTO ( transactionId= 1d87a1b3- 18f8- 4146 - bcb1- c0c9f293b04f, redirectUrl= https: / / db. simpay. pl/ 1d87a1b3- 18f8- 4146 - bcb1- c0c9f293b04f) , errors= null )
generateTransaction(serviceId: Int, request: GenerateTransactionRequest) → Response<DirectBillingGenerateTransactionDTO>?
Parameters description
Name
Type
Required?
Description
serviceId
integer
Yes
Service Id
request
GenerateTransactionRequest
Yes
Request object
Description of the methods available at the object
Name
Type
Required
Description
Sign(key: String)
Method that signs a request based on all parameters
SignWithAmountAndControl(key: String)
Method that signs a request based on Amount and Control values
Amount types
Name
Description
“net”
Type of net transaction amount
“gross”
Type of gross transaction amount
“required”
Type of transaction amount, net amount required
Object description
Name
Type
Description
transactionId
string
UUID of the transaction
redirectUrl
string
The address to which the customer should be redirected
After generating the transaction, the user should be redirected to the url given in the response, it can be retrieved from the object under the key redirectUrl
or the function
generateTransaction?.data?.redirectUrl
. There is also available the generateTransaction?.data?.transactionId
fucnction to retrieve the Id of the generated transaction.
The object that will be sent to the partner service
{
"id" : 1111 ,
"service_id" : 1 ,
"status" : "transaction_db_payed" ,
"values" : {
"net" : 11.07 ,
"gross" : 11.07 ,
"partner" : 11.07
} ,
"returns" : {
"complete" : "https://www.simpay.pl" ,
"failure" : "https://www.simpay.pl"
} ,
"control" : "test" ,
"number_from" : "123123123" ,
"provider" : 1 ,
"signature" : "signature"
}
Parameters description
Name
Type
Required?
Description
apiKey
string
Yes
Api key from the partner panel, available in the service
payload
string
Yes
Body of the incoming request
Description of the request sent
Name
Type
Description
id
integer
Transaction id
service_id
integer
Service id
status
string
Status of transaction, for more information check Models
values
object
Object with transaction amounts
values[net]
float
Net transaction amount
values[gross]
float
Gross transaction amount
values[partner]
float
Partner’s commission
returns
object
Post-transaction redirect URL object
returns[complete]
string
The address to which the customer was to be redirected after a valid transaction
returns[failure]
string
The address to which the customer was to be redirected after the transaction was not correct
control
string
Control field to be used by partner
number_from
string
The phone number from which the transaction was conducted
provider
integer
Payment operator, see more at Models
signature
string
The signature to be compared with the newly generated signature, see below
Models
Here you will find models of types, statuses, etc. for DirectBilling services
Service status
Name
Description
ServiceStatus
service_db_new
New
NEW
service_db_active
Active
ACTIVE
service_db_rejected
Rejected
REJECTED
service_db_ongoing_registration
In the course of registration
ONGOING_REGISTRATION
Transaction status
Name
Description
TransactionStatus
transaction_db_new
New
NEW
transaction_db_payed
Paid
PAYED
transaction_db_confirmed
User redirected
CONFIRMED
transaction_db_rejected
Rejected
REJECTED
transaction_db_canceled
Cancelled
CANCELED
transaction_db_generate_error
Error during generating
ERROR
Provider
Name
Description
Operator
1
Orange
ORANGE
2
Plus
PLUS
3
Play
PLAY
4
T-Mobile
T_MOBILE
Security
Verification of customer certificate
Notifications from SimPay servers are signed with a certificate.
Example of nginx configuration with client certificate verification on location /notify
set $simpay_fingerprint "13d4313b94469038cdbab1839559ae381309a79d" ;
ssl_client_certificate /opt/simpay/ssl/ipn.simpay.pem;
ssl_verify_client optional;
ssl_verify_depth 2 ;
location /notify {
if ($ssl_client_verify != "SUCCESS" ) { return 403 ; }
if ($ssl_client_fingerprint != $simpay_fingerprint ) {
return 403 ;
}
}
SimPay IPN Certificate
-----BEGIN CERTIFICATE-----
MIICZjCCAe2gAwIBAgIUESmcYMAYfB5YTAGSqCyOay9OnZgwCgYIKoZIzj0EAwIw
czEmMCQGA1UEAwwdUGF5bWVudHMgU29sdXRpb25zIFJvb3QgQ0EgWDExJjAkBgNV
BAoMHVBheW1lbnRzIFNvbHV0aW9ucyBzcC4geiBvLm8uMRQwEgYDVQQHDAtLcmFz
bm9zaWVsYzELMAkGA1UEBhMCUEwwHhcNMjExMTExMTg0NzI5WhcNMzExMTA5MTg0
NzI5WjBzMSYwJAYDVQQDDB1QYXltZW50cyBTb2x1dGlvbnMgUm9vdCBDQSBYMTEm
MCQGA1UECgwdUGF5bWVudHMgU29sdXRpb25zIHNwLiB6IG8uby4xFDASBgNVBAcM
C0tyYXNub3NpZWxjMQswCQYDVQQGEwJQTDB2MBAGByqGSM49AgEGBSuBBAAiA2IA
BE371EkfU3OZJj6aUnv4JLfQ773ShbEooYxFc//DsWVi0rps0MUlpLuWpDN9tqdh
DJWQpdXq2Pam3nbzEr/klHeFRBBdI4ghWjs3GX+KxNUMMp0qVFNxZ+oBDdBkb7GD
s6NCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
FMplUBx3+kPIl5fkMLREXv5DwQyvMAoGCCqGSM49BAMCA2cAMGQCMGLV6BCrVb/W
RjsFkmho+qVUa9mdm54dPDI4JZ5rb98BnU0xxSGpPwXc+odSgPox7QIwXP1vJztU
qPn0D9ZdNFSIg7wpppLwIfhniv3gy4khuI9PAuWF76rjs90+Ij/pR67n
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICWjCCAeGgAwIBAgIUcPa5Jqg71Be/IaLIlPy4XDLJJP8wCgYIKoZIzj0EAwIw
czEmMCQGA1UEAwwdUGF5bWVudHMgU29sdXRpb25zIFJvb3QgQ0EgWDExJjAkBgNV
BAoMHVBheW1lbnRzIFNvbHV0aW9ucyBzcC4geiBvLm8uMRQwEgYDVQQHDAtLcmFz
bm9zaWVsYzELMAkGA1UEBhMCUEwwHhcNMjExMTExMTk0OTUwWhcNMzExMTA5MTk0
OTUwWjBnMRowGAYDVQQDDBFTaW1wYXkgUm9vdCBDQSBYMTEmMCQGA1UECgwdUGF5
bWVudHMgU29sdXRpb25zIHNwLiB6IG8uby4xFDASBgNVBAcMC0tyYXNub3NpZWxj
MQswCQYDVQQGEwJQTDB2MBAGByqGSM49AgEGBSuBBAAiA2IABE9noXtjwMQ0IlDy
Anddos7JRYf3EcCbW8/ilHQcBxkE8828iTK+4bw1h8KYRzEfJRSZmZMlbH8AKPSC
oukSbSAnMMSu8vQ2QBQKwjjsxIttLv63HHBQ4c5k7C6WYm28C6NCMEAwDgYDVR0P
AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFDPp5r7ojf5I/9pO
Z6uZKGAoJwS7MAoGCCqGSM49BAMCA2cAMGQCMCgFY0DWNkHPr1yV7inFuKPIKUBT
XzWc7F1vlcWszNuNJtyaxiSUsmysYxyxD0+QEwIwQ53zxnkppiw9+luTIZAxkchi
DoEV+E1e5GR8f4QaKCPIb4y9qp9dpWd9328sXvVP
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIICCDCCAY2gAwIBAgIUUGkJrAO+6V0xrOcbZ5szLAix4bIwCgYIKoZIzj0EAwIw
ZzEaMBgGA1UEAwwRU2ltcGF5IFJvb3QgQ0EgWDExJjAkBgNVBAoMHVBheW1lbnRz
IFNvbHV0aW9ucyBzcC4geiBvLm8uMRQwEgYDVQQHDAtLcmFzbm9zaWVsYzELMAkG
A1UEBhMCUEwwHhcNMjIwMjA3MTk0MTU3WhcNMzIwMjA1MTk0MTU3WjBjMRYwFAYD
VQQDDA1TaW1wYXkgSVBOIFgxMSYwJAYDVQQKDB1QYXltZW50cyBTb2x1dGlvbnMg
c3AuIHogby5vLjEUMBIGA1UEBwwLS3Jhc25vc2llbGMxCzAJBgNVBAYTAlBMMHYw
EAYHKoZIzj0CAQYFK4EEACIDYgAEmFd9ZEds0KBVKuRsi50sO+B+NUJM2MRbXnTh
7kkStVk8XFIzOHWEhbppttB1RaOrPpIT/Ys/+/YXWAGTAvubuWYH2rDYFv8h54gU
VI8HGK81aVbQmv8ln5tug7rKKmKtMAoGCCqGSM49BAMCA2kAMGYCMQC7sy+9bFAU
ZWUWgI0KRFWSYTwdhOC4V84+Ea4PCvVPha26hMe9NqB1A1Vf3tInBWUCMQD0x33e
8jDjlCiXN0jDf+5gKsREQs9Q2pF6r+P7uzX26dT+OvOz6IfJlYS+SEXYHjU=
-----END CERTIFICATE-----
IP addresses of servers
Notifications from SimPay servers are sent from the following IP addresses