Despite following the sample code and implementation steps provided in your documentation, we are encountering issues when attempting to process payments via the Samsung Checkout page. Specifically, we receive the error message: “This card was declined by the card issuer. Please try another card.”
Here are the steps we have taken so far:
- Created required Products under the DPI portal.
- Called the Product List endpoint to retrieve the product details.
- Hardcoded these values in a sample app where only the
buyItem
method is called to initiate the checkout page. - Tried using different server types like WORKING, DEV, PRD, and DUMMY.
Unfortunately, every attempt results in failure. Additionally, the sample apps do not function correctly when loaded on our Tizen box, producing empty results. To troubleshoot, we used Postman to interact with the Purchase List and Product List APIs. These APIs worked as expected in Postman but not within the sample app.
Given that the API calls work in Postman but fail in our sample app, we suspect a configuration issue. We would appreciate your assistance in identifying and resolving the problem.
Could you please provide guidance on the following:
- Verification of our API calls and configuration settings.
- Any additional setup or configuration steps that we might have missed.
- Troubleshooting tips for resolving the “card declined” error.
- Clarification on any differences between the sandbox and production environments that might affect our implementation.
function getProductsList() {
var hash = CryptoJS.HmacSHA256(appId + CountryCode, securityKey);
var checkValue = CryptoJS.enc.Base64.stringify(hash);
return axios.post(
"https://sbox-checkoutapi.samsungcheckout.com/openapi/cont/list",
JSON.stringify({
AppId: "3202406035659",
CountryCode: "IN",
PageSize: 100,
PageNumber: 1,
CheckValue: checkValue,
}),
{
headers: {
"Content-Type": "application/json;charset=UTF-8",
Accept: "application/json;charset=UTF-8",
},
}
);
}
function buyItemAPI() {
var detailObj = {};
detailObj.OrderItemID = "TV2ZPRD1"; // Issued by "cont/list"
detailObj.OrderTitle = "TV2Z Sub"; // Issued by "cont/list"
detailObj.OrderTotal = "5"; // Change data type to string
detailObj.OrderCurrencyID = "INR";
detailObj.OrderCustomID = "710163004197"; // Same value as "CustomID" parameter for "invoice/list"
var paymentDetails = JSON.stringify(detailObj);
try {
webapis.billing.buyItem(
appId,
"DEV",
paymentDetails,
function (data) {
// For implemention details, see the Samsung Checkout Sample Application
console.log("[Billing buyItem]: pay_result [" + data.payResult + "], pay_detail [" + data.payDetail + "]");
},
function (error) {
console.log("[Billing buyItem] status:[" + error.code + "] errorName:[" + error.name + "] errorMessage:[" + error.message + "]");
}
);
} catch (error) {
console.log("error ==>", error);
}
}