@pague-dev/sdk-node 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +29 -3
- package/dist/index.d.mts +29 -3
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -20,6 +20,7 @@ interface CompanyDetail {
|
|
|
20
20
|
interface BalanceDetail {
|
|
21
21
|
available: BalanceAmount;
|
|
22
22
|
promotional: BalanceAmount;
|
|
23
|
+
held: BalanceAmount;
|
|
23
24
|
total: BalanceAmount;
|
|
24
25
|
currency: string;
|
|
25
26
|
updatedAt: string;
|
|
@@ -384,7 +385,7 @@ declare class Pdev {
|
|
|
384
385
|
/**
|
|
385
386
|
* Available webhook event types
|
|
386
387
|
*/
|
|
387
|
-
type WebhookEventType = 'payment_completed' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed';
|
|
388
|
+
type WebhookEventType = 'payment_completed' | 'payment_expired' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed';
|
|
388
389
|
/**
|
|
389
390
|
* Base webhook payload structure
|
|
390
391
|
*/
|
|
@@ -425,6 +426,27 @@ interface PaymentCompletedData {
|
|
|
425
426
|
/** Custom metadata passed when creating the payment */
|
|
426
427
|
metadata?: Record<string, unknown>;
|
|
427
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* Data payload for payment_expired event
|
|
431
|
+
*/
|
|
432
|
+
interface PaymentExpiredData {
|
|
433
|
+
/** Transaction identifier */
|
|
434
|
+
transactionId: string;
|
|
435
|
+
/** Payment amount */
|
|
436
|
+
amount: number;
|
|
437
|
+
/** Currency code (e.g., "BRL") */
|
|
438
|
+
currency: string;
|
|
439
|
+
/** Payment method used (e.g., "pix") */
|
|
440
|
+
paymentMethod: string;
|
|
441
|
+
/** Payment status */
|
|
442
|
+
status: 'expired';
|
|
443
|
+
/** ISO 8601 timestamp of when payment expired */
|
|
444
|
+
expiredAt: string;
|
|
445
|
+
/** Your external reference ID (optional) */
|
|
446
|
+
externalReference?: string;
|
|
447
|
+
/** Custom metadata passed when creating the payment */
|
|
448
|
+
metadata?: Record<string, unknown>;
|
|
449
|
+
}
|
|
428
450
|
/**
|
|
429
451
|
* Data payload for refund_completed event
|
|
430
452
|
*/
|
|
@@ -502,6 +524,10 @@ interface WithdrawalFailedData {
|
|
|
502
524
|
* Payment completed webhook event
|
|
503
525
|
*/
|
|
504
526
|
type PaymentCompletedEvent = WebhookPayload<'payment_completed', PaymentCompletedData>;
|
|
527
|
+
/**
|
|
528
|
+
* Payment expired webhook event
|
|
529
|
+
*/
|
|
530
|
+
type PaymentExpiredEvent = WebhookPayload<'payment_expired', PaymentExpiredData>;
|
|
505
531
|
/**
|
|
506
532
|
* Refund completed webhook event
|
|
507
533
|
*/
|
|
@@ -517,7 +543,7 @@ type WithdrawalFailedEvent = WebhookPayload<'withdrawal_failed', WithdrawalFaile
|
|
|
517
543
|
/**
|
|
518
544
|
* Union type of all possible webhook events
|
|
519
545
|
*/
|
|
520
|
-
type WebhookEvent = PaymentCompletedEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent;
|
|
546
|
+
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent;
|
|
521
547
|
/**
|
|
522
548
|
* Webhook headers sent with each request
|
|
523
549
|
*/
|
|
@@ -607,4 +633,4 @@ interface WebhookHeaders {
|
|
|
607
633
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
608
634
|
declare function parseWebhook(payload: string): WebhookEvent | null;
|
|
609
635
|
//#endregion
|
|
610
|
-
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
|
636
|
+
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentExpiredData, PaymentExpiredEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ interface CompanyDetail {
|
|
|
20
20
|
interface BalanceDetail {
|
|
21
21
|
available: BalanceAmount;
|
|
22
22
|
promotional: BalanceAmount;
|
|
23
|
+
held: BalanceAmount;
|
|
23
24
|
total: BalanceAmount;
|
|
24
25
|
currency: string;
|
|
25
26
|
updatedAt: string;
|
|
@@ -384,7 +385,7 @@ declare class Pdev {
|
|
|
384
385
|
/**
|
|
385
386
|
* Available webhook event types
|
|
386
387
|
*/
|
|
387
|
-
type WebhookEventType = 'payment_completed' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed';
|
|
388
|
+
type WebhookEventType = 'payment_completed' | 'payment_expired' | 'refund_completed' | 'withdrawal_completed' | 'withdrawal_failed';
|
|
388
389
|
/**
|
|
389
390
|
* Base webhook payload structure
|
|
390
391
|
*/
|
|
@@ -425,6 +426,27 @@ interface PaymentCompletedData {
|
|
|
425
426
|
/** Custom metadata passed when creating the payment */
|
|
426
427
|
metadata?: Record<string, unknown>;
|
|
427
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* Data payload for payment_expired event
|
|
431
|
+
*/
|
|
432
|
+
interface PaymentExpiredData {
|
|
433
|
+
/** Transaction identifier */
|
|
434
|
+
transactionId: string;
|
|
435
|
+
/** Payment amount */
|
|
436
|
+
amount: number;
|
|
437
|
+
/** Currency code (e.g., "BRL") */
|
|
438
|
+
currency: string;
|
|
439
|
+
/** Payment method used (e.g., "pix") */
|
|
440
|
+
paymentMethod: string;
|
|
441
|
+
/** Payment status */
|
|
442
|
+
status: 'expired';
|
|
443
|
+
/** ISO 8601 timestamp of when payment expired */
|
|
444
|
+
expiredAt: string;
|
|
445
|
+
/** Your external reference ID (optional) */
|
|
446
|
+
externalReference?: string;
|
|
447
|
+
/** Custom metadata passed when creating the payment */
|
|
448
|
+
metadata?: Record<string, unknown>;
|
|
449
|
+
}
|
|
428
450
|
/**
|
|
429
451
|
* Data payload for refund_completed event
|
|
430
452
|
*/
|
|
@@ -502,6 +524,10 @@ interface WithdrawalFailedData {
|
|
|
502
524
|
* Payment completed webhook event
|
|
503
525
|
*/
|
|
504
526
|
type PaymentCompletedEvent = WebhookPayload<'payment_completed', PaymentCompletedData>;
|
|
527
|
+
/**
|
|
528
|
+
* Payment expired webhook event
|
|
529
|
+
*/
|
|
530
|
+
type PaymentExpiredEvent = WebhookPayload<'payment_expired', PaymentExpiredData>;
|
|
505
531
|
/**
|
|
506
532
|
* Refund completed webhook event
|
|
507
533
|
*/
|
|
@@ -517,7 +543,7 @@ type WithdrawalFailedEvent = WebhookPayload<'withdrawal_failed', WithdrawalFaile
|
|
|
517
543
|
/**
|
|
518
544
|
* Union type of all possible webhook events
|
|
519
545
|
*/
|
|
520
|
-
type WebhookEvent = PaymentCompletedEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent;
|
|
546
|
+
type WebhookEvent = PaymentCompletedEvent | PaymentExpiredEvent | RefundCompletedEvent | WithdrawalCompletedEvent | WithdrawalFailedEvent;
|
|
521
547
|
/**
|
|
522
548
|
* Webhook headers sent with each request
|
|
523
549
|
*/
|
|
@@ -607,4 +633,4 @@ interface WebhookHeaders {
|
|
|
607
633
|
declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
|
|
608
634
|
declare function parseWebhook(payload: string): WebhookEvent | null;
|
|
609
635
|
//#endregion
|
|
610
|
-
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
|
636
|
+
export { AccountDetail, AccountInfo, AccountStatus, BalanceAmount, BalanceDetail, Charge, ChargeStatus, CompanyDetail, CompanyStatus, CreateChargeOptions, CreateChargeResponse, CreateCustomerOptions, CreateCustomerResponse, CreatePixCustomer, CreatePixOptions, CreatePixResponse, CreateProjectOptions, CreateProjectResponse, CreateStaticQrCodeOptions, CreateStaticQrCodeResponse, CreateWithdrawalOptions, CreateWithdrawalResponse, Customer, DocumentType, type ErrorResponse, GetChargeResponse, GetTransactionResponse, ListChargesOptions, ListChargesResponse, ListCustomersOptions, ListCustomersResponse, ListProjectsOptions, ListProjectsResponse, NotificationType, type PaginatedResponse, type PaginationOptions, PaymentCompletedData, PaymentCompletedEvent, PaymentExpiredData, PaymentExpiredEvent, PaymentMethod, Pdev, PixCharge, PixKeyType, PixStatus, Project, RefundCompletedData, RefundCompletedEvent, type Response, SortBy, SortOrder, StaticQrCode, Transaction, TransactionPaymentMethod, TransactionStatus, TransactionType, WebhookEvent, WebhookEventType, WebhookHeaders, WebhookPayload, Withdrawal, WithdrawalCompletedData, WithdrawalCompletedEvent, WithdrawalFailedData, WithdrawalFailedEvent, WithdrawalStatus, parseWebhook, verifyWebhookSignature };
|
package/dist/index.mjs
CHANGED