Bixby Developer Center

Guides
References

payment-methods

optional

Defines the acceptable payment methods users can pay with in your capsule. For more information, see the Supporting Payments topic.

Example

This is an example of using a local endpoint:

action-endpoints {
action-endpoint (PaymentAction) {
payment-methods {
sps {
merchant {
name (transfer-money-to-alex-account)
url {
template (http://ptsv2.com/t/vivspstest/post)
}
spreedly-receiver-type (test)
//test-api-hostname (http://ptsv2.com/)
supported-card(VISA)
supported-card(MASTER)
cvv-verification (false)
}
payment {
amount (payInfo.amount)
currency (payInfo.currency)
// Both 'items' and 'item' are optional, but at least one needs to be present.
// It is possible to have multiple 'items' and 'item's and a combination of both.
items (payInfo.items) {
where-each (item) {
item {
name("#{value(item.name)}")
amount(item.amount)
//count(item.count) // Optional. Should be specified if it applies.
}
}
}
// item {
// name("#{value(item.name)}")
// amount(item.amount)
// count(item.count)
// }
// Optional. But if there is tax in this payment it should be specified with the 'tax' block.
tax {
//name ("#{value(taxInfo.name)}") // Optional. Developers can specify a name (eg. "CA sales tax")
amount (taxInfo.amount)
}
// Optional. But if there is a shipping coast for this payment it should be specified with the 'shipping' block.
shipping {
//name("#{value(shipInfo.name)}") // Optional. Developers can specify a name (eg. "2-hour drone delivery")
amount (shipInfo.amount)
}
}
}
}
accepted-inputs (payInfo, taxInfo, shipInfo, $vivContext)
local-endpoint ("PaymentAction.js")
}
}

The corresponding paymentAction.js would be as follows:

var options = {}
options.headers = {"Content-Type" : "application/json", "User" : "someInfo"}
options.body = "\"{ \"product_id\": \"916598\", \"card_number\": \"{{credit_card_number}}\" }\"";
var wev = http.invokeSPSPayment(options)

This is an example of using a remote endpoint:

action-endpoints {
action-endpoint (paymentAction) {
payment-methods {
sps {
merchant {
name (transfer-money-to-alex-account)
url {
template (http://ptsv2.com/t/vivspstest/post)
}
spreedly-receiver-type (test)
//test-api-hostname (http://ptsv2.com/)
supported-card(VISA)
supported-card(MASTER)
cvv-verification (false)
}
payment {
amount (payInfo.amount)
currency (payInfo.currency)
// Both 'items' and 'item' are optional, but at least one needs to be present.
// It is possible to have multiple 'items' and 'item's and a combination of both.
items (payInfo.items) {
where-each (item) {
item {
name("#{value(item.name)}")
amount(item.amount)
//count(item.count) // Optional. Should be specified when it applies.
}
}
}
// item {
// name("#{value(item.name)}")
// amount(item.amount)
// count(item.count)
// }
// Optional. But if there is tax in this payment it should be specified with the 'tax' block.
tax {
//name ("#{value(taxInfo.name)}") // Optional. Developers can specify a name (eg. "CA sales tax")
amount (taxInfo.amount)
}
// Optional. But if there is a shipping coast for this payment it should be specified with the 'shipping' block.
shipping {
//name("#{value(shipInfo.name)}") // Optional. Developers can specify a name (eg. "2-hour drone delivery")
amount (shipInfo.amount)
}
}
}
}
remote-endpoint (https://transfer-money-to-alex-acount.com) {
headers {
header (some-merchant-api-header:some-header-value)
}
body {
template ("{ \"product_id\": \"916598\", \"card_number\": \"{{credit_card_number}}\" }\"")
}
method (POST)
}
}
}

Child Keys

gateway
optional
Enables a payment method for users in your capsule that differs from the built-in SPS integration
sps
optional
Enables a built-in integration of Samsung Payment Services (SPS) that can be used in your capsule, so that users can pay for purchases