@paddle/paddle-node-sdk
Version:
A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.
18 lines (17 loc) • 934 B
JavaScript
import { PaymentCard, PaymentMethodUnderlyingDetails, PayPal } from '../shared/index.js';
export class PaymentMethod {
constructor(paymentMethodResponse) {
this.id = paymentMethodResponse.id;
this.customerId = paymentMethodResponse.customer_id;
this.addressId = paymentMethodResponse.address_id;
this.type = paymentMethodResponse.type;
this.card = paymentMethodResponse.card ? new PaymentCard(paymentMethodResponse.card) : null;
this.paypal = paymentMethodResponse.paypal ? new PayPal(paymentMethodResponse.paypal) : null;
this.underlyingDetails = paymentMethodResponse.underlying_details
? new PaymentMethodUnderlyingDetails(paymentMethodResponse.underlying_details)
: null;
this.origin = paymentMethodResponse.origin;
this.savedAt = paymentMethodResponse.saved_at;
this.updatedAt = paymentMethodResponse.updated_at;
}
}