From 2c5216792ab97cb6237c85cdf13f1f27d9ba2d86 Mon Sep 17 00:00:00 2001 From: EdamAme <121654029+EdamAme-x@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:43:12 +0900 Subject: [PATCH] fix --- deno_dist/README.md | 8 ++++++-- deno_dist/utils/parse.ts | 20 ++++++++++++++++++++ src/utils/parse.ts | 20 ++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/deno_dist/README.md b/deno_dist/README.md index 8524ce7..72bc0f7 100644 --- a/deno_dist/README.md +++ b/deno_dist/README.md @@ -2,6 +2,8 @@ PayPay UnOffical api Rapper Library | Various PayPay operations can be automated, from login to balance transfer and confirmation. Open Source Software ๐ŸŽ +icon + can call it either **paypax** or **PayPax**. for Node.js, Deno, Bun (all :) ) @@ -47,8 +49,9 @@ import { PayPay } from "https://deno.land/x/paypax/mod.ts" ``` ## Docs -ไฝœ่€…ใซ่žใใ‹ -[example](./example) ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใฎใ‚ณใƒผใƒ‰ใ‚’่ฆ‹ใฆใใ ใ•ใ„ใ€‚ +[https://edamame-x.github.io/paypax](https://edamame-x.github.io/paypax/) + +[example](./example) ### Error 0็•ช ใƒฉใ‚คใƒ–ใƒฉใƒชใฎๅˆๆœŸๅŒ–ใ‚จใƒฉใƒผ @@ -72,3 +75,4 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) Created by [@amex2189](https://ame-x.net) Python็‰ˆ ๅ…ƒ็‰ˆ: [https://github.com/taka-4602/PayPaython](https://github.com/taka-4602/PayPaython) +ๅŠฉ่จ€ Disocrd: @developerspartner \ No newline at end of file diff --git a/deno_dist/utils/parse.ts b/deno_dist/utils/parse.ts index bfcf395..c9d9e90 100644 --- a/deno_dist/utils/parse.ts +++ b/deno_dist/utils/parse.ts @@ -85,6 +85,26 @@ export function parseCreateLink(result: Anyone): ResponseCreateLink { } export function parseGetLink(result: Anyone): ResponseGetLink { + if (!('pendingP2PInfo' in result.payload)) { + return { + success: false, + orderId: '', + orderType: '', + description: '', + imageUrl: '', + amount: 0, + link: '', + isSetPasscode: false, + createdAt: '', + acceptedAt: '', + money_type: '', + sender_name: '', + sender_external_id: '', + photo_url: '', + raw: result, + } + } + return { success: isSuccess(result), orderId: result.payload.pendingP2PInfo.orderId, diff --git a/src/utils/parse.ts b/src/utils/parse.ts index aae310b..c112511 100644 --- a/src/utils/parse.ts +++ b/src/utils/parse.ts @@ -85,6 +85,26 @@ export function parseCreateLink(result: Anyone): ResponseCreateLink { } export function parseGetLink(result: Anyone): ResponseGetLink { + if (!('pendingP2PInfo' in result.payload)) { + return { + success: false, + orderId: '', + orderType: '', + description: '', + imageUrl: '', + amount: 0, + link: '', + isSetPasscode: false, + createdAt: '', + acceptedAt: '', + money_type: '', + sender_name: '', + sender_external_id: '', + photo_url: '', + raw: result, + } + } + return { success: isSuccess(result), orderId: result.payload.pendingP2PInfo.orderId,