refactor: outsource stripe key to environment
This commit is contained in:
parent
c4252c97e7
commit
da01e272d7
2 changed files with 5 additions and 3 deletions
|
@ -3,6 +3,7 @@ import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angula
|
|||
import { loadStripe, Stripe } from '@stripe/stripe-js';
|
||||
import { DepositService } from '../service/deposit.service';
|
||||
import { debounceTime } from 'rxjs';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-deposit',
|
||||
|
@ -29,9 +30,7 @@ export class DepositComponent implements OnInit {
|
|||
}
|
||||
});
|
||||
|
||||
this.stripe = await loadStripe(
|
||||
'pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG'
|
||||
);
|
||||
this.stripe = await loadStripe(environment.STRIPE_KEY);
|
||||
}
|
||||
|
||||
submit() {
|
||||
|
|
3
frontend/src/environments/environment.ts
Normal file
3
frontend/src/environments/environment.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export const environment = {
|
||||
STRIPE_KEY: 'pk_test_51QrePYIvCfqz7ANgMizBorPpVjJ8S6gcaL4yvcMQnVaKyReqcQ6jqaQEF7aDZbDu8rNVsTZrw8ABek4ToxQX7KZe00jpGh8naG',
|
||||
}
|
Reference in a new issue