Skip to content

Commit

Permalink
⬆️ chore(deps): bump @vippsmobilepay/sdk from 1.3.1 to 2.0.0 (#909)
Browse files Browse the repository at this point in the history
* ⬆️ chore(deps): bump @vippsmobilepay/sdk from 1.3.1 to 2.0.0

Bumps [@vippsmobilepay/sdk](https://github.com/vippsas/deno-sdk) from 1.3.1 to 2.0.0.
- [Release notes](https://github.com/vippsas/deno-sdk/releases)
- [Commits](vippsas/deno-sdk@1.3.1...2.0.0)

---
updated-dependencies:
- dependency-name: "@vippsmobilepay/sdk"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: handle type changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lars Waage <[email protected]>
  • Loading branch information
dependabot[bot] and larwaa authored Sep 13, 2024
1 parent ac9ac9c commit eec11f5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"@prisma/client": "^5.19.1",
"@prisma/instrumentation": "^5.19.1",
"@sentry/node": "^8.30.0",
"@vippsmobilepay/sdk": "^1.3.1",
"@vippsmobilepay/sdk": "^2.0.0",
"bullmq": "^5.13.0",
"connect-redis": "^7.1.1",
"dotenv": "^16.4.5",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "node:assert";
import { faker } from "@faker-js/faker";
import type { EPaymentGetPaymentOKResponse } from "@vippsmobilepay/sdk";
import type { GetPaymentResponse } from "@vippsmobilepay/sdk";
import type { QueueEvents } from "bullmq";
import { type DeepMockProxy, mock, mockDeep } from "jest-mock-extended";
import { User } from "~/domain/users.js";
Expand Down Expand Up @@ -93,7 +93,7 @@ describe("ProductService", () => {
});
vippsMock.payment.info.mockResolvedValue({
ok: true,
data: mockDeep<EPaymentGetPaymentOKResponse>({
data: mockDeep<GetPaymentResponse>({
amount: {
value: 100 * 100,
currency: "NOK",
Expand Down Expand Up @@ -138,7 +138,7 @@ describe("ProductService", () => {
*/
vippsMock.payment.info.mockResolvedValue({
ok: true,
data: mockDeep<EPaymentGetPaymentOKResponse>({
data: mockDeep<GetPaymentResponse>({
amount: {
value: 100 * 100,
currency: "NOK",
Expand Down
4 changes: 2 additions & 2 deletions src/services/products/__tests__/unit/payment-attempt.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { faker } from "@faker-js/faker";
import type { EPaymentErrorResponse } from "@vippsmobilepay/sdk";
import type { Problem } from "@vippsmobilepay/sdk";
import { mock } from "jest-mock-extended";
import {
DownstreamServiceError,
Expand Down Expand Up @@ -383,7 +383,7 @@ describe("ProductService", () => {

mockVippsClient.payment.create.mockResolvedValueOnce({
ok: false,
error: mock<EPaymentErrorResponse>({}),
error: mock<Problem>({}),
});

const result = await productService.payments.initiatePaymentAttempt(
Expand Down
9 changes: 9 additions & 0 deletions src/services/products/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,15 @@ function buildPayments({
};
}

if (!vippsPayment.data.redirectUrl) {
return {
ok: false,
error: new DownstreamServiceError(
"Failed to create vipps payment, received no redirect url",
),
};
}

const { paymentAttempt } = await productRepository.createPaymentAttempt({
order: {
id: order.id,
Expand Down

0 comments on commit eec11f5

Please sign in to comment.