@paddle/paddle-node-sdk
Version:
A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.
26 lines (25 loc) • 1.14 kB
JavaScript
import { PaymentMethodDetails } from './payment-method-details.js';
export class TransactionPaymentAttempt {
paymentAttemptId;
paymentMethodId;
storedPaymentMethodId;
amount;
status;
errorCode;
methodDetails;
createdAt;
capturedAt;
constructor(transactionPaymentAttempt) {
this.paymentAttemptId = transactionPaymentAttempt.payment_attempt_id;
this.paymentMethodId = transactionPaymentAttempt.payment_method_id ?? null;
this.storedPaymentMethodId = transactionPaymentAttempt.stored_payment_method_id;
this.amount = transactionPaymentAttempt.amount;
this.status = transactionPaymentAttempt.status;
this.errorCode = transactionPaymentAttempt.error_code ? transactionPaymentAttempt.error_code : null;
this.methodDetails = transactionPaymentAttempt.method_details
? new PaymentMethodDetails(transactionPaymentAttempt.method_details)
: null;
this.createdAt = transactionPaymentAttempt.created_at;
this.capturedAt = transactionPaymentAttempt.captured_at ? transactionPaymentAttempt.captured_at : null;
}
}