-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make ccard images available (#116)
* Make credit card images accessible to the plugin. * bump version
- Loading branch information
1 parent
99affa1
commit 6bccd50
Showing
10 changed files
with
138 additions
and
8 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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<ActionBar title="Images" class="action-bar"> | ||
<NavigationButton text=""></NavigationButton> | ||
</ActionBar> | ||
<StackLayout class="page p-10"> | ||
<GridLayout rows="auto" columns="*,2*"> | ||
<Label col="0" text="Brand" class="h2 text-center"></Label> | ||
<Label col="1" text="Image" class="h2 text-center"></Label> | ||
</GridLayout> | ||
<StackLayout class="hr-light m-10"></StackLayout> | ||
<StackLayout *ngFor="let brand of brands"> | ||
<GridLayout rows="auto" columns="*,2*"> | ||
<Label col="0" [text]="brand"></Label> | ||
<Image col="1" width="32" height="20" [src]="images[brand]"></Image> | ||
</GridLayout> | ||
<StackLayout class="hr-light m-10"></StackLayout> | ||
</StackLayout> | ||
</StackLayout> |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Component } from "@angular/core"; | ||
import { Card, CardBrand } from "nativescript-stripe"; | ||
|
||
type ImageTable = { | ||
[brand: string]: any; | ||
}; | ||
|
||
@Component({ | ||
selector: "stp-images", | ||
moduleId: module.id, | ||
templateUrl: "images.component.html", | ||
}) | ||
export class ImagesComponent { | ||
images: ImageTable = {}; | ||
|
||
constructor() { | ||
let brands: CardBrand[] = ["Visa", "Amex", "MasterCard", "Discover", "JCB", "DinersClub", "Unknown"]; | ||
brands.forEach(b => this.images[b] = Card.cardImage(b)); | ||
} | ||
|
||
get brands(): string[] { | ||
return Object.keys(this.images); | ||
} | ||
} |
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
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