Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR] Add cornerRadius to ApplePayButtonView #127

Closed
AymenFarrah opened this issue Apr 27, 2022 · 5 comments
Closed

[PR] Add cornerRadius to ApplePayButtonView #127

AymenFarrah opened this issue Apr 27, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@AymenFarrah
Copy link

Hello,

We can customize the Apple Pay Button with a cornerRadius (by default set to 4.0)

So to do this we need to add when create the button :

let buttonType = arguments["type"] as! String
let buttonStyle = arguments["style"] as! String
let cornerRadius = arguments["cornerRadius"] as! CGFloat

then create the button with this method :

createApplePayView(type: buttonType, style: buttonStyle, cornerRadius: cornerRadius)

and finally customize it only when available iOS 12 minimum :

// Create the PK objects
    let paymentButtonType = PKPaymentButtonType.fromString(buttonTypeString) ?? .plain
    let paymentButtonStyle = PKPaymentButtonStyle.fromString(buttonStyleString) ?? .black
    let applePayButton = PKPaymentButton(paymentButtonType: paymentButtonType, paymentButtonStyle: paymentButtonStyle)

    if #available(iOS 12.0, *) {
        applePayButton.cornerRadius = cornerRadius
    }
@JlUgia
Copy link
Member

JlUgia commented Jun 1, 2022

Hi @AymenFarrah, thank you for the suggestion.
Feel free to suggest a PR with the changes and we'll take a look.
If you are not able to do so, let us know too.

@JlUgia
Copy link
Member

JlUgia commented Jun 1, 2022

Related to #32

@JlUgia JlUgia added the enhancement New feature or request label Jun 1, 2022
@AymenFarrah
Copy link
Author

Hi @AymenFarrah, thank you for the suggestion.
Feel free to suggest a PR with the changes and we'll take a look.
If you are not able to do so, let us know too.

Hi @JlUgia !
I'm trying to open a new pull request based from main but Create pull request button is disabled.

@JlUgia
Copy link
Member

JlUgia commented Aug 17, 2022

Hello @AymenFarrah, PRs are accepted from external forks.
Please take a look at the contribution guide before proposing any changes.

@JlUgia
Copy link
Member

JlUgia commented Jan 21, 2024

Published under 1.2.0-beta02.

@JlUgia JlUgia closed this as completed Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants