Skip to content

Commit b2b1c96

Browse files
committed
feat: add support for buttonBorderType
1 parent 214be5e commit b2b1c96

7 files changed

Lines changed: 1452 additions & 1444 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"editor.formatOnSave": true,
1010
"editor.codeActionsOnSave": {
11-
"source.fixAll.eslint": true
11+
"source.fixAll.eslint": "explicit"
1212
},
1313
"angular.enable-strict-mode-prompt": false
1414
}

package-lock.json

Lines changed: 1431 additions & 1435 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/button-angular/lib/google-pay-button.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class GooglePayButtonComponent implements OnInit, OnChanges {
3737
@Input() buttonRadius?: number;
3838
@Input() buttonSizeMode?: google.payments.api.ButtonSizeMode;
3939
@Input() buttonLocale?: string;
40+
@Input() buttonBorderType?: google.payments.api.ButtonBorderType;
4041
@Input() paymentDataChangedCallback?: google.payments.api.PaymentDataChangedHandler;
4142
@Input() paymentAuthorizedCallback?: google.payments.api.PaymentAuthorizedHandler;
4243
@Input() readyToPayChangeCallback?: (result: any) => void;
@@ -79,6 +80,7 @@ export class GooglePayButtonComponent implements OnInit, OnChanges {
7980
buttonRadius: this.buttonRadius,
8081
buttonSizeMode: this.buttonSizeMode,
8182
buttonLocale: this.buttonLocale,
83+
buttonBorderType: this.buttonBorderType,
8284
onReadyToPayChange: result => {
8385
if (this.readyToPayChangeCallback) {
8486
this.readyToPayChangeCallback(result);

src/button-angular/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/button-element/GooglePayButton.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class GooglePayButton extends HTMLElement {
6262
@Alias('buttonlocale')
6363
buttonLocale?: string;
6464

65+
@NotifyAttribute()
66+
@Alias('buttonbordertype')
67+
buttonBorderType?: google.payments.api.ButtonBorderType;
68+
6569
@Notify()
6670
@Alias('paymentDataChangedCallback')
6771
@Alias('paymentdatachangedcallback')
@@ -166,6 +170,7 @@ class GooglePayButton extends HTMLElement {
166170
buttonRadius: this.buttonRadius,
167171
buttonSizeMode: this.buttonSizeMode,
168172
buttonLocale: this.buttonLocale,
173+
buttonBorderType: this.buttonBorderType,
169174
onReadyToPayChange: result => {
170175
if (this.onReadyToPayChange) {
171176
this.onReadyToPayChange(result);

src/lib/button-manager.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ describe('createButton', () => {
714714
buttonRadius: 4,
715715
buttonLocale: 'fr',
716716
buttonSizeMode: 'fill',
717+
buttonBorderType: 'no_border',
717718
};
718719
await manager.configure(config);
719720

@@ -724,6 +725,7 @@ describe('createButton', () => {
724725
buttonRadius: 4,
725726
buttonLocale: 'fr',
726727
buttonSizeMode: 'fill',
728+
buttonBorderType: 'no_border',
727729
onClick: expect.any(Function),
728730
}),
729731
);

src/lib/button-manager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface Config {
4040
buttonRadius?: number;
4141
buttonSizeMode?: google.payments.api.ButtonSizeMode;
4242
buttonLocale?: string;
43+
buttonBorderType?: google.payments.api.ButtonBorderType;
4344
}
4445

4546
interface ButtonManagerOptions {
@@ -247,6 +248,7 @@ export class ButtonManager {
247248
buttonRadius: this.config.buttonRadius,
248249
buttonSizeMode: this.config.buttonSizeMode,
249250
buttonLocale: this.config.buttonLocale,
251+
buttonBorderType: this.config.buttonBorderType,
250252
onClick: this.handleClick,
251253
allowedPaymentMethods: this.config.paymentRequest.allowedPaymentMethods,
252254
};
@@ -420,6 +422,7 @@ export class ButtonManager {
420422
config.buttonRadius,
421423
config.buttonLocale,
422424
config.buttonSizeMode,
425+
config.buttonBorderType,
423426
config.paymentRequest.merchantInfo.merchantId,
424427
config.paymentRequest.merchantInfo.merchantName,
425428
config.paymentRequest.merchantInfo.softwareInfo?.id,

0 commit comments

Comments
 (0)