Skip to content

Commit 40182e8

Browse files
committed
some adjusts
1 parent 2fc8618 commit 40182e8

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

components/xendit/actions/create-invoice/create-invoice.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
INVOICE_NOTIFICATION_OPTIONS,
33
LOCALE_OPTIONS,
4+
PAYMENT_METHODS_OPTIONS,
45
} from "../../common/constants.mjs";
56
import { parseObject } from "../../common/utils.mjs";
67
import xendit from "../../xendit.app.mjs";
@@ -99,10 +100,10 @@ export default {
99100
optional: true,
100101
},
101102
paymentMethods: {
102-
propDefinition: [
103-
xendit,
104-
"paymentMethods",
105-
],
103+
type: "string[]",
104+
label: "Payment Methods",
105+
description: "Specify the payment channels that you wish to be available on your Invoice.",
106+
options: PAYMENT_METHODS_OPTIONS,
106107
optional: true,
107108
},
108109
currency: {

components/xendit/actions/create-payout/create-payout.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { v7 as uuidV7 } from "uuid";
12
import { parseObject } from "../../common/utils.mjs";
23
import xendit from "../../xendit.app.mjs";
34

@@ -80,6 +81,9 @@ export default {
8081
async run({ $ }) {
8182
const response = await this.xendit.createPayout({
8283
$,
84+
headers: {
85+
"idempotency-key": uuidV7(),
86+
},
8387
data: {
8488
reference_id: this.referenceId,
8589
channel_code: this.channelCode,

components/xendit/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^3.0.3"
16+
"@pipedream/platform": "^3.0.3",
17+
"uuid": "^11.1.0"
1718
}
1819
}

components/xendit/xendit.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
return {
2121
options: data.map(({ id }) => id),
2222
context: {
23-
afterId: data[data.length - 1].id,
23+
afterId: data[data?.length - 1]?.id,
2424
},
2525
};
2626
},

0 commit comments

Comments
 (0)