Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 React Native SDK Wrapper #48

Merged
merged 37 commits into from
Oct 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5e5c1d1
feat: setup new wrapper with hosted html
kingisaac95 May 2, 2023
9ff11b8
feat: migrate project to new configuration
kingisaac95 May 4, 2023
08359ed
feat: setup testing and add basic test
kingisaac95 May 4, 2023
375e85a
fix: properly capture value from string concatenation
kingisaac95 May 9, 2023
1628aa4
chore: cleanup
kingisaac95 May 9, 2023
64d60a9
test: unit tests
kingisaac95 May 9, 2023
bbf7800
test: update createPaymentSource test to include bank_identifier
kingisaac95 May 16, 2023
c94f2af
chore: change min OS version to iOS 10
kingisaac95 May 19, 2023
6e477d4
chore: update tests
kingisaac95 Jun 2, 2023
4288511
chore: remove dialog uncontained customization
kingisaac95 Jun 2, 2023
b9606f0
feat: support inline video player
kingisaac95 Jun 14, 2023
5a8503e
chore: capture implementation data for analytics
kingisaac95 Jul 26, 2023
8162698
feat: initial Fastlane setup
kingisaac95 Aug 21, 2023
2cf261b
feat: upload build to s3
kingisaac95 Aug 22, 2023
bef6427
chore: upload to build number and latest directories
kingisaac95 Aug 22, 2023
4a023f1
chore: update directory paths
kingisaac95 Aug 22, 2023
968cc38
chore: cleanup; rename target directory
kingisaac95 Aug 23, 2023
13bbfaf
chore: make debug builds; update CDN dir path
kingisaac95 Aug 24, 2023
7dd527c
FEN-53: GA<>Fastlane support; support CF invalidation & update AWS re…
kingisaac95 Aug 24, 2023
94b9c81
chore: use "bundle exec" for faster run times
kingisaac95 Aug 25, 2023
67de805
chore: build_type = Release
kingisaac95 Aug 25, 2023
d53c0d2
chore: named steps
kingisaac95 Aug 25, 2023
bf4da3e
feat: automate iOS build
kingisaac95 Oct 3, 2023
99575a1
feat: support ssh cloning
kingisaac95 Oct 3, 2023
c9f9738
chore: cancel running job is new job starts
kingisaac95 Oct 3, 2023
60e2aa4
fix: use MATCH_PASSWORD from env var
kingisaac95 Oct 3, 2023
a0b19a7
chore: install pod dependencies
kingisaac95 Oct 3, 2023
97e9f5c
chore: specify app_identifier in Matchfile
kingisaac95 Oct 4, 2023
7e56d19
Merge branch 'master' of github.com:leantechnologies/link-sdk-react-n…
kingisaac95 Oct 4, 2023
ab5e460
chore: cleanup
kingisaac95 Oct 4, 2023
b3cb77f
chore: cache cocoapods
kingisaac95 Oct 4, 2023
e4eace3
chore: support floating keyboard
kingisaac95 Oct 13, 2023
f4b963d
fix: support smaller viewports (apply patch from #57 in master)
kingisaac95 Oct 13, 2023
79a6a10
Merge branch 'master' into v2
kingisaac95 Oct 13, 2023
51d3750
chore: include pinned version status
kingisaac95 Oct 13, 2023
e91f32f
chore: change version to 3.0.0
kingisaac95 Oct 13, 2023
0d42ebe
chore: trigger build on master
kingisaac95 Oct 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update tests
  • Loading branch information
kingisaac95 committed Jun 2, 2023
commit 6e477d475addceb9085b45338948adf41dff25ca
54 changes: 27 additions & 27 deletions __tests__/Lean.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ describe('Lean SDK', () => {

it('all params: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=link&customer_id=dda80d32-4062-404c-abe7-ba9b9290c873&permissions=identity&permissions=accounts&permissions=balance&permissions=transactions&bank_identifier=LEANMB1_SAU&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=link&customer_id=dda80d32-4062-404c-abe7-ba9b9290c873&permissions=identity&permissions=accounts&permissions=balance&permissions=transactions&bank_identifier=LEANMB1_SAU&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success';

const initializationURL = lean.link({
customer_id: config.customerId,
permissions: ['identity', 'accounts', 'balance', 'transactions'],
bank_identifier: 'LEANMB1_SAU',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
});

expect(initializationURL).toBe(expectedUrl);
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('Lean SDK', () => {

it('all params: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=connect&customer_id=dda80d32-4062-404c-abe7-ba9b9290c873&permissions=identity&permissions=accounts&permissions=balance&permissions=transactions&permissions=payments&bank_identifier=LEANMB1_SAU&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&access_to=10-10-2023&access_from=10-05-2023&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=connect&customer_id=dda80d32-4062-404c-abe7-ba9b9290c873&permissions=identity&permissions=accounts&permissions=balance&permissions=transactions&permissions=payments&bank_identifier=LEANMB1_SAU&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&access_to=10-10-2023&access_from=10-05-2023&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success';

const initializationURL = lean.connect({
customer_id: config.customerId,
Expand All @@ -142,8 +142,8 @@ describe('Lean SDK', () => {
accessTo: '10-10-2023',
accessFrom: '10-05-2023',
bank_identifier: 'LEANMB1_SAU',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
});

Expand Down Expand Up @@ -174,8 +174,8 @@ describe('Lean SDK', () => {
it('throws an error when required params are missing', () => {
expect(() =>
lean.createBeneficiary({
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
}),
).toThrowError('Validation Error: customer_id is required');
Expand All @@ -194,12 +194,12 @@ describe('Lean SDK', () => {

it('all params: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=createBeneficiary&customer_id=726715d7-222f-4087-bcce-2832135e4981&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail&payment_source_id=8b3b7960-c4a1-41da-8ad0-5df36cf67540&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=createBeneficiary&customer_id=726715d7-222f-4087-bcce-2832135e4981&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success&payment_source_id=8b3b7960-c4a1-41da-8ad0-5df36cf67540&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0';

const initializationURL = lean.createBeneficiary({
customer_id: '726715d7-222f-4087-bcce-2832135e4981',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_source_id: '8b3b7960-c4a1-41da-8ad0-5df36cf67540',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
});
Expand All @@ -212,8 +212,8 @@ describe('Lean SDK', () => {
it('throws an error when required params are missing', () => {
expect(() =>
lean.createPaymentSource({
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
}),
).toThrowError('Validation Error: customer_id is required');
Expand All @@ -232,13 +232,13 @@ describe('Lean SDK', () => {

it('all params: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=createPaymentSource&customer_id=726715d7-222f-4087-bcce-2832135e4981&bank_identifier=LEANMB1_SAU&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=createPaymentSource&customer_id=726715d7-222f-4087-bcce-2832135e4981&bank_identifier=LEANMB1_SAU&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success';

const initializationURL = lean.createPaymentSource({
bank_identifier: 'LEANMB1_SAU',
customer_id: '726715d7-222f-4087-bcce-2832135e4981',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_source_id: '8b3b7960-c4a1-41da-8ad0-5df36cf67540',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
});
Expand All @@ -251,8 +251,8 @@ describe('Lean SDK', () => {
it('throws an error when required params are missing', () => {
expect(() =>
lean.updatePaymentSource({
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
}),
).toThrowError('Validation Error: customer_id is required');
Expand All @@ -271,12 +271,12 @@ describe('Lean SDK', () => {

it('all params: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=updatePaymentSource&customer_id=726715d7-222f-4087-bcce-2832135e4981&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&payment_source_id=8b3b7960-c4a1-41da-8ad0-5df36cf67540&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=updatePaymentSource&customer_id=726715d7-222f-4087-bcce-2832135e4981&payment_destination_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&payment_source_id=8b3b7960-c4a1-41da-8ad0-5df36cf67540&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success';

const initializationURL = lean.updatePaymentSource({
customer_id: '726715d7-222f-4087-bcce-2832135e4981',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
payment_source_id: '8b3b7960-c4a1-41da-8ad0-5df36cf67540',
payment_destination_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
});
Expand Down Expand Up @@ -308,14 +308,14 @@ describe('Lean SDK', () => {

it('all params: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=pay&payment_intent_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&account_id=8b3b7960-c4a1-41da-8ad0-5df36cf67540&show_balances=true&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=pay&payment_intent_id=617207b3-a4d4-4413-ba1b-b8d32efd58a0&account_id=8b3b7960-c4a1-41da-8ad0-5df36cf67540&show_balances=true&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success';

const initializationURL = lean.pay({
show_balances: true,
account_id: '8b3b7960-c4a1-41da-8ad0-5df36cf67540',
payment_intent_id: '617207b3-a4d4-4413-ba1b-b8d32efd58a0',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
});

expect(initializationURL).toBe(expectedUrl);
Expand Down Expand Up @@ -343,14 +343,14 @@ describe('Lean SDK', () => {

it('customization: returns the correct URL', () => {
const expectedUrl =
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=link&customer_id=dda80d32-4062-404c-abe7-ba9b9290c873&permissions=identity&permissions=accounts&permissions=balance&permissions=transactions&customization=dialog_mode+uncontained&customization=theme_color+rgb(0,152,172)&customization=button_text_color+white&customization=button_border_radius+15&customization=link_color+rgb(0,152,172)&customization=overlay_color+rgb(175,182,182)&bank_identifier=LEANMB1_SAU&fail_redirect_url=https://dev.leantech.me/success&success_redirect_url=https://dev.leantech.me/fail';
'https://cdn.leantech.me/link/loader/prod/ae/latest/lean-sdk.html?implementation=webview-hosted-html&app_token=9fb9e934-9efb-4e7e-a508-de67c0839be0&sandbox=false&language=en&version=latest&country=ae&env=production&method=link&customer_id=dda80d32-4062-404c-abe7-ba9b9290c873&permissions=identity&permissions=accounts&permissions=balance&permissions=transactions&customization=dialog_mode+uncontained&customization=theme_color+rgb(0,152,172)&customization=button_text_color+white&customization=button_border_radius+15&customization=link_color+rgb(0,152,172)&customization=overlay_color+rgb(175,182,182)&bank_identifier=LEANMB1_SAU&fail_redirect_url=https://dev.leantech.me/fail&success_redirect_url=https://dev.leantech.me/success';

const initializationURL = leanWithCustomization.link({
customer_id: config.customerId,
permissions: ['identity', 'accounts', 'balance', 'transactions'],
bank_identifier: 'LEANMB1_SAU',
fail_redirect_url: 'https://dev.leantech.me/success',
success_redirect_url: 'https://dev.leantech.me/fail',
fail_redirect_url: 'https://dev.leantech.me/fail',
success_redirect_url: 'https://dev.leantech.me/success',
});

expect(initializationURL).toBe(expectedUrl);
Expand Down