Enables a payment method for users in your capsule.
action-endpoint (ProceedSPPayment) {
accepted-inputs (order, accessToken, $vivContext, $payment)
local-endpoint (ProceedSPPayment.js)
payment-methods {
gateway (pay_simple) {
label {
template (SimplePay)
}
url {
template ("#{value(order.pgUrl)}")
}
method (POST)
body {
template ("{\"app\": {\"orderNo\": \"#{value(order.orderNumber)}\"}}")
}
header-params {
param (Accept) {
template ("application/json")
}
param (model) {
template ("81")
}
param (Content-Type) {
template ("application/json")
}
param (osType) {
template ("android")
}
param (osVersion) {
template ("1.0.3")
}
param (appVersion) {
template ("01.00.00")
}
param (Authorization) {
template ("Bearer #{value(accessToken)}")
}
}
callback (bixby://payResult)
}
}
}
The gateway returns a special endpoint parameter called $payment
:
$payment: {
id: "simple_pay"
response: {...}
}
callback required | URL at which the gateway's response is returned to when the payment transaction concludes |
label required | Dialog enables you to communicate to users of your capsule, such as asking questions, providing status, or paraphrasing results |
method required | The HTTP method to access the endpoint, such as POST or GET |
url required | The URL, with any parameters encoded, which invokes the gateway |
body optional | Request body, specified as a string template in the scope of the action inputs |
header-params optional | Lists parameters that are wrapped into a header response, which is sent to the payment gateway |