@@ -4762,7 +4762,7 @@ function getValidFormInputAux(form: PaymentAccountForm, fieldId: PaymentAccountF
47624762 case PaymentAccountFormField . FieldId . PAYID :
47634763 return havenod . getAppName ( ) + "_john.doe@example.com" ;
47644764 case PaymentAccountFormField . FieldId . PIX_KEY :
4765- throw new Error ( "Not implemented" ) ;
4765+ return "123456789" ;
47664766 case PaymentAccountFormField . FieldId . POSTAL_ADDRESS :
47674767 return "123 street" ;
47684768 case PaymentAccountFormField . FieldId . PROMPT_PAY_ID :
@@ -4902,7 +4902,7 @@ function getInvalidFormInput(form: PaymentAccountForm, fieldId: PaymentAccountFo
49024902 case PaymentAccountFormField . FieldId . PAYID :
49034903 return "A" ;
49044904 case PaymentAccountFormField . FieldId . PIX_KEY :
4905- throw new Error ( "Not implemented" ) ;
4905+ return "A" ;
49064906 case PaymentAccountFormField . FieldId . POSTAL_ADDRESS :
49074907 return "" ;
49084908 case PaymentAccountFormField . FieldId . PROMPT_PAY_ID :
@@ -5069,6 +5069,7 @@ function testPaymentAccount(account: PaymentAccount, form: PaymentAccountForm) {
50695069 expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getTransferwiseUsdAccountPayload ( ) ! . getEmail ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . EMAIL ) . getValue ( ) ) ;
50705070 expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getTransferwiseUsdAccountPayload ( ) ! . getHolderName ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . HOLDER_NAME ) . getValue ( ) ) ;
50715071 expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getTransferwiseUsdAccountPayload ( ) ! . getHolderAddress ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . HOLDER_ADDRESS ) . getValue ( ) ) ;
5072+ expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getCountryCode ( ) ) ! . toEqual ( "US" ) ;
50725073 expect ( account . getTradeCurrenciesList ( ) . length ) . toEqual ( 1 ) ;
50735074 expect ( account . getTradeCurrenciesList ( ) [ 0 ] . getCode ( ) ) . toEqual ( "USD" ) ;
50745075 break ;
@@ -5084,7 +5085,6 @@ function testPaymentAccount(account: PaymentAccount, form: PaymentAccountForm) {
50845085 expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getBankAccountPayload ( ) ?. getBranchId ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . BRANCH_ID ) . getValue ( ) ) ;
50855086 expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getBankAccountPayload ( ) ?. getAccountNr ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . ACCOUNT_NR ) . getValue ( ) ) ;
50865087 expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getBankAccountPayload ( ) ?. getAccountType ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . ACCOUNT_TYPE ) . getValue ( ) ) ;
5087- expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getCountryCode ( ) ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . COUNTRY ) . getValue ( ) ) ;
50885088 expect ( account . getTradeCurrenciesList ( ) . length ) . toEqual ( 1 ) ;
50895089 expect ( account . getTradeCurrenciesList ( ) [ 0 ] . getCode ( ) ) . toEqual ( "USD" ) ;
50905090 break ;
@@ -5100,6 +5100,13 @@ function testPaymentAccount(account: PaymentAccount, form: PaymentAccountForm) {
51005100 expect ( account . getTradeCurrenciesList ( ) . length ) . toEqual ( 1 ) ;
51015101 expect ( account . getTradeCurrenciesList ( ) [ 0 ] . getCode ( ) ) . toEqual ( "USD" ) ;
51025102 break ;
5103+ case PaymentAccountForm . FormId . PIX :
5104+ expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getPixAccountPayload ( ) ! . getPixKey ( ) ! ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . PIX_KEY ) . getValue ( ) ) ;
5105+ expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getPixAccountPayload ( ) ! . getHolderName ( ) ! ) . toEqual ( getFormField ( form , PaymentAccountFormField . FieldId . HOLDER_NAME ) . getValue ( ) ) ;
5106+ expect ( account . getPaymentAccountPayload ( ) ! . getCountryBasedPaymentAccountPayload ( ) ! . getCountryCode ( ) ) ! . toEqual ( "BR" ) ;
5107+ expect ( account . getTradeCurrenciesList ( ) . length ) . toEqual ( 1 ) ;
5108+ expect ( account . getTradeCurrenciesList ( ) [ 0 ] . getCode ( ) ) . toEqual ( "BRL" ) ;
5109+ break ;
51035110 default :
51045111 throw new Error ( "Unhandled payment method type: " + form . getId ( ) ) ;
51055112 }
0 commit comments