import { FetchAdapter } from '../adapters/FetchAdapter'; import Heidelpay from '../Heidelpay'; import PaymentType from '../payments/types/PaymentType'; import { Customer } from '../payments/Customer'; import Metadata from '../payments/Metadata'; import Basket from '../payments/Basket'; import Authorization, { authorizeObject, chargeAuthorizeObject } from '../payments/business/Authorization'; import Cancel, { cancelAuthorizeObject, cancelChargeObject } from '../payments/business/Cancel'; import Charge, { chargeObject } from '../payments/business/Charge'; 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 Payout, { payoutObject } from '../payments/business/Payout'; 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 PaymentService { private requestAdapter; private heidelpay; constructor(heidelpay: Heidelpay, locale?: string, env?: string); /** * Get Heidelpay instance * * @returns {Heidelpay} */ getHeidelpay(): Heidelpay; /** * Get request adapter * * @returns {FetchAdapter} */ getRequestAdapter(): FetchAdapter; /** * Create payment type * * @param {PaymentType} paymentType * @returns {Promise} */ createPaymentType(paymentType: AbstractPaymentType): Promise; /** * Fetch a payment * * @param {string} paymentId * @returns {Promise} */ fetchPayment(paymentId: string): Promise; /** * Fetch a payment type * * @param {string} paymentTypeId * @returns {Promise} */ fetchPaymentType(paymentTypeId: string): Promise; /** * Create customer * * @param {Customer} customer * @returns {Promise} */ createCustomer(customer: Customer): Promise; /** * Fetch customer info by customer Id * * @param {string} customerId * @returns {Promise} */ fetchCustomer(customerId: string): Promise; /** * Update data 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 * @returns {Promise} */ createMetadata(metadata: Metadata): Promise; /** * Fetch metadata * * @param {Metadata} metadata * @returns {Promise} */ fetchMetadata(metadataId: string): Promise; /** * Create basket * * @param {Basket} baskset * @returns {Promise} */ createBasket(basket: Basket): Promise; /** * Fetch basket * * @param {Basket} baskset * @returns {Promise} */ fetchBasket(basketId: string): Promise; /** * Fetch basket * * @param {Basket} baskset * @returns {Promise} */ updateBasket(basketId: string, basket: Basket): Promise; /** * Authorize a payment * * @param {authorizeObject} args * @returns {Promise} */ authorize(args: authorizeObject): Promise; /** * Charge a payment * * @param {chargeObject} args * @returns {Promise} */ charge(args: chargeObject): Promise; /** * Charge after authorization * * @param {chargeAuthorizeObject} args * @returns {Promise} */ chargeAuthorization(args: chargeAuthorizeObject): Promise; /** * Reversal a payment * * @param {cancelAuthorizeObject} args * @returns {Promise} */ cancelAuthorization(args: cancelAuthorizeObject): Promise; /** * Refund a payment * * @param {cancelChargeObject} args * @returns {Promise} */ cancelCharge(args: cancelChargeObject): Promise; /** * Shipment * * @param {string} paymentId * @returns {Promise} */ shipment(paymentId: string, args: shipmentObject): Promise; /** * Init authorize paypage * * @param {Paypage} paypage * @returns {Promise} */ initAuthorizePaypage(paypage: Paypage): Promise; /** * Init charge paypage * * @param {Paypage} paypage * @returns {Promise} */ initChargePaypage(paypage: Paypage): Promise; /** * Init authorize linkpay * * @param {Linkpay} linkpay * @returns {Promise} */ initAuthorizeLinkpay(linkpay: Linkpay): Promise; /** * Init charge linkpay * * @param {Linkpay} linkpay * @returns {Promise} */ initChargeLinkpay(linkpay: Linkpay): Promise; /** * Update linkpay * * @param {string} linkpayIdOrAlias * @param {updateLinkpayObject} linkpayObj * @returns {Promise} */ updateLinkpay(linkpayIdOrAlias: string, linkpay: Linkpay): Promise; /** * Delete linkpay * * @param {string} linkpayIdOrAlias * @returns {Promise} */ deleteLinkpay(linkpayIdOrAlias: string): Promise; /** * Init charge paypage * * @param {Paypage} paypage * @returns {Promise} */ payout(args: payoutObject): Promise; /** * Fetch a payout object * * @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>; /** * Update HirePurchase * * @param {string} hirePurchaseId * @param {updateHirePurchaseObject} hirePurchase * @returns {Promise} */ updateHirePurchase(hirePurchaseId: string, hirePurchase: updateHirePurchaseObject): Promise; /** * Start Recurring * * @param {string} paymentId * @param {recurringObj} args */ startRecurring(paymentId: string, args: recurringObject): 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 {string} id * @returns {Promise} */ updateWebhook(id: string, args: any): Promise; /** * Delete Webhook * * @param {string} id * @returns {Promise} */ deleteWebhook(id?: string): Promise; }