valr-typescript-client 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1893,12 +1893,93 @@ var PayAPI = class {
1893
1893
  constructor(http) {
1894
1894
  this.http = http;
1895
1895
  }
1896
+ /**
1897
+ * Create a new P2P payment
1898
+ * POST /v1/pay
1899
+ *
1900
+ * @param request - Payment request (must specify one of: recipientEmail, recipientCellNumber, or recipientPayId)
1901
+ * @returns Payment response with identifier and transaction ID
1902
+ */
1896
1903
  async createPayment(request) {
1897
- const response = await this.http.post("/v1/pay/payment", request);
1904
+ const response = await this.http.post("/v1/pay", request);
1905
+ return response.data;
1906
+ }
1907
+ /**
1908
+ * Reverse a payment completely
1909
+ * PUT /v1/pay/transactionid/:transactionId/reverse
1910
+ *
1911
+ * @param transactionId - Transaction ID to reverse
1912
+ * @returns Reversal confirmation
1913
+ */
1914
+ async reversePayment(transactionId) {
1915
+ await this.http.put(`/v1/pay/transactionid/${transactionId}/reverse`);
1916
+ }
1917
+ /**
1918
+ * Partially reverse a payment
1919
+ * PUT /v1/pay/transactionid/:transactionId/partial-reverse
1920
+ *
1921
+ * @param transactionId - Transaction ID to partially reverse
1922
+ * @param amountToReverse - Amount to reverse
1923
+ * @returns Partial reversal confirmation
1924
+ */
1925
+ async partiallyReversePayment(transactionId, amountToReverse) {
1926
+ await this.http.put(`/v1/pay/transactionid/${transactionId}/partial-reverse`, {
1927
+ amountToReverse
1928
+ });
1929
+ }
1930
+ /**
1931
+ * Get payment limits for a currency
1932
+ * GET /v1/pay/limits
1933
+ *
1934
+ * @param currency - Currency code (e.g., "BTC", "ZAR")
1935
+ * @returns Payment limits for the specified currency
1936
+ */
1937
+ async getPaymentLimits(currency) {
1938
+ const response = await this.http.get("/v1/pay/limits", {
1939
+ params: { currency }
1940
+ });
1898
1941
  return response.data;
1899
1942
  }
1900
- async getPaymentStatus(paymentId) {
1901
- const response = await this.http.get(`/v1/pay/payment/${paymentId}`);
1943
+ /**
1944
+ * Get your Pay ID (unique identifier for receiving payments)
1945
+ * GET /v1/pay/payid
1946
+ *
1947
+ * @returns Your Pay ID
1948
+ */
1949
+ async getPayId() {
1950
+ const response = await this.http.get("/v1/pay/payid");
1951
+ return response.data;
1952
+ }
1953
+ /**
1954
+ * Get payment history (sent and received payments)
1955
+ * GET /v1/pay/history
1956
+ *
1957
+ * @returns Array of payment history items
1958
+ */
1959
+ async getPaymentHistory() {
1960
+ const response = await this.http.get("/v1/pay/history");
1961
+ return response.data;
1962
+ }
1963
+ /**
1964
+ * Get payment details by identifier
1965
+ * GET /v1/pay/identifier/:identifier
1966
+ *
1967
+ * @param identifier - Payment identifier
1968
+ * @returns Payment details
1969
+ */
1970
+ async getPaymentByIdentifier(identifier) {
1971
+ const response = await this.http.get(`/v1/pay/identifier/${identifier}`);
1972
+ return response.data;
1973
+ }
1974
+ /**
1975
+ * Get payment status by transaction ID
1976
+ * GET /v1/pay/transactionid/:transactionId
1977
+ *
1978
+ * @param transactionId - Transaction ID
1979
+ * @returns Payment status
1980
+ */
1981
+ async getPaymentStatus(transactionId) {
1982
+ const response = await this.http.get(`/v1/pay/transactionid/${transactionId}`);
1902
1983
  return response.data;
1903
1984
  }
1904
1985
  };