New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vivlab/api-database

Package Overview
Dependencies
Maintainers
3
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vivlab/api-database - npm Package Compare versions

Comparing version 1.0.102 to 1.0.103

7

dist/database/checkout/payment.js

@@ -31,3 +31,3 @@ "use strict";

const paymentIntent = await index_1.stripe.paymentIntents.create({
amount: getPaymentIntentAmount(carts),
amount: carts.checkout.total,
currency: "eur",

@@ -42,9 +42,6 @@ // payment_method_types,

async function updateStripePaymentIntent({ id, carts, data, stripeAccount }) {
const paymentIntent = await index_1.stripe.paymentIntents.update(id, { amount: getPaymentIntentAmount(carts), ...data }, { stripeAccount });
const paymentIntent = await index_1.stripe.paymentIntents.update(id, { amount: carts.checkout.total, ...data }, { stripeAccount });
return transform.stripePaymentIntent(paymentIntent);
}
exports.updateStripePaymentIntent = updateStripePaymentIntent;
function getPaymentIntentAmount(carts) {
return (carts.checkout.total - carts.products.reduce((a, v) => (v.recurring ? a + v.unit_amount : a), 0));
}
//# sourceMappingURL=payment.js.map

@@ -10,6 +10,6 @@ "use strict";

const shipingAddress = invoice.shipping_address;
const address = invoice.billing_address || shipingAddress;
const address = invoice.billing_address?.line1 ? invoice.billing_address : shipingAddress;
const customer = await index_1.stripe.customers.create({
email: invoice.email,
name: address.name ?? undefined,
name: address.name || undefined,
phone: address.phone ?? undefined,

@@ -43,3 +43,3 @@ payment_method,

}, { stripeAccount });
await index_1.stripe.subscriptionSchedules.create({
const subscriptionSchedule = await index_1.stripe.subscriptionSchedules.create({
customer: customer.id,

@@ -53,4 +53,8 @@ start_date: "now",

}, { stripeAccount });
const subscription = await index_1.stripe.subscriptions.retrieve(subscriptionSchedule.subscription, {
stripeAccount
});
await index_1.stripe.invoices.pay(subscription.latest_invoice, { paid_out_of_band: true }, { stripeAccount });
}
exports.create = create;
//# sourceMappingURL=subscription.js.map
{
"name": "@vivlab/api-database",
"version": "1.0.102",
"version": "1.0.103",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc