Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions docs/documentation/sdk-reference/apple-pay-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ loadPrimer();
const checkout = document.querySelector('primer-checkout');
checkout.options = {
applePay: {
buttonOptions: {
type: 'buy',
buttonStyle: 'black',
},
buttonType: 'buy',
buttonStyle: 'black',
billingOptions: {
requiredBillingContactFields: ['postalAddress'],
},
Expand All @@ -34,7 +32,7 @@ checkout.options = {

## Button Style Options

Customize the appearance of the Apple Pay button through the `buttonOptions` configuration. All properties are optional.
Customize the appearance of the Apple Pay button with `buttonType` and `buttonStyle`. Both properties are optional.

### Button Type

Expand Down Expand Up @@ -75,33 +73,33 @@ The button style controls the visual appearance of the Apple Pay button.
```typescript
// Standard black button for purchasing
applePay: {
buttonOptions: {
type: 'buy',
buttonStyle: 'black',
},
buttonType: 'buy',
buttonStyle: 'black',
}

// White button for dark backgrounds
applePay: {
buttonOptions: {
type: 'pay',
buttonStyle: 'white',
},
buttonType: 'pay',
buttonStyle: 'white',
}

// Donation button with outline style
applePay: {
buttonOptions: {
type: 'donate',
buttonStyle: 'white-outline',
},
buttonType: 'donate',
buttonStyle: 'white-outline',
}
```

:::tip Apple Pay Design Guidelines
Apple provides strict design guidelines for Apple Pay buttons. The SDK automatically renders buttons according to [Apple's Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/apple-pay).
:::

:::note Button dimensions
The SDK does not currently expose Apple Pay button height or corner radius as Primer styling options. CSS custom properties such as `--apple-pay-button-height` and `--apple-pay-button-border-radius` are not part of the documented `<primer-checkout>` styling API and may not resize the SDK-rendered Apple Pay button.

Use surrounding layout CSS to control spacing around the button. Changing the rendered Apple Pay button dimensions would require SDK support.
:::

## Billing Contact Options

Capture the customer's billing information from their Apple Wallet through the `billingOptions` configuration.
Expand Down Expand Up @@ -194,10 +192,8 @@ applePay: {
sdkCore: true, // Required for Apple Pay
applePay: {
// Button styling
buttonOptions: {
type: 'buy',
buttonStyle: 'black',
},
buttonType: 'buy',
buttonStyle: 'black',

// Billing information
billingOptions: {
Expand Down Expand Up @@ -266,9 +262,8 @@ Apple Pay only works on supported devices with Safari or WebKit-based browsers.

| Option | Type | Default | Description |
| ----------------------------------------------- | ---------- | --------- | ---------------------------------- |
| `buttonOptions` | `object` | — | Button styling configuration |
| `buttonOptions.type` | `string` | `'plain'` | Button label type |
| `buttonOptions.buttonStyle` | `string` | — | Button color theme |
| `buttonType` | `string` | `'plain'` | Button label type |
| `buttonStyle` | `string` | `'black'` | Button color theme |
| `billingOptions` | `object` | — | Billing information configuration |
| `billingOptions.requiredBillingContactFields` | `string[]` | — | Billing fields to capture |
| `shippingOptions` | `object` | — | Shipping information configuration |
Expand Down
4 changes: 4 additions & 0 deletions docs/documentation/sdk-reference/sdk-options-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ The type of Apple Pay button to display.

The visual style of the Apple Pay button.

:::note Apple Pay button dimensions
The SDK does not currently expose Apple Pay button height or corner radius as Primer styling options. CSS custom properties such as `--apple-pay-button-height` and `--apple-pay-button-border-radius` are not part of the documented `<primer-checkout>` styling API and may not resize the SDK-rendered Apple Pay button.
:::

### applePay.captureBillingAddress

**Type**: `boolean`
Expand Down
1 change: 1 addition & 0 deletions examples/primer-checkout-themes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,6 @@ To create your own theme:
## Important Notes

- Some elements like PayPal, Apple Pay, and Google Pay have their own styling limitations
- Apple Pay button height and corner radius are not currently exposed as Primer theme variables
- This example uses only documented Primer style variables for maximum compatibility
- The proper approach for theming is to apply the theme class directly to the `primer-checkout` element