@tagadapay/plugin-sdk 1.0.12 → 1.0.14

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.
@@ -204,15 +204,18 @@ export function usePayment() {
204
204
  throw error;
205
205
  }
206
206
  }, [basisTheory, apiService]);
207
- // Process payment directly with checkout session
207
+ // Process payment directly with checkout session (V2)
208
208
  const processPaymentDirect = useCallback(async (checkoutSessionId, paymentInstrumentId, threedsSessionId, options = {}) => {
209
209
  try {
210
- // Create order and process payment in one call
211
- const response = await apiService.fetch(`/api/v1/checkout-sessions/${checkoutSessionId}/pay`, {
210
+ // Create order and process payment in one call using V2 endpoint
211
+ const response = await apiService.fetch(`/api/public/v1/checkout/pay-v2`, {
212
212
  method: 'POST',
213
213
  body: {
214
+ checkoutSessionId,
214
215
  paymentInstrumentId,
215
- threedsSessionId,
216
+ ...(threedsSessionId && { threedsSessionId }),
217
+ ...(options.initiatedBy && { initiatedBy: options.initiatedBy }),
218
+ ...(options.source && { source: options.source }),
216
219
  },
217
220
  });
218
221
  console.log('Payment response:', response);
@@ -12,6 +12,7 @@ export { useCustomer } from './hooks/useCustomer';
12
12
  export { useEnvironment } from './hooks/useEnvironment';
13
13
  export { useLocale } from './hooks/useLocale';
14
14
  export { useAuth } from './hooks/useAuth';
15
+ export { useAddress } from './hooks/useAddress';
15
16
  export { useOrder } from './hooks/useOrder';
16
17
  export type { UseOrderOptions, UseOrderResult } from './hooks/useOrder';
17
18
  export { usePayment } from './hooks/usePayment';
@@ -21,6 +22,7 @@ export { useThreedsModal } from './hooks/useThreedsModal';
21
22
  export type { Customer, Session, AuthState, Locale, Currency, Store, Environment, EnvironmentConfig, Order, OrderItem, OrderSummary, OrderAddress, PickupPoint, } from './types';
22
23
  export type { UseCheckoutOptions, UseCheckoutResult, CheckoutInitParams, CheckoutLineItem, CheckoutSession, CheckoutData, Promotion, } from './hooks/useCheckout';
23
24
  export type { UseOrderBumpOptions, UseOrderBumpResult, OrderBumpPreview } from './hooks/useOrderBump';
25
+ export type { UseAddressOptions, UseAddressResult, AddressData, AddressField, Country, State, } from './hooks/useAddress';
24
26
  export type { Payment, PollingOptions, PaymentPollingHook } from './hooks/usePaymentPolling';
25
27
  export type { PaymentInstrument, ThreedsSession, ThreedsChallenge, ThreedsOptions, ThreedsHook, ThreedsProvider, } from './hooks/useThreeds';
26
28
  export type { ApplePayToken, CardPaymentMethod, PaymentResponse, PaymentOptions, PaymentInstrumentResponse, PaymentHook, } from './hooks/usePayment';
@@ -15,6 +15,7 @@ export { useCustomer } from './hooks/useCustomer';
15
15
  export { useEnvironment } from './hooks/useEnvironment';
16
16
  export { useLocale } from './hooks/useLocale';
17
17
  export { useAuth } from './hooks/useAuth';
18
+ export { useAddress } from './hooks/useAddress';
18
19
  // Order hook exports
19
20
  export { useOrder } from './hooks/useOrder';
20
21
  // Payment hooks exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,6 +38,7 @@
38
38
  "@basis-theory/basis-theory-react": "^1.32.5",
39
39
  "@basis-theory/web-threeds": "^1.0.1",
40
40
  "axios": "^1.6.0",
41
+ "react-google-autocomplete": "^2.7.3",
41
42
  "react-intl": "^7.1.11"
42
43
  },
43
44
  "devDependencies": {