@@ -5,7 +5,6 @@ The Checkout Frontend Library is a Bold Javascript library, which contains reusa
5
5
6
6
* Call Bold's [ Headless Checkout APIs] ( https://developer.boldcommerce.com/default/guides/checkout )
7
7
* Control request retry
8
- * Communicate to the [ PIGI API] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api )
9
8
* Get useful types and constants to avoid defining interfaces
10
9
11
10
## Installation
@@ -712,275 +711,6 @@ Removes a gift card payment by `id`.
712
711
713
712
A promise that resolves the API response.
714
713
715
- ### Payment Iframe
716
-
717
- ---
718
-
719
- #### Get Payment Iframe
720
-
721
- ▸ ** getPaymentIframeUrl** (): Promise <[ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) >
722
-
723
- Retrieve the Payment Isolation Gateway Interface ([ PIGI] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi ) ) url.
724
-
725
- ``` typescript
726
- const response: IApiReturnObject = await getPaymentIframeUrl ();
727
- ```
728
-
729
- ** Returns**
730
-
731
- ` Promise ` <[ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) >
732
-
733
- A promise that resolves the API response.
734
-
735
- ---
736
-
737
- #### CSS Styling for PIGI
738
-
739
- ▸ ** cssStylingPaymentIframe** (` body ` ,` numOfRetries? ` ): Promise <[ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) >
740
-
741
- Styles the Payment Isolation Gateway Interface (PIGI) using CSS and media queries.
742
-
743
- ``` typescript
744
- const response: IApiReturnObject = await cssStylingPaymentIframe (body , API_RETRY );
745
- ```
746
-
747
- ** Parameters**
748
-
749
- | Parameter| type| Description|
750
- | ---------| ----| -----------|
751
- | ` body ` | [ ICssStylingPaymentIframeRequest] ( ./docs/interfaces/ICssStylingPaymentIframeRequest.md ) | The css and media rules that need to be applied to PIGI Iframe. |
752
- | ` numOfRetries? ` | ` number ` | The number of times to retry the API in case of a 408, 429, 503, 504, or 544 error. The default is 0. |
753
-
754
- ** Returns**
755
-
756
- ` Promise ` <[ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) >
757
-
758
- A promise that resolves the API response.
759
-
760
-
761
- ### PIGI Actions
762
-
763
- ---
764
-
765
- #### Set PIGI Listener
766
-
767
- ▸ ** setPigiListener** (` iFrameId ` , ` callback ` ): void
768
-
769
- Sets the callback function that will receive all action responses from PIGI. The callback function is executed when the parent receives any response from PIGI. You can also implement [ PIGI event driven responses] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#event-driven-responses ) in the callback function.
770
- ``` typescript
771
-
772
- const handlePigiMessage = (e ) => {
773
- const {responseType, payload} = e .data as IPigiResponseData ;
774
- // Implement all action responses by responseType
775
- }
776
-
777
- setPigiListener (IframeId , handlePigiMessage );
778
- ```
779
-
780
- ** Parameters**
781
-
782
- | Parameter| type| Description|
783
- | ---------| ----| -----------|
784
- | ` iFrameId ` | ` string ` | The unique identifier for the PIGI Iframe. |
785
- | ` callback ` | ` EventListenerOrEventListenerObject ` | The callback function to call when PIGI responses are received. |
786
-
787
-
788
- ---
789
-
790
- #### Add Payment Action
791
-
792
- ▸ ** sendAddPaymentAction** (): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
793
- ▸ ** sendAddPaymentActionAsync** (): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
794
-
795
- The [ Add payment PIGI action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#add-payment ) requests that PIGI adds the payment token to the order after customer enters the payment information.
796
-
797
- ``` typescript
798
- const response: IApiReturnObject = sendAddPaymentAction ();
799
- const responseAsync: IPigiResponseType = await sendAddPaymentActionAsync ();
800
- ```
801
-
802
- ** Returns**
803
-
804
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
805
-
806
- An API response or promise that resolve the PIGI response.
807
-
808
- ---
809
-
810
- #### Clear PIGI Error Action
811
-
812
- ▸ ** sendClearErrorMessageAction** (): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
813
- ▸ ** sendClearErrorMessageActionAsync** (): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
814
-
815
- The [ Clear PIGI error action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#clear-error-messages ) removes all errors from the PIGI user interface.
816
-
817
- ``` typescript
818
- const response: IApiReturnObject = sendClearErrorMessageAction ();
819
- const responseAsync: IPigiResponseType = await sendClearErrorMessageActionAsync ();
820
- ```
821
-
822
- ** Returns**
823
-
824
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
825
-
826
- An API response or promise that resolve the PIGI response.
827
-
828
- ---
829
-
830
- #### Display Error Message
831
-
832
- ▸ ** sendDisplayErrorMessageAction** (` message ` , ` subType ` ): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
833
- ▸ ** sendDisplayErrorMessageActionAsync** (` message ` , ` subType ` ): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
834
-
835
- The [ Display error message action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#display-error-message ) displays an error message in the PIGI user interface.
836
-
837
- ``` typescript
838
- const response: IApiReturnObject = sendDisplayErrorMessageAction (message , subType );
839
- const responseAsync: IPigiResponseType = await sendDisplayErrorMessageActionAsync (message , subType );
840
- ```
841
-
842
- ** Parameters**
843
-
844
- | Parameter| type| Description|
845
- | ---------| ----| -----------|
846
- | ` message ` | ` string ` | The error message to display in PIGI. |
847
- | ` subType ` | ` string ` | The type of error, corresponds to payment gateway name.|
848
-
849
- ** Returns**
850
-
851
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
852
-
853
- An API response or promise that resolve the PIGI response.
854
-
855
- ---
856
-
857
- #### Handle SCA Action
858
-
859
- ▸ ** sendHandleScaAction** (` clientSecretToken? ` ): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
860
- ▸ ** sendHandleScaActionAsync** (` clientSecretToken? ` ): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
861
-
862
- The Handle SCA action requests that PIGI handles SCA/3DS.
863
-
864
- ``` typescript
865
- const response: IApiReturnObject = sendHandleScaAction (clientSecretToken );
866
- const responseAsync: IApiReturnObject = await sendHandleScaAction (clientSecretToken );
867
- ```
868
-
869
- ** Parameters**
870
-
871
- | Parameter| type| Description|
872
- | ---------| ----| -----------|
873
- | ` clientSecretToken? ` | ` string ` | The secret token from payment gateway. |
874
-
875
- ** Returns**
876
-
877
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
878
-
879
- An API response or promise that resolve the PIGI response.
880
-
881
- ---
882
-
883
- #### Refresh Order Action
884
-
885
- ▸ ** sendRefreshOrderAction** (): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
886
- ▸ ** sendRefreshOrderActionAsync** (): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
887
-
888
- The [ Refresh Order action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#refresh-order ) updates the order state in PIGI.
889
-
890
- ``` typescript
891
- const response: IApiReturnObject = sendRefreshOrderAction ();
892
- const responseAsync: IPigiResponseType = await sendRefreshOrderActionAsync ();
893
- ```
894
-
895
- ** Returns**
896
-
897
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
898
-
899
- An API response or promise that resolve the PIGI response.
900
-
901
- ---
902
-
903
- #### Select Payment Action
904
-
905
- ▸ ** sendSelectPaymentMethodAction** (` payload ` ): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
906
- ▸ ** sendSelectPaymentMethodActionAsync** (` payload ` ): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
907
-
908
- The [ Select Payment Method action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#select-payment-method ) selects the customer's choice of payment.
909
-
910
- ``` typescript
911
- const response: IApiReturnObject = sendSelectPaymentMethodAction (payload );
912
- const responseAsync: IPigiResponseType = await sendSelectPaymentMethodActionAsync (payload );
913
- ```
914
-
915
- ** Parameters**
916
-
917
- | Parameter| type| Description|
918
- | ---------| ----| -----------|
919
- | ` payload ` | ` {index?: number, gatewayName?: string} ` | Provide an object with either the ` index ` or ` gatewayName ` . If both are used, PIGI uses index. |
920
-
921
- ** Returns**
922
-
923
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
924
-
925
- An API response or promise that resolve the PIGI response.
926
-
927
- ---
928
-
929
-
930
- #### Update Language Action
931
-
932
- ▸ ** sendUpdateLanguageAction** (` languageCode ` ): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
933
- ▸ ** sendUpdateLanguageActionAsync** (` languageCode ` ): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
934
-
935
- The [ Update Language action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#update-language ) changes the display language of PIGI.
936
-
937
- ``` typescript
938
- const response: IApiReturnObject = sendUpdateLanguageAction (languageCode );
939
- const responseAsync: IPigiResponseType = await sendUpdateLanguageActionAsync (languageCode );
940
- ```
941
-
942
- ** Parameters**
943
-
944
- | Parameter| type| Description|
945
- | ---------| ----| -----------|
946
- | ` languageCode ` | ` string ` | The updated language code in [ ISO 639-1] ( https://www.iso.org/standard/22109.html ) . |
947
-
948
- ** Returns**
949
-
950
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
951
-
952
- An API response or promise that resolve the PIGI response.
953
-
954
- ---
955
-
956
-
957
- #### Update Media Match Action
958
-
959
- ▸ ** sendUpdateMediaMatchAction** (` conditionText ` , ` matches ` ): [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) <br />
960
- ▸ ** sendUpdateMediaMatchActionAsync** (` conditionText ` , ` matches ` ): Promise <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
961
-
962
- The [ Update Media Match action] ( https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#update-media-match ) changes the CSS styling of PIGI.
963
-
964
- ``` typescript
965
- const response: IApiReturnObject = sendUpdateMediaMatchAction (conditionText , matches );
966
- const responseAsync: IPigiResponseType = await sendUpdateMediaMatchActionAsync (conditionText , matches );
967
- ```
968
-
969
- ** Parameters**
970
-
971
- | Parameter| type| Description|
972
- | ---------| ----| -----------|
973
- | ` conditionText ` | ` string ` | The media rule condition. |
974
- | ` matches ` | ` boolean ` | Whether or not the condition was met. |
975
-
976
- ** Returns**
977
-
978
- [ IApiReturnObject] ( ./docs/interfaces/IApiReturnObject.md ) | ` Promise ` <[ IPigiResponseType] ( ./docs/interfaces/IPigiResponseType.md ) >
979
-
980
- An API response or promise that resolve the PIGI response.
981
-
982
- ---
983
-
984
714
### State
985
715
986
716
The Bold Checkout Frontend Library keeps a local copy of the most up-to-date application state, which is updated after every API call. Use the methods in this section to retrieve certain information about your order. To see the latest order status, you can also call the [ Get Application State] ( #get-application-state ) endpoint.
0 commit comments