@xpayeg/sdk 3.0.0 → 3.1.0

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.
@@ -510,59 +510,6 @@ interface PendingDiscountResponseDto {
510
510
  end?: string;
511
511
  }
512
512
  type CheckoutDiscountResponseDto = DiscountResponseDto | PendingDiscountResponseDto;
513
- /**
514
- * Generated by orval 🍺
515
- * Do not edit manually.
516
- * XPay Checkout API
517
- * API for the XPay checkout flow — client endpoints and SSR
518
- * OpenAPI spec version: 1.0
519
- */
520
- /**
521
- * Currency code (ISO 4217)
522
- * @nullable
523
- */
524
- type CheckoutSessionResponseDtoCurrency = (typeof CheckoutSessionResponseDtoCurrency)[keyof typeof CheckoutSessionResponseDtoCurrency] | null;
525
- declare const CheckoutSessionResponseDtoCurrency: {
526
- readonly EGP: "EGP";
527
- readonly USD: "USD";
528
- readonly EUR: "EUR";
529
- readonly GBP: "GBP";
530
- readonly SAR: "SAR";
531
- readonly AED: "AED";
532
- readonly QAR: "QAR";
533
- readonly KWD: "KWD";
534
- readonly JOD: "JOD";
535
- readonly OMR: "OMR";
536
- readonly BHD: "BHD";
537
- readonly LYD: "LYD";
538
- readonly AUD: "AUD";
539
- readonly CAD: "CAD";
540
- readonly CNY: "CNY";
541
- };
542
- /**
543
- * Generated by orval 🍺
544
- * Do not edit manually.
545
- * XPay Checkout API
546
- * API for the XPay checkout flow — client endpoints and SSR
547
- * OpenAPI spec version: 1.0
548
- */
549
- /**
550
- * Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone.
551
- */
552
- type CheckoutSessionResponseDtoPaymentStatus = (typeof CheckoutSessionResponseDtoPaymentStatus)[keyof typeof CheckoutSessionResponseDtoPaymentStatus];
553
- declare const CheckoutSessionResponseDtoPaymentStatus: {
554
- readonly paid: "paid";
555
- readonly unpaid: "unpaid";
556
- readonly no_payment_required: "no_payment_required";
557
- };
558
- interface FeesResponseDto {
559
- paymentMethodType: string;
560
- feeAmount: number;
561
- feePercentage: number;
562
- vatAmount?: number;
563
- totalAmount: number;
564
- cardInfo?: CardInfoResponseDto;
565
- }
566
513
  /**
567
514
  * Generated by orval 🍺
568
515
  * Do not edit manually.
@@ -574,8 +521,8 @@ interface FeesResponseDto {
574
521
  * Currency of this line's amount fields
575
522
  * @nullable
576
523
  */
577
- type LineItemDtoCurrency = (typeof LineItemDtoCurrency)[keyof typeof LineItemDtoCurrency] | null;
578
- declare const LineItemDtoCurrency: {
524
+ type CheckoutLineItemDtoCurrency = (typeof CheckoutLineItemDtoCurrency)[keyof typeof CheckoutLineItemDtoCurrency] | null;
525
+ declare const CheckoutLineItemDtoCurrency: {
579
526
  readonly EGP: "EGP";
580
527
  readonly USD: "USD";
581
528
  readonly EUR: "EUR";
@@ -632,6 +579,23 @@ interface LineItemPresentmentDetailsDto {
632
579
  /** Presentment currency matching the session */
633
580
  currency: LineItemPresentmentDetailsDtoCurrency;
634
581
  }
582
+ /**
583
+ * Generated by orval 🍺
584
+ * Do not edit manually.
585
+ * XPay Checkout API
586
+ * API for the XPay checkout flow — client endpoints and SSR
587
+ * OpenAPI spec version: 1.0
588
+ */
589
+ type PriceAvailability = (typeof PriceAvailability)[keyof typeof PriceAvailability];
590
+ declare const PriceAvailability: {
591
+ readonly available: "available";
592
+ readonly archived: "archived";
593
+ readonly scheduled: "scheduled";
594
+ readonly expired: "expired";
595
+ readonly sold_out: "sold_out";
596
+ readonly oversold: "oversold";
597
+ readonly recurring_unsupported: "recurring_unsupported";
598
+ };
635
599
  /**
636
600
  * Generated by orval 🍺
637
601
  * Do not edit manually.
@@ -769,7 +733,7 @@ interface PriceDto {
769
733
  expirationDate?: string | null;
770
734
  product: ProductDto;
771
735
  }
772
- interface LineItemDto {
736
+ interface CheckoutLineItemDto {
773
737
  /** Line item ID */
774
738
  id: string;
775
739
  /** Quantity; zero represents an optional item */
@@ -788,10 +752,65 @@ interface LineItemDto {
788
752
  * Currency of this line's amount fields
789
753
  * @nullable
790
754
  */
791
- currency?: LineItemDtoCurrency;
755
+ currency?: CheckoutLineItemDtoCurrency;
792
756
  /** Line item description */
793
757
  description?: string;
794
758
  presentmentDetails?: LineItemPresentmentDetailsDto;
759
+ /** Server-calculated availability for this quantity (one unit for optional items). Never derive this from the device clock. */
760
+ availability: PriceAvailability;
761
+ }
762
+ /**
763
+ * Generated by orval 🍺
764
+ * Do not edit manually.
765
+ * XPay Checkout API
766
+ * API for the XPay checkout flow — client endpoints and SSR
767
+ * OpenAPI spec version: 1.0
768
+ */
769
+ /**
770
+ * Currency code (ISO 4217)
771
+ * @nullable
772
+ */
773
+ type CheckoutSessionResponseDtoCurrency = (typeof CheckoutSessionResponseDtoCurrency)[keyof typeof CheckoutSessionResponseDtoCurrency] | null;
774
+ declare const CheckoutSessionResponseDtoCurrency: {
775
+ readonly EGP: "EGP";
776
+ readonly USD: "USD";
777
+ readonly EUR: "EUR";
778
+ readonly GBP: "GBP";
779
+ readonly SAR: "SAR";
780
+ readonly AED: "AED";
781
+ readonly QAR: "QAR";
782
+ readonly KWD: "KWD";
783
+ readonly JOD: "JOD";
784
+ readonly OMR: "OMR";
785
+ readonly BHD: "BHD";
786
+ readonly LYD: "LYD";
787
+ readonly AUD: "AUD";
788
+ readonly CAD: "CAD";
789
+ readonly CNY: "CNY";
790
+ };
791
+ /**
792
+ * Generated by orval 🍺
793
+ * Do not edit manually.
794
+ * XPay Checkout API
795
+ * API for the XPay checkout flow — client endpoints and SSR
796
+ * OpenAPI spec version: 1.0
797
+ */
798
+ /**
799
+ * Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone.
800
+ */
801
+ type CheckoutSessionResponseDtoPaymentStatus = (typeof CheckoutSessionResponseDtoPaymentStatus)[keyof typeof CheckoutSessionResponseDtoPaymentStatus];
802
+ declare const CheckoutSessionResponseDtoPaymentStatus: {
803
+ readonly paid: "paid";
804
+ readonly unpaid: "unpaid";
805
+ readonly no_payment_required: "no_payment_required";
806
+ };
807
+ interface FeesResponseDto {
808
+ paymentMethodType: string;
809
+ feeAmount: number;
810
+ feePercentage: number;
811
+ vatAmount?: number;
812
+ totalAmount: number;
813
+ cardInfo?: CardInfoResponseDto;
795
814
  }
796
815
  /**
797
816
  * Generated by orval 🍺
@@ -997,7 +1016,7 @@ type CheckoutSession = {
997
1016
  */
998
1017
  presentmentDetails?: SessionPresentmentDetailsDto | undefined;
999
1018
  /** Line items in the session */
1000
- lineItems?: LineItemDto[] | undefined;
1019
+ lineItems?: CheckoutLineItemDto[] | undefined;
1001
1020
  /** Totals breakdown (subtotal, tax, shipping, etc.) */
1002
1021
  totalDetails?: TotalDetailsResponseDto | undefined;
1003
1022
  /** Fee breakdown (when feesPassThrough is enabled) */
@@ -1006,7 +1025,7 @@ type CheckoutSession = {
1006
1025
  discounts?: CheckoutDiscountResponseDto[] | undefined;
1007
1026
  };
1008
1027
  /** Line item in a checkout session */
1009
- type CheckoutLineItem = LineItemDto;
1028
+ type CheckoutLineItem = CheckoutLineItemDto;
1010
1029
  /** Totals breakdown (subtotal, tax, shipping, discount amounts) */
1011
1030
  type CheckoutTotalDetails = TotalDetailsResponseDto;
1012
1031
  /** Fee breakdown for pass-through fees */
@@ -510,59 +510,6 @@ interface PendingDiscountResponseDto {
510
510
  end?: string;
511
511
  }
512
512
  type CheckoutDiscountResponseDto = DiscountResponseDto | PendingDiscountResponseDto;
513
- /**
514
- * Generated by orval 🍺
515
- * Do not edit manually.
516
- * XPay Checkout API
517
- * API for the XPay checkout flow — client endpoints and SSR
518
- * OpenAPI spec version: 1.0
519
- */
520
- /**
521
- * Currency code (ISO 4217)
522
- * @nullable
523
- */
524
- type CheckoutSessionResponseDtoCurrency = (typeof CheckoutSessionResponseDtoCurrency)[keyof typeof CheckoutSessionResponseDtoCurrency] | null;
525
- declare const CheckoutSessionResponseDtoCurrency: {
526
- readonly EGP: "EGP";
527
- readonly USD: "USD";
528
- readonly EUR: "EUR";
529
- readonly GBP: "GBP";
530
- readonly SAR: "SAR";
531
- readonly AED: "AED";
532
- readonly QAR: "QAR";
533
- readonly KWD: "KWD";
534
- readonly JOD: "JOD";
535
- readonly OMR: "OMR";
536
- readonly BHD: "BHD";
537
- readonly LYD: "LYD";
538
- readonly AUD: "AUD";
539
- readonly CAD: "CAD";
540
- readonly CNY: "CNY";
541
- };
542
- /**
543
- * Generated by orval 🍺
544
- * Do not edit manually.
545
- * XPay Checkout API
546
- * API for the XPay checkout flow — client endpoints and SSR
547
- * OpenAPI spec version: 1.0
548
- */
549
- /**
550
- * Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone.
551
- */
552
- type CheckoutSessionResponseDtoPaymentStatus = (typeof CheckoutSessionResponseDtoPaymentStatus)[keyof typeof CheckoutSessionResponseDtoPaymentStatus];
553
- declare const CheckoutSessionResponseDtoPaymentStatus: {
554
- readonly paid: "paid";
555
- readonly unpaid: "unpaid";
556
- readonly no_payment_required: "no_payment_required";
557
- };
558
- interface FeesResponseDto {
559
- paymentMethodType: string;
560
- feeAmount: number;
561
- feePercentage: number;
562
- vatAmount?: number;
563
- totalAmount: number;
564
- cardInfo?: CardInfoResponseDto;
565
- }
566
513
  /**
567
514
  * Generated by orval 🍺
568
515
  * Do not edit manually.
@@ -574,8 +521,8 @@ interface FeesResponseDto {
574
521
  * Currency of this line's amount fields
575
522
  * @nullable
576
523
  */
577
- type LineItemDtoCurrency = (typeof LineItemDtoCurrency)[keyof typeof LineItemDtoCurrency] | null;
578
- declare const LineItemDtoCurrency: {
524
+ type CheckoutLineItemDtoCurrency = (typeof CheckoutLineItemDtoCurrency)[keyof typeof CheckoutLineItemDtoCurrency] | null;
525
+ declare const CheckoutLineItemDtoCurrency: {
579
526
  readonly EGP: "EGP";
580
527
  readonly USD: "USD";
581
528
  readonly EUR: "EUR";
@@ -632,6 +579,23 @@ interface LineItemPresentmentDetailsDto {
632
579
  /** Presentment currency matching the session */
633
580
  currency: LineItemPresentmentDetailsDtoCurrency;
634
581
  }
582
+ /**
583
+ * Generated by orval 🍺
584
+ * Do not edit manually.
585
+ * XPay Checkout API
586
+ * API for the XPay checkout flow — client endpoints and SSR
587
+ * OpenAPI spec version: 1.0
588
+ */
589
+ type PriceAvailability = (typeof PriceAvailability)[keyof typeof PriceAvailability];
590
+ declare const PriceAvailability: {
591
+ readonly available: "available";
592
+ readonly archived: "archived";
593
+ readonly scheduled: "scheduled";
594
+ readonly expired: "expired";
595
+ readonly sold_out: "sold_out";
596
+ readonly oversold: "oversold";
597
+ readonly recurring_unsupported: "recurring_unsupported";
598
+ };
635
599
  /**
636
600
  * Generated by orval 🍺
637
601
  * Do not edit manually.
@@ -769,7 +733,7 @@ interface PriceDto {
769
733
  expirationDate?: string | null;
770
734
  product: ProductDto;
771
735
  }
772
- interface LineItemDto {
736
+ interface CheckoutLineItemDto {
773
737
  /** Line item ID */
774
738
  id: string;
775
739
  /** Quantity; zero represents an optional item */
@@ -788,10 +752,65 @@ interface LineItemDto {
788
752
  * Currency of this line's amount fields
789
753
  * @nullable
790
754
  */
791
- currency?: LineItemDtoCurrency;
755
+ currency?: CheckoutLineItemDtoCurrency;
792
756
  /** Line item description */
793
757
  description?: string;
794
758
  presentmentDetails?: LineItemPresentmentDetailsDto;
759
+ /** Server-calculated availability for this quantity (one unit for optional items). Never derive this from the device clock. */
760
+ availability: PriceAvailability;
761
+ }
762
+ /**
763
+ * Generated by orval 🍺
764
+ * Do not edit manually.
765
+ * XPay Checkout API
766
+ * API for the XPay checkout flow — client endpoints and SSR
767
+ * OpenAPI spec version: 1.0
768
+ */
769
+ /**
770
+ * Currency code (ISO 4217)
771
+ * @nullable
772
+ */
773
+ type CheckoutSessionResponseDtoCurrency = (typeof CheckoutSessionResponseDtoCurrency)[keyof typeof CheckoutSessionResponseDtoCurrency] | null;
774
+ declare const CheckoutSessionResponseDtoCurrency: {
775
+ readonly EGP: "EGP";
776
+ readonly USD: "USD";
777
+ readonly EUR: "EUR";
778
+ readonly GBP: "GBP";
779
+ readonly SAR: "SAR";
780
+ readonly AED: "AED";
781
+ readonly QAR: "QAR";
782
+ readonly KWD: "KWD";
783
+ readonly JOD: "JOD";
784
+ readonly OMR: "OMR";
785
+ readonly BHD: "BHD";
786
+ readonly LYD: "LYD";
787
+ readonly AUD: "AUD";
788
+ readonly CAD: "CAD";
789
+ readonly CNY: "CNY";
790
+ };
791
+ /**
792
+ * Generated by orval 🍺
793
+ * Do not edit manually.
794
+ * XPay Checkout API
795
+ * API for the XPay checkout flow — client endpoints and SSR
796
+ * OpenAPI spec version: 1.0
797
+ */
798
+ /**
799
+ * Whether the money has arrived. `paid` means fulfil; `unpaid` on a `complete` session means the customer still has to pay a reference. Never fulfil on `status` alone.
800
+ */
801
+ type CheckoutSessionResponseDtoPaymentStatus = (typeof CheckoutSessionResponseDtoPaymentStatus)[keyof typeof CheckoutSessionResponseDtoPaymentStatus];
802
+ declare const CheckoutSessionResponseDtoPaymentStatus: {
803
+ readonly paid: "paid";
804
+ readonly unpaid: "unpaid";
805
+ readonly no_payment_required: "no_payment_required";
806
+ };
807
+ interface FeesResponseDto {
808
+ paymentMethodType: string;
809
+ feeAmount: number;
810
+ feePercentage: number;
811
+ vatAmount?: number;
812
+ totalAmount: number;
813
+ cardInfo?: CardInfoResponseDto;
795
814
  }
796
815
  /**
797
816
  * Generated by orval 🍺
@@ -997,7 +1016,7 @@ type CheckoutSession = {
997
1016
  */
998
1017
  presentmentDetails?: SessionPresentmentDetailsDto | undefined;
999
1018
  /** Line items in the session */
1000
- lineItems?: LineItemDto[] | undefined;
1019
+ lineItems?: CheckoutLineItemDto[] | undefined;
1001
1020
  /** Totals breakdown (subtotal, tax, shipping, etc.) */
1002
1021
  totalDetails?: TotalDetailsResponseDto | undefined;
1003
1022
  /** Fee breakdown (when feesPassThrough is enabled) */
@@ -1006,7 +1025,7 @@ type CheckoutSession = {
1006
1025
  discounts?: CheckoutDiscountResponseDto[] | undefined;
1007
1026
  };
1008
1027
  /** Line item in a checkout session */
1009
- type CheckoutLineItem = LineItemDto;
1028
+ type CheckoutLineItem = CheckoutLineItemDto;
1010
1029
  /** Totals breakdown (subtotal, tax, shipping, discount amounts) */
1011
1030
  type CheckoutTotalDetails = TotalDetailsResponseDto;
1012
1031
  /** Fee breakdown for pass-through fees */
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @xpayeg/sdk
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#600](https://github.com/xpayeg/xpay/pull/600) [`9f4d949`](https://github.com/xpayeg/xpay/commit/9f4d949ff5f51b0c739521155fa392340bb3067e) Thanks [@Elmosh](https://github.com/Elmosh)! - Add availability status to checkout line-item types.
8
+
3
9
  ## 3.0.0
4
10
 
5
11
  ### Major Changes
package/README.md CHANGED
@@ -126,7 +126,7 @@ const checkout = await xpay.initCheckout({
126
126
  | `merchantName` | `string` | `"My Store"` | Merchant display name |
127
127
  | `livemode` | `boolean` | `false` | Whether live or test mode |
128
128
  | `paymentMethods` | `PaymentMethodInfo[]` | `[{ type, displayName, category }]` | Available payment methods |
129
- | `lineItems` | `LineItemDto[]` | | Line items with prices and quantities |
129
+ | `lineItems` | `CheckoutLineItem[]` | | Line items with prices and quantities |
130
130
  | `totalDetails` | `TotalDetailsResponseDto` | | Breakdown of fees, discounts, VAT |
131
131
  | `discounts` | `DiscountResponseDto[]` | | Applied discounts |
132
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpayeg/sdk",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "XPay JavaScript SDK — loader and TypeScript types for embedding XPay payments",
5
5
  "license": "MIT",
6
6
  "type": "module",