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

Add stripe test data buttons #21

Merged
merged 10 commits into from
Feb 11, 2021
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as custom from './marketplace-custom-config.js';
import defaultLocationSearches from './default-location-searches';
import { defaultMCC, stripePublishableKey, stripeCountryDetails } from './stripe-config';
import { defaultMCC, stripePublishableKey, stripeCountryDetails, testData } from './stripe-config';
import { currencyConfiguration } from './currency-config';

const env = process.env.REACT_APP_ENV;
Expand Down Expand Up @@ -229,6 +229,7 @@ const config = {
defaultMCC: defaultMCC,
publishableKey: stripePublishableKey,
supportedCountries: stripeCountryDetails,
testData: testData,
},
canonicalRootURL,
address: {
Expand Down
38 changes: 38 additions & 0 deletions src/stripe-config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { types as sdkTypes } from './util/sdkLoader';
const { UUID } = sdkTypes;

/* Stripe related configuration.

NOTE: REACT_APP_STRIPE_PUBLISHABLE_KEY is mandatory environment variable.
Expand Down Expand Up @@ -329,6 +332,41 @@ export const stripeCountryDetails = [
},
];

/**
* Stripe test data
*
* This data is for filling up the test values related to Stripe
* in the demo application to make testing easier.
*/

export const testData = {
basicTestCardToken: 'tok_visa',
basicTestCardDetails: {
id: new UUID('test-card'),
type: 'stripePaymentMethod',
attributes: {
type: 'stripe-payment-method/card',
stripePaymentMethodId: 'test-card',
card: {
brand: 'visa',
last4Digits: '4242',
expirationMonth: 4,
expirationYear: 2424,
},
},
},
address: {
addressLine1: 'Erottajankatu 19',
postal: '00130',
city: 'Helsinki',
country: 'FI',
OtterleyW marked this conversation as resolved.
Show resolved Hide resolved
},
accountType: 'individual',
country: 'FI',
bankAccountNumber: 'FI89370400440532013000',
bankAccountType: 'iban',
};

/*
NOTE: This configuration will not be updated!
We might remove this code in the later releases.
Expand Down