import { Customer } from './payments/Customer'; import Metadata from './payments/Metadata'; import Basket from './payments/Basket'; import PaymentType from './payments/types/PaymentType'; import Authorization, { authorizeObject, chargeAuthorizeObject } from './payments/business/Authorization'; import Payout, { payoutObject } from './payments/business/Payout'; import Charge, { chargeObject } from './payments/business/Charge'; import Cancel, { cancelAuthorizeObject, cancelChargeObject } from './payments/business/Cancel'; import Paypage from './payments/paypage/Paypage'; import Linkpay from './payments/paypage/Linkpay'; import Payment from './payments/business/Payment'; import AbstractPaymentType from './payments/types/AbstractPaymentType'; import Shipment, { shipmentObject } from './payments/business/Shipment'; import Recurring, { recurringObject } from './payments/business/Recurring'; import HirePurchasePlan from './payments/types/HirePurchasePlan'; import HirePurchase, { updateHirePurchaseObject } from './payments/types/HirePurchase'; import Webhook, { webhookObject } from './payments/business/Webhook'; export default class Heidelpay { private paymentService; private privateKey; constructor(privateKey: string, locale?: string, env?: string); /** * Get SDK Version * * @returns {string} */ getVersion(): string; /** * Get private key * * @returns {string} */ getPrivateKey(): string; /** * Create a payment * * @param {PaymentType} paymentType * @returns {PaymentType} */ createPaymentType(paymentType: AbstractPaymentType): Promise; /** * Create new customer * * @param {Customer} customer * @returns {Customer} */ createCustomer(customer: Customer): Promise; /** * Fetch a customer * * @param {string} customerId * @returns {Promise} */ fetchCustomer(customerId: string): Promise; /** * Update customer * * @param {string} customerId * @param {Customer} customer * @returns {Promise} */ updateCustomer(customerId: string, customer: Customer): Promise; /** * Delete a customer * * @param {string} customerId * @returns {Promise} */ deleteCustomer(customerId: string): Promise; /** * Create metadata * * @param {Metadata} metadata */ createMetadata(metadata: Metadata): Promise; /** * Fetch metadata information * * @param metadataId */ fetchMetadata(metadataId: string): Promise; /** * Create a basket * * @param {Basket} basket * @returns {Basket} */ createBasket(basket: Basket): Promise; /** * Fetch a basket * * @param {Basket} basket * @returns {Basket} */ fetchBasket(basketId: string): Promise; /** * Update basket * * @param {Basket} basket * @returns {Basket} */ updateBasket(basketId: string, basket: Basket): Promise; /** * Fetch a payment * * @param {string} orderId * @returns {Promise} */ fetchPaymentType(paymentTypeId: string): Promise; /** * Fetch a payment * * @param {string} orderId * @returns {Promise} */ fetchPayment(paymentId: string): Promise; /** * Fetch authorization transaction * * @param {string} paymentId * @returns {Promise} */ fetchAuthorization(paymentId: string): Promise; /** * Fetch charge transaction * * @param {string} paymentId * @param {string} chargeId * @returns {Promise} */ fetchCharge(paymentId: string, chargeId: string): Promise; /** * Fetch cancel transaction * * @param {string} paymentId * @param {string} refundId * @param {string} cancelId * @returns {Promise} */ fetchCancel(paymentId: string, cancelId: string, refundId?: string): Promise; /** * Heidelpay Authorize * * @param {authorizeObject} args * @returns {Authorization} */ authorize(args: authorizeObject): Promise; /** * Heidelpay Charge * * @param {chargeObject} args * @returns {Promise} */ charge(args: chargeObject): Promise; /** * Heidelpay Charge after authorization * * @param {chargeAuthorizeObject} args * @returns {Promise} */ chargeAuthorization(args: chargeAuthorizeObject): Promise; /** * Reversal (Cancel of authorize) * * @param {cancelAuthorizeObject} args * @returns {Promise} */ cancelAuthorization(args: cancelAuthorizeObject): Promise; /** * Cancel charge * * @param {cancelChargeObject} args * @returns {Promise} */ cancelCharge(args: cancelChargeObject): Promise; /** * Shipment * * @param paymentId */ shipment(paymentId: string, args: shipmentObject): Promise; /** * Start recurring * * @param {string} paymentId * @param {recurringObj} args */ startRecurring(paymentId: string, args: recurringObject): Promise; /** * Init Paypage with authorize * * @param {Paypage} paypage * @returns {Promise} */ initAuthorizePaypage(paypage: Paypage): Promise; /** * Init Paypage with charge * * @param {Paypage} paypage * @returns {Promise} */ initChargePaypage(paypage: Paypage): Promise; /** * Init Linkpay with authorize * * @param {Linkpay} linkpay * @returns {Promise} */ initAuthorizeLinkpay(linkpay: Linkpay): Promise; /** * Init Linkpay with charge * * @param {Linkpay} linkpay * @returns {Promise} */ initChargeLinkpay(linkpay: Linkpay): Promise; /** * Update Linkpay * * @param {string} linkpayIdOrAlias * @param {Linkpay} linkpay * @returns {Promise} */ updateLinkpay(linkpayIdOrAlias: string, linkpay: Linkpay): Promise; /** * Delete Linkpay * * @param {string} linkpayIdOrAlias * @returns {Promise} */ deleteLinkpay(linkpayIdOrAlias: string): Promise; /** * Heidelpay Payout * * @param {payoutObject} args * @returns {Payout} */ payout(args: payoutObject): Promise; /** * Fetch payout transaction * * @param {string} paymentId * @param {string} payoutId * @returns {Promise} */ fetchPayout(paymentId: string, payoutId: string): Promise; /** * Fetch hire purchase plans * * @param {string} amount * @param {string} currency * @param {string} effectiveInterestRate * @param {string} orderDate * @returns {Promise} */ fetchHirePurchasePlan(amount: string, currency: string, effectiveInterestRate: string, orderDate: string): Promise>; updateHirePurchase(hirePurchaseId: string, hirePurchase: updateHirePurchaseObject): Promise; /** * Register Webhook * * @param {webhookObject} args * @returns {Promise} */ registerWebhook(args: webhookObject): Promise; /** * Fetch Webhook * * @param {string} id * @returns {Promise} */ fetchWebhook(id?: string): Promise; /** * Update Webhook * * @param {any} args * @param {string} id * @returns {Promise} */ updateWebhook(id: string, args: any): Promise; /** * Delete Webhook * * @param {string} id * @returns {Promise} */ deleteWebhook(id?: string): Promise; }