Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
bc-clearpay-sdk
Advanced tools
BetterCommerce's ClearPay NodeJS SDK enables BC client applications to integrate with ClearPay merchant API system. It publishes an interface to interact with [ClearPay API v2](https://developers.clearpay.co.uk/clearpay-online/reference) endpoints.
BetterCommerce's ClearPay NodeJS SDK enables BC client applications to integrate with ClearPay merchant API system. It publishes an interface to interact with ClearPay API v2 endpoints.
Use below command for package installation:
npm install @better-commerce/bc-clearpay-sdk
Use following snippet to initialize the SDK:
ClearPayEnvironment.init("<api_userId>", "<api_password>");
const data = {
purchaseCountry: "GB",
description: "Order c519a711-a406-ee11-b1c2-000d3a211cf7 for basket 42695bdd-5188-4e6b-8595-8d373a91d6fe OrderPaymentId 318096-1110599",
amount: {
amount: 79.99,
currency: "GBP"
},
taxAmount: {
amount: 13.33,
currency: "GBP"
},
shippingAmount: {
amount: 0,
currency: "GBP"
},
items: [
{
name: "BS21316-MAGENTA / FUCHSIA-16(1)",
sku: "BS21316-MAGENTA / FUCHSIA-16",
quantity: 1,
price: {
amount: 79.99,
currency: "GBP"
},
imageUrl: "http://localhost:3000/product/products/my-brand-pink-jacquard-tie-waist-midi-dress-bs21316-magenta-fuchsia-16",
pageUrl: "http://localhost:3000/product/products/my-brand-pink-jacquard-tie-waist-midi-dress-bs21316-magenta-fuchsia-16",
}
],
consumer: {
givenNames: "Test",
surname: "User",
email: "guest142@gmail.com",
phoneNumber: "012485744451"
},
billing: {
area1: "Edinburgh",
area2: "",
countryCode: "GB",
line1: "20/13 St. Peters Place",
line2: "address 2",
name: "Test User",
phoneNumber: "012485744451",
postcode: "EH3 9PQ"
},
shipping: {
area1: "Edinburgh",
area2: "",
countryCode: "GB",
line1: "20/13 St. Peters Place",
line2: "address 2",
name: "Test User",
phoneNumber: "012485744451",
postcode: "EH3 9PQ"
},
merchant: {
redirectConfirmUrl: "http://localhost:3000//payment-notification/clearpay",
redirectCancelUrl: "http://localhost:3000//payment-notification/clearpay/canceled",
popupOriginUrl: "http://localhost:3000/checkout",
}
};
const result = await new Payment().initIntent(data);
{
"token":"003.l8k5frtvq1nqi231ktol2n177rgheed3j34lgb3sui7cjpnj",
"expires":"2023-06-09T07:24:39.721Z",
"redirectCheckoutUrl":"https://portal.sandbox.clearpay.co.uk/uk/checkout/?token=003.l8k5frtvq1nqi231ktol2n177rgheed3j34lgb3sui7cjpnj"
}
const data = {
token: "003.b63tm5vhpf3lofthu48g4nemnb1pl5isi5atipqktqnl54f1",
};
const result = await new Payment().requestPayment(data);
{
"id":"400248040765",
"token":"003.b63tm5vhpf3lofthu48g4nemnb1pl5isi5atipqktqnl54f1",
"status":"APPROVED",
"created":"2023-06-09T09:07:23.276Z",
"originalAmount":{
"amount":"79.99",
"currency":"GBP"
},
"openToCaptureAmount":{
"amount":"0.00",
"currency":"GBP"
},
"paymentState":"CAPTURED",
"refunds":[
],
"orderDetails":{
"consumer":{
"phoneNumber":"012485744451",
"givenNames":"Test",
"surname":"User",
"email":"guest142@gmail.com"
},
"billing":{
"name":"Test User",
"line1":"20/13 St. Peters Place",
"line2":"address 2",
"area1":"Edinburgh",
"postcode":"EH39PQ",
"countryCode":"GB",
"phoneNumber":"012485744451"
},
"shipping":{
"name":"Test User",
"line1":"20/13 St. Peters Place",
"line2":"address 2",
"area1":"Edinburgh",
"postcode":"EH39PQ",
"countryCode":"GB",
"phoneNumber":"012485744451"
},
"courier":{
},
"items":[
{
"name":"BS21316-MAGENTA / FUCHSIA-16(1)",
"sku":"BS21316-MAGENTA / FUCHSIA-16",
"quantity":1,
"price":{
"amount":"79.99",
"currency":"GBP"
},
"pageUrl":"http://localhost:3000/product/products/my-brand-pink-jacquard-tie-waist-midi-dress-bs21316-magenta-fuchsia-16",
"imageUrl":"http://localhost:3000/product/products/my-brand-pink-jacquard-tie-waist-midi-dress-bs21316-magenta-fuchsia-16"
}
],
"discounts":[
],
"shippingAmount":{
"amount":"0.00",
"currency":"GBP"
},
"taxAmount":{
"amount":"13.33",
"currency":"GBP"
}
},
"events":[
{
"id":"2Qxl2GquYAK4kIJXOx55Z1WX4Hi",
"created":"2023-06-09T09:28:24.850Z",
"expires":null,
"type":"CAPTURED",
"amount":{
"amount":"79.99",
"currency":"GBP"
},
"paymentEventMerchantReference":null
}
]
}
const orderId = "400248040765";
const result = await new Payment().getDetails(orderId);
{
"id":"400248040765",
"token":"003.b63tm5vhpf3lofthu48g4nemnb1pl5isi5atipqktqnl54f1",
"status":"APPROVED",
"created":"2023-06-09T09:07:23.276Z",
"originalAmount":{
"amount":"79.99",
"currency":"GBP"
},
"openToCaptureAmount":{
"amount":"0.00",
"currency":"GBP"
},
"paymentState":"CAPTURED",
"refunds":[
],
"orderDetails":{
"consumer":{
"phoneNumber":"012485744451",
"givenNames":"Test",
"surname":"User",
"email":"guest142@gmail.com"
},
"billing":{
"name":"Test User",
"line1":"20/13 St. Peters Place",
"line2":"address 2",
"area1":"Edinburgh",
"area2":"",
"postcode":"EH3 9PQ",
"countryCode":"GB",
"phoneNumber":"012485744451"
},
"shipping":{
"name":"Test User",
"line1":"20/13 St. Peters Place",
"line2":"address 2",
"area1":"Edinburgh",
"area2":"",
"postcode":"EH3 9PQ",
"countryCode":"GB",
"phoneNumber":"012485744451"
},
"courier":{
},
"items":[
{
"name":"BS21316-MAGENTA / FUCHSIA-16(1)",
"sku":"BS21316-MAGENTA / FUCHSIA-16",
"quantity":1,
"price":{
"amount":"79.99",
"currency":"GBP"
},
"pageUrl":"http://localhost:3000/product/products/my-brand-pink-jacquard-tie-waist-midi-dress-bs21316-magenta-fuchsia-16",
"imageUrl":"http://localhost:3000/product/products/my-brand-pink-jacquard-tie-waist-midi-dress-bs21316-magenta-fuchsia-16",
"categories":[
]
}
],
"discounts":[
],
"shippingAmount":{
"amount":"0.00",
"currency":"GBP"
},
"taxAmount":{
"amount":"13.33",
"currency":"GBP"
}
},
"events":[
{
"id":"2Qxl2GquYAK4kIJXOx55Z1WX4Hi",
"created":"2023-06-09T09:28:24.880Z",
"expires":null,
"type":"CAPTURED",
"amount":{
"amount":"79.99",
"currency":"GBP"
},
"paymentEventMerchantReference":null
}
]
}
FAQs
BetterCommerce's ClearPay NodeJS SDK enables BC client applications to integrate with ClearPay merchant API system. It publishes an interface to interact with [ClearPay API v2](https://developers.clearpay.co.uk/clearpay-online/reference) endpoints.
The npm package bc-clearpay-sdk receives a total of 7 weekly downloads. As such, bc-clearpay-sdk popularity was classified as not popular.
We found that bc-clearpay-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.