Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Mar 24, 2024
1 parent 86fd58f commit dcfbeec
Show file tree
Hide file tree
Showing 40 changed files with 2,608 additions and 1,820 deletions.
4 changes: 3 additions & 1 deletion demo/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"cap": "npm run build -- --configuration production && cap copy"
"cap": "npm run build -- --configuration production && cap copy",
"fmt": "prettier --parser typescript --write \"./src/**/*.ts\" && prettier --parser angular --write \"./src/**/*.html\""
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -62,6 +63,7 @@
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"prettier": "^3.2.5",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~5.4.3"
Expand Down
46 changes: 24 additions & 22 deletions demo/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
import {Component} from '@angular/core';
import {Stripe} from '@capacitor-community/stripe';
import {StripeIdentity} from '@capacitor-community/stripe-identity';
import {IonApp, IonRouterOutlet} from "@ionic/angular/standalone";
import { Component } from '@angular/core';
import { Stripe } from '@capacitor-community/stripe';
import { StripeIdentity } from '@capacitor-community/stripe-identity';
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';

@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
standalone: true,
imports: [IonApp, IonRouterOutlet],
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
standalone: true,
imports: [IonApp, IonRouterOutlet],
})
export class AppComponent {
constructor() {
Stripe.initialize({
publishableKey: 'pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM',
constructor() {
Stripe.initialize({
publishableKey:
'pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM',

/**
* Danger: This is production environment using production key.
* For testing ApplePay and GooglePay, but If it fails, payment will occur.
*/
// publishableKey: 'pk_live_51KFDksKRG9PRcrzztDRkrFSon0jOxWuQ77zd2URAyn3sy4Dn1EST360KnM6ElTlAerKOBvi27J4SPlKd2rG4SNAZ00n0f3mEbg',
});
StripeIdentity.initialize({
publishableKey: 'pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM',
});
}
/**
* Danger: This is production environment using production key.
* For testing ApplePay and GooglePay, but If it fails, payment will occur.
*/
// publishableKey: 'pk_live_51KFDksKRG9PRcrzztDRkrFSon0jOxWuQ77zd2URAyn3sy4Dn1EST360KnM6ElTlAerKOBvi27J4SPlKd2rG4SNAZ00n0f3mEbg',
});
StripeIdentity.initialize({
publishableKey:
'pk_test_51MmARtKzMYim9cy3tOI5vOdHbai4G26V1AiDJmiE4aiAXc8BaSzh9Z0b0f8Novn0Jyyi8JqNdzLzcI2rUGT4g8ct00gfUVdLuM',
});
}
}
4 changes: 2 additions & 2 deletions demo/angular/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Routes} from '@angular/router';
import { Routes } from '@angular/router';

export const routes: Routes = [
{
path: '',
loadChildren: () => import('./tabs/tabs.routes').then(m => m.routes)
loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
},
];
164 changes: 139 additions & 25 deletions demo/angular/src/app/demo/demo.page.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,166 @@
<ion-header>
<ion-toolbar>
<ion-title>
DEMO
</ion-title>
<ion-title> DEMO </ion-title>
</ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
<ion-list>
<ion-list-header><ion-label>PaymentSheet</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createPaymentSheet()" [disabled]="processSheet !== 'willReady'"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentPaymentSheet()" [disabled]="processSheet !== 'Ready'"><ion-label>present</ion-label></ion-item>
<ion-item
button="true"
detail="true"
(click)="createPaymentSheet()"
[disabled]="processSheet !== 'willReady'"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentPaymentSheet()"
[disabled]="processSheet !== 'Ready'"
><ion-label>present</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>PaymentSheet without customer</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createPaymentSheet(false)" [disabled]="processSheet !== 'willReady'"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentPaymentSheet()" [disabled]="processSheet !== 'Ready'"><ion-label>present</ion-label></ion-item>
<ion-list-header
><ion-label>PaymentSheet without customer</ion-label></ion-list-header
>
<ion-item
button="true"
detail="true"
(click)="createPaymentSheet(false)"
[disabled]="processSheet !== 'willReady'"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentPaymentSheet()"
[disabled]="processSheet !== 'Ready'"
><ion-label>present</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>PaymentSheet with billing details</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createPaymentSheet(false, true)" [disabled]="processSheet !== 'willReady'"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentPaymentSheet()" [disabled]="processSheet !== 'Ready'"><ion-label>present</ion-label></ion-item>
<ion-list-header
><ion-label>PaymentSheet with billing details</ion-label></ion-list-header
>
<ion-item
button="true"
detail="true"
(click)="createPaymentSheet(false, true)"
[disabled]="processSheet !== 'willReady'"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentPaymentSheet()"
[disabled]="processSheet !== 'Ready'"
><ion-label>present</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>PaymentSheet with setupIntent</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createPaymentSheetWithSetupIntent()" [disabled]="processSheet !== 'willReady'"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentPaymentSheet()" [disabled]="processSheet !== 'Ready'"><ion-label>present</ion-label></ion-item>
<ion-list-header
><ion-label>PaymentSheet with setupIntent</ion-label></ion-list-header
>
<ion-item
button="true"
detail="true"
(click)="createPaymentSheetWithSetupIntent()"
[disabled]="processSheet !== 'willReady'"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentPaymentSheet()"
[disabled]="processSheet !== 'Ready'"
><ion-label>present</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>PaymentFlow</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createPaymentFlow()" [disabled]="processFlow !== 'willReady'"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentPaymentFlow()" [disabled]="processFlow !== 'Ready'"><ion-label>present</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="confirmPaymentFlow()" [disabled]="processFlow !== 'canConfirm'"><ion-label>confirm</ion-label></ion-item>
<ion-item
button="true"
detail="true"
(click)="createPaymentFlow()"
[disabled]="processFlow !== 'willReady'"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentPaymentFlow()"
[disabled]="processFlow !== 'Ready'"
><ion-label>present</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="confirmPaymentFlow()"
[disabled]="processFlow !== 'canConfirm'"
><ion-label>confirm</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>PaymentFlow without customer</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createPaymentFlow()" [disabled]="processFlow !== 'willReady'"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentPaymentFlow()" [disabled]="processFlow !== 'Ready'"><ion-label>present</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="confirmPaymentFlow()" [disabled]="processFlow !== 'canConfirm'"><ion-label>confirm</ion-label></ion-item>
<ion-list-header
><ion-label>PaymentFlow without customer</ion-label></ion-list-header
>
<ion-item
button="true"
detail="true"
(click)="createPaymentFlow()"
[disabled]="processFlow !== 'willReady'"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentPaymentFlow()"
[disabled]="processFlow !== 'Ready'"
><ion-label>present</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="confirmPaymentFlow()"
[disabled]="processFlow !== 'canConfirm'"
><ion-label>confirm</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>ApplePay</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createApplePay()" [disabled]="processApplePay !== 'willReady' || !isApplePayAvailable"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentApplePay()" [disabled]="processApplePay !== 'Ready' || !isApplePayAvailable"><ion-label>present</ion-label></ion-item>
<ion-item
button="true"
detail="true"
(click)="createApplePay()"
[disabled]="processApplePay !== 'willReady' || !isApplePayAvailable"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentApplePay()"
[disabled]="processApplePay !== 'Ready' || !isApplePayAvailable"
><ion-label>present</ion-label></ion-item
>
</ion-list>
<ion-list>
<ion-list-header><ion-label>GooglePay</ion-label></ion-list-header>
<ion-item button="true" detail="true" (click)="createGooglePay()" [disabled]="processGooglePay !== 'willReady' || !isGooglePayAvailable"><ion-label>create</ion-label></ion-item>
<ion-item button="true" detail="true" (click)="presentGooglePay()" [disabled]="processGooglePay !== 'Ready' || !isGooglePayAvailable"><ion-label>present</ion-label></ion-item>
<ion-item
button="true"
detail="true"
(click)="createGooglePay()"
[disabled]="processGooglePay !== 'willReady' || !isGooglePayAvailable"
><ion-label>create</ion-label></ion-item
>
<ion-item
button="true"
detail="true"
(click)="presentGooglePay()"
[disabled]="processGooglePay !== 'Ready' || !isGooglePayAvailable"
><ion-label>present</ion-label></ion-item
>
</ion-list>
</ion-content>
Loading

0 comments on commit dcfbeec

Please sign in to comment.