@inkress/admin-sdk 1.1.45 → 1.1.47
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/README.md +247 -13
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +100 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +100 -7
- package/dist/index.js.map +1 -1
- package/dist/resources/checkout-sessions.d.ts +201 -0
- package/dist/resources/checkout-sessions.d.ts.map +1 -0
- package/dist/resources/kyc.d.ts +1 -19
- package/dist/resources/kyc.d.ts.map +1 -1
- package/dist/resources/merchants.d.ts +35 -1
- package/dist/resources/merchants.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2407,6 +2407,18 @@ class MerchantsResource {
|
|
|
2407
2407
|
async invoice(invoiceId) {
|
|
2408
2408
|
return this.client.post(`/merchants/account/invoice/${invoiceId}`);
|
|
2409
2409
|
}
|
|
2410
|
+
/**
|
|
2411
|
+
* Request for bank account update
|
|
2412
|
+
*/
|
|
2413
|
+
async updateBankInfo(data) {
|
|
2414
|
+
return this.client.post('/merchants/bank_account/update_request', { bank_account: data });
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Confirm bank account information update with OTP codde
|
|
2418
|
+
*/
|
|
2419
|
+
async confirmBankInfo(otp) {
|
|
2420
|
+
return this.client.post('/merchants/bank_account/update_confirm', { otp });
|
|
2421
|
+
}
|
|
2410
2422
|
/**
|
|
2411
2423
|
* Query merchants with enhanced query support
|
|
2412
2424
|
* @example
|
|
@@ -3602,13 +3614,6 @@ class KycResource {
|
|
|
3602
3614
|
async uploadDocument(data) {
|
|
3603
3615
|
return this.client.post('/legal_requests', data);
|
|
3604
3616
|
}
|
|
3605
|
-
/**
|
|
3606
|
-
* Update bank information
|
|
3607
|
-
* Requires Client-Id header to be set in the configuration
|
|
3608
|
-
*/
|
|
3609
|
-
async updateBankInfo(data) {
|
|
3610
|
-
return this.client.post('/legal_requests', data);
|
|
3611
|
-
}
|
|
3612
3617
|
// ============================================================================
|
|
3613
3618
|
// KYC DOCUMENT REQUIREMENTS & STATUS
|
|
3614
3619
|
// ============================================================================
|
|
@@ -4856,6 +4861,93 @@ class GenericsResource {
|
|
|
4856
4861
|
}
|
|
4857
4862
|
}
|
|
4858
4863
|
|
|
4864
|
+
/**
|
|
4865
|
+
* Checkout Sessions Resource
|
|
4866
|
+
*
|
|
4867
|
+
* Handles creation and management of checkout sessions for payments.
|
|
4868
|
+
* Checkout sessions provide a way to create temporary payment sessions
|
|
4869
|
+
* with pre-calculated fees and payment URLs.
|
|
4870
|
+
*/
|
|
4871
|
+
class CheckoutSessionsResource {
|
|
4872
|
+
constructor(client) {
|
|
4873
|
+
this.client = client;
|
|
4874
|
+
}
|
|
4875
|
+
/**
|
|
4876
|
+
* Create a new checkout session
|
|
4877
|
+
*
|
|
4878
|
+
* Creates a checkout session with pre-calculated fees and returns
|
|
4879
|
+
* payment URLs for processing the payment.
|
|
4880
|
+
*
|
|
4881
|
+
* Requires Client-Id header to be set in the configuration.
|
|
4882
|
+
*
|
|
4883
|
+
* @param data - Order data for the checkout session (same as order creation)
|
|
4884
|
+
* @returns The created checkout session with payment URLs and fee breakdown
|
|
4885
|
+
*
|
|
4886
|
+
* @example
|
|
4887
|
+
* ```typescript
|
|
4888
|
+
* const session = await sdk.checkoutSessions.create({
|
|
4889
|
+
* reference_id: 'order-123',
|
|
4890
|
+
* total: 100.00,
|
|
4891
|
+
* kind: 'online',
|
|
4892
|
+
* currency_code: 'JMD',
|
|
4893
|
+
* customer: {
|
|
4894
|
+
* email: 'customer@example.com',
|
|
4895
|
+
* first_name: 'John',
|
|
4896
|
+
* last_name: 'Doe',
|
|
4897
|
+
* phone: '+1234567890'
|
|
4898
|
+
* },
|
|
4899
|
+
* title: 'My Order'
|
|
4900
|
+
* });
|
|
4901
|
+
*
|
|
4902
|
+
* // Redirect customer to payment URL
|
|
4903
|
+
* console.log(session.result.payment_url);
|
|
4904
|
+
* ```
|
|
4905
|
+
*/
|
|
4906
|
+
async create(data) {
|
|
4907
|
+
return this.client.post('/checkout/sessions', data);
|
|
4908
|
+
}
|
|
4909
|
+
/**
|
|
4910
|
+
* Get checkout session details by session ID
|
|
4911
|
+
*
|
|
4912
|
+
* Retrieves the current state of a checkout session including
|
|
4913
|
+
* payment status, customer info, and fee breakdown.
|
|
4914
|
+
*
|
|
4915
|
+
* Requires Client-Id header to be set in the configuration.
|
|
4916
|
+
*
|
|
4917
|
+
* @param sessionId - The session ID (e.g., 'S.75a29ad32e52')
|
|
4918
|
+
* @returns The checkout session details
|
|
4919
|
+
*
|
|
4920
|
+
* @example
|
|
4921
|
+
* ```typescript
|
|
4922
|
+
* const session = await sdk.checkoutSessions.get('S.75a29ad32e52');
|
|
4923
|
+
* console.log(session.result.status); // 'awaiting_payment'
|
|
4924
|
+
* ```
|
|
4925
|
+
*/
|
|
4926
|
+
async get(sessionId) {
|
|
4927
|
+
return this.client.get(`/checkout/sessions/${sessionId}`);
|
|
4928
|
+
}
|
|
4929
|
+
/**
|
|
4930
|
+
* Delete (cancel) a checkout session
|
|
4931
|
+
*
|
|
4932
|
+
* Cancels an active checkout session. Once cancelled, the session
|
|
4933
|
+
* can no longer be used for payment.
|
|
4934
|
+
*
|
|
4935
|
+
* Requires Client-Id header to be set in the configuration.
|
|
4936
|
+
*
|
|
4937
|
+
* @param sessionId - The session ID to cancel (e.g., 'S.75a29ad32e52')
|
|
4938
|
+
* @returns Confirmation of the cancellation
|
|
4939
|
+
*
|
|
4940
|
+
* @example
|
|
4941
|
+
* ```typescript
|
|
4942
|
+
* const result = await sdk.checkoutSessions.delete('S.75a29ad32e52');
|
|
4943
|
+
* console.log(result.result); // 'Session cancelled'
|
|
4944
|
+
* ```
|
|
4945
|
+
*/
|
|
4946
|
+
async delete(sessionId) {
|
|
4947
|
+
return this.client.delete(`/checkout/sessions/${sessionId}`);
|
|
4948
|
+
}
|
|
4949
|
+
}
|
|
4950
|
+
|
|
4859
4951
|
/**
|
|
4860
4952
|
* Main Inkress Commerce API SDK class
|
|
4861
4953
|
*
|
|
@@ -4924,6 +5016,7 @@ class InkressSDK {
|
|
|
4924
5016
|
this.paymentMethods = new PaymentMethodsResource(this.client);
|
|
4925
5017
|
this.transactionEntries = new TransactionEntriesResource(this.client);
|
|
4926
5018
|
this.generics = new GenericsResource(this.client);
|
|
5019
|
+
this.checkoutSessions = new CheckoutSessionsResource(this.client);
|
|
4927
5020
|
}
|
|
4928
5021
|
/**
|
|
4929
5022
|
* Update the SDK configuration
|