-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
2,608 additions
and
1,820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.