Skip to content

Commit 38e91c5

Browse files
committed
Update Apple Pay Button type options to fit AppFolio's needs
1 parent e3d5d54 commit 38e91c5

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

ios/Views/PKPaymentButtonView.m

+3-5
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ - (void)setButtonType:(NSString *) buttonType andStyle:(NSString *) buttonStyle
6464
PKPaymentButtonType type;
6565
PKPaymentButtonStyle style;
6666

67-
if ([buttonType isEqualToString: @"buy"]) {
68-
type = PKPaymentButtonTypeBuy;
69-
} else if ([buttonType isEqualToString: @"setUp"]) {
67+
if ([buttonType isEqualToString: @"setUp"]) {
7068
type = PKPaymentButtonTypeSetUp;
69+
} else if ([buttonType isEqualToString: @"continue"]) {
70+
type = PKPaymentButtonTypeContinue;
7171
} else if ([buttonType isEqualToString: @"inStore"]) {
7272
type = PKPaymentButtonTypeInStore;
73-
} else if ([buttonType isEqualToString: @"donate"]) {
74-
type = PKPaymentButtonTypeDonate;
7573
} else {
7674
type = PKPaymentButtonTypePlain;
7775
}

js/PKPaymentButton/index.js

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
// @flow
22

3-
import * as React from 'react';
4-
import { NativeModules, requireNativeComponent } from 'react-native';
3+
import * as React from "react";
4+
import { NativeModules, requireNativeComponent } from "react-native";
55

66
type PKPaymentButtonType =
77
// A button with the Apple Pay logo only.
8-
| 'plain'
9-
// A button with the text “Buy with” and the Apple Pay logo.
10-
| 'buy'
11-
// A button prompting the user to set up a card.
12-
| 'setUp'
8+
| "plain"
9+
// A button with the text “Set up” and the Apple Pay logo.
10+
| "setUp"
11+
// A button with the text “Continue with” and the Apple Pay logo.
12+
| "continue"
1313
// A button with the text “Pay with” and the Apple Pay logo.
14-
| 'inStore'
15-
// A button with the text "Donate with" and the Apple Pay logo.
16-
| 'donate';
14+
| "inStore";
1715

1816
type PKPaymentButtonStyle =
1917
// A white button with black lettering (shown here against a gray background to ensure visibility).
20-
| 'white'
18+
| "white"
2119
// A white button with black lettering and a black outline.
22-
| 'whiteOutline'
20+
| "whiteOutline"
2321
// A black button with white lettering.
24-
| 'black';
22+
| "black";
2523

2624
type Props = $Exact<{
2725
style: ButtonStyle,
@@ -32,18 +30,17 @@ type Props = $Exact<{
3230
onPress: Function,
3331
}>;
3432

35-
const RNPKPaymentButton = requireNativeComponent('PKPaymentButton', null, {
33+
const RNPKPaymentButton = requireNativeComponent("PKPaymentButton", null, {
3634
nativeOnly: { onPress: true },
3735
});
3836

39-
4037
export type ButtonType = PKPaymentButtonType;
4138
export type ButtonStyle = PKPaymentButtonStyle;
4239

4340
export class PKPaymentButton extends React.Component<Props> {
4441
static defaultProps = {
45-
buttonStyle: 'black',
46-
buttonType: 'plain',
42+
buttonStyle: "black",
43+
buttonType: "plain",
4744
height: 44,
4845
cornerRadius: 4,
4946
};

0 commit comments

Comments
 (0)