-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92a5c92
commit 01761c2
Showing
2 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { ConfigurationError } from "@pipedream/platform"; | ||
import quickbooks from "../../quickbooks.app.mjs"; | ||
|
||
export default { | ||
key: "quickbooks-get-payment", | ||
name: "Get Payment", | ||
description: "Returns info about a payment. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/payment#read-a-payment)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
quickbooks, | ||
paymentId: { | ||
propDefinition: [ | ||
quickbooks, | ||
"paymentId", | ||
], | ||
}, | ||
minorVersion: { | ||
propDefinition: [ | ||
quickbooks, | ||
"minorVersion", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
if (!this.paymentId) { | ||
throw new ConfigurationError("Must provide paymentId parameter."); | ||
} | ||
|
||
const response = await this.quickbooks.getPayment({ | ||
$, | ||
paymentId: this.paymentId, | ||
params: { | ||
minorversion: this.minorVersion, | ||
}, | ||
}); | ||
|
||
if (response) { | ||
$.export("summary", `Successfully retrieved payment with id ${response.Payment.Id}`); | ||
} | ||
|
||
return response; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters