Payment ​
The Genstore payment business domain is the core business module that manages payment information by providing a series of RESTful interfaces, supporting sub domains such as order placement, refund actions, and payment order queries in the payment process.
Core functions
- Order: Create a payment order based on the order and notify PSP for deduction.
- Refund: According to the after-sales agreement, the refund will be given to the customer.
- Obtain a single payment order: Retrieve detailed information of the payment order based on the payment order ID associated with the order.
Application scenarios
- Payment Extersion: Developers can use payment development capabilities to connect third-party payment service providers to their stores as a third-party payment channel to expand their store's payment capabilities.
GET Get refund details ​
Get refund details.
Request Params
Response Data
{
"refundId":"1234"
}
HTTP/1.1 200 OK
{
"channelRefundId": "1112",
"error": "Refund failed",
"status": "PROCESSING"
}
POST Refund operation ​
Create a refund request.
Request Params
Response Data
{
"amount":"100",
"test":"true or false",
"paymentId":"1111",
"refundId":"1111"
}
HTTP/1.1 200 OK
{
"channelRefundId": "1111",
"error": "Refund failed."
}
GET Get payment ​
Get payment details.
Request Params
Response Data
{
"paymentId":"111"
}
HTTP/1.1 200 OK
{
"channelPaymentId": "111",
"error": "Not found payment information.",
"status": "PROCESSING"
}
POST Void operation ​
Create an void request.
Request Params
Response Data
{
"test":"true or false",
"voidId":"11122",
"paymentId":"222"
}
HTTP/1.1 200 OK
{
"channelVoidId": "xxxx",
"error": "Cancel caputue failed"
}
POST Capture operation ​
Create a capture request.
Request Params
Response Data
{
"amount":"200",
"test":"true",
"paymentId":"2222",
"captureId":"1111"
}
HTTP/1.1 200 OK
{
"channelCaptureId": "3333",
"error": "Capture failed"
}
POST Credit card payment ​
Create a payment request to pay with a credit card.
Request Params
Response Data
{
"purchaseInfo":{
"insurance":"1",
"itemTotal":"100",
"shipping":"1",
"taxTotal":"1",
"discount":"1",
"handling":"1",
"shippingDiscount":"0.0",
"items":[
{
"unitPrice":"1.0",
"imgUrl":"http://xxxx.com",
"quantity":"2",
"name":"Black Cotton T-Shirt and White Denim Shorts",
"description":"Casual Black Cotton T-Shirt and White Denim Shorts for Everyday Wear",
"tax":"2.0",
"category":"1",
"sku":"107369095352924",
"virtualProduct":"true or false"
}
]
},
"amount":"200.00",
"clientDetails":{
"acceptLanguage":"zh,en-US;q=0.9,en;q=0.8,zh-CN;q=0.7",
"ipAddress":"10.5.2.2",
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"
},
"test":"true",
"manualCapture":"true",
"paymentId":"PI00202410161331562671",
"paymentMethod":{
"data":{
"cipherText":"I/ehfE/1SkDx/i8qJgoe/qXaRV+fyaVIeEL7D+5PWiPtOgZZAQ/GWvRbI7kgOV0dCkH/uhb0Nlq4sns6GWgf7GeiezxKjPdaJqqbdnYvb3y98SG6DWzCDTc+Za6bpkk2uAg=",
"salt":"GENSTORE-HKDF-SALT",
"ephemeralPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECYaybEr5VfuEUOTBN5iYi3FLDhVUx0s1k6K4iUqk+rgnHRovbXKlItHNzTeGSSevunb8HdQEaPclqUfAps07Uw==",
"suit":"GENSTORE-V1",
"returnUrl":"https://www.xxx.shop/pay/result",
"iv":"GUdwmcbLCp+4hHMr"
}
},
"currency":"USD",
"customer":{
"phoneNumber":"+8618800008888",
"shippingAddress":{
"phoneNumber":"+8615885555",
"province":"NY",
"city":"Westbury",
"countryCode":"US",
"givenName":"John",
"familyName":"Smith",
"postalCode":"10013",
"company":"IBM",
"line2":"Apartment 5",
"line1":"2063 Marshville Road"
},
"billingAddress":{
"phoneNumber":"+8615885555",
"province":"NY",
"city":"Westbury",
"countryCode":"US",
"givenName":"John",
"familyName":"Smith",
"postalCode":"10013",
"company":"IBM",
"line2":"Apartment 5",
"line1":"2063 Marshville Road"
},
"email":"xxx@gmail.com"
}
}
HTTP/1.1 200 OK
{
"error": "Payment failed",
"threeDsUrl": "http://xxx.com"
}
POST Offsite payment operation ​
Create a payment request that redirects to a third-party website.
Request Params
Response Data
{
"purchaseInfo":{
"insurance":"0.0",
"itemTotal":"50.0",
"shipping":"0.0",
"taxTotal":"5.5",
"discount":"0.0",
"handling":"0.0",
"shippingDiscount":"0.0",
"items":[
{
"unitPrice":"1.0",
"imgUrl":"http://xx.com",
"quantity":"2",
"name":"Black Cotton T-Shirt and White Denim Shorts",
"description":"Casual Black Cotton T-Shirt and White Denim Shorts for Everyday Wear",
"tax":"1.0",
"category":"1",
"sku":"107369095352924",
"virtualProduct":"true"
}
]
},
"amount":"100.80",
"test":"true",
"manualCapture":"true",
"paymentId":"PI00202410161331562671344",
"paymentMethod":{
"data":{
"cancelUrl":"http://test.genstore.ai/xx",
"returnUrl":"https://www.xxx.shop/pay/result"
}
},
"currency":"USD",
"customer":{
"phoneNumber":"+8618800008888",
"shippingAddress":{
"phoneNumber":"+8618800008888",
"province":"NY",
"city":"New York",
"countryCode":"US",
"givenName":"John",
"familyName":"Smith",
"postalCode":"10013",
"company":"IBM",
"line2":"Apartment 5",
"line1":"2063 Marshville Road"
},
"billingAddress":{
"phoneNumber":"+8618800008888",
"province":"NY",
"city":"New York",
"countryCode":"US",
"givenName":"John",
"familyName":"Smith",
"postalCode":"10013",
"company":"inter",
"line2":"Apartment 5",
"line1":"2063 Marshville Road"
},
"email":"xx@gmail.com"
}
}
HTTP/1.1 200 OK
{
"redirectUrl": "https://www.xxx.com/",
"error": "Transaction do not honor"
}
Payment
The Genstore payment business domain is the core business module that manages payment information by providing a series of RESTful interfaces, supporting sub domains such as order placement, refund actions, and payment order queries in the payment process.
Core functions
- Order: Create a payment order based on the order and notify PSP for deduction.
- Refund: According to the after-sales agreement, the refund will be given to the customer.
- Obtain a single payment order: Retrieve detailed information of the payment order based on the payment order ID associated with the order.
Application scenarios
- Payment Extersion: Developers can use payment development capabilities to connect third-party payment service providers to their stores as a third-party payment channel to expand their store's payment capabilities.
Payment Object
The payment object
Properties
GET Get refund details
Get refund details.
POST Refund operation
Create a refund request.
GET Get payment
Get payment details.
POST Void operation
Create an void request.
POST Capture operation
Create a capture request.
POST Credit card payment
Create a payment request to pay with a credit card.
POST Offsite payment operation
Create a payment request that redirects to a third-party website.