UNPKG

securepay

Version:

https://www.securepay.com.au/

51 lines (50 loc) 2.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Paypal = void 0; var paypal_transaction_1 = require("../services/payments/paypal/paypal-transaction/paypal-transaction"); var Paypal = /** @class */ (function () { function Paypal(options) { this._paypalTransaction = new paypal_transaction_1.PaypalTransactionService(options); } /** * Initiates a PayPal express checkout transaction. * https://auspost.com.au/payments/docs/securepay/?javascript#securepay-api-paypal-payments-rest-api-initiate-paypal-transaction * * @param {PaypalTransactionInitial} payload */ Paypal.prototype.initialTransaction = function (payload) { return this._paypalTransaction.initialTransaction(payload); }; /** * Executes a PayPal express checkout transaction after the customer has logged into PayPal and accepted it. * https://auspost.com.au/payments/docs/securepay/?javascript#securepay-api-paypal-payments-rest-api-execute-paypal-transaction * * @param {string} orderId * @param {PaypalTransactionExecute} payload */ Paypal.prototype.executeTransaction = function (orderId, payload) { return this._paypalTransaction.executeTransaction(orderId, payload); }; /** * Refunds a previously executed PayPal transaction * https://auspost.com.au/payments/docs/securepay/?javascript#securepay-api-paypal-payments-rest-api-refund-paypal-transaction * * @param {string} orderId * @param {PaypalTransactionRefund} payload */ Paypal.prototype.refundTransaction = function (orderId, payload) { return this._paypalTransaction.refundTransaction(orderId, payload); }; /** * Retrieves billing & shipping details for a customer that has previously initiated/executed a PayPal transaction * https://auspost.com.au/payments/docs/securepay/?javascript#securepay-api-paypal-payments-rest-api-retrieve-paypal-order-details * * @param {string} orderId * @param {string} merchantCode */ Paypal.prototype.retrieveTransaction = function (orderId, merchantCode) { return this._paypalTransaction.retrieveTransaction(orderId, merchantCode); }; return Paypal; }()); exports.Paypal = Paypal;