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

Implement Apple Pay and use the “Donate with Apple Pay” button for "Support Kiwix" #753

Open
BPerlakiH opened this issue May 7, 2024 · 27 comments · May be fixed by #1022
Open

Implement Apple Pay and use the “Donate with Apple Pay” button for "Support Kiwix" #753

BPerlakiH opened this issue May 7, 2024 · 27 comments · May be fixed by #1022
Assignees
Milestone

Comments

@BPerlakiH
Copy link
Collaborator

BPerlakiH commented May 7, 2024

Following Apple's recommendations for non-profit organisations:
https://developer.apple.com/apple-pay/nonprofits/
We should implement Apple Pay and use the "Donate with Apple Pay" button.

This should be done smartly so it works fine for custom apps as well

@kelson42
Copy link
Contributor

kelson42 commented May 7, 2024

Only Appke store pay should work with Applepay, other build (dmg) should have the traditional link.

@kelson42 kelson42 added this to the 3.3.1 milestone May 9, 2024
@Popolechien
Copy link
Member

Popolechien commented May 13, 2024

I have applied with Benevity/Apple Pay to get us approved. They should respond in a few days.

@rgaudin
Copy link
Member

rgaudin commented Jun 14, 2024

@Popolechien any news on this? Should we move that to 3.5.0?

@kelson42 kelson42 modified the milestones: 3.4.0, 3.5.0 Jun 15, 2024
@kelson42
Copy link
Contributor

@Popolechien We need an update here before implementing the feature.

@Popolechien
Copy link
Member

Screenshot 2024-09-18 at 12 07 36
No news. I have resubmitted, made a note to ping them on Monday 23rd, but seeing as a bunch of contact links are wrong/deprecated/broken I am cautiously optimistic.

@Popolechien
Copy link
Member

From Apple:

Hi team,
We are excited to let you know that your organization has been approved to accept donations with Apple Pay.
You can now submit your iOS app to the App Store for review or deploy your website’s integration of Apple Pay. If you’re in the process of integrating Apple Pay into your app or website, make sure to review the guidelines and resources on the Apple Developer website.
If you have any questions on implementing Apple Pay, you can talk to other developers and Apple engineers on the Apple Developer forums or contact us.
Best Regards,
Apple Developer Relations

@kelson42
Copy link
Contributor

@BPerlakiH You need anything else to move forward with the code?

@BPerlakiH
Copy link
Collaborator Author

Thank you @kelson42, I think initially it should be good, if anything arise while implementing it, I will let you know.

@BPerlakiH
Copy link
Collaborator Author

I've found the following things we need:
https://causeshelp.benevity.org/hc/en-us/articles/360001149486-Benevity-and-Apple-Pay

To accept donations with Apple Pay, your organization will need the following:
Payment provider
Apple Developer Program membership
Approval to accept donations with Apple Pay
Apple Pay implemented in your app or website

My question is do we have a payment provider?
I do see on the website DonorBox, which is backed up by Stripe, so maybe we could use Stripe (it’s on Apple’s list for us).

My understanding is that once we have payment provider they will give us a CSR file we can use to create our Apple Payment Certificate here:
https://developer.apple.com/account/resources/certificates/list
as described in Apple's doc:
https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request

@kelson42
Copy link
Contributor

kelson42 commented Sep 21, 2024

@BPerlakiH Yes, we have Stripe and we should use it. Can you handle the details directly with @Popolechien please?

@BPerlakiH
Copy link
Collaborator Author

@kelson42 I managed to put together the initial code part of this, with a very basic payment sheet, that Apple provides.
We can create any type of payment request with a specific total (eg. 15USD), I am not sure yet, if it should reflect the full form from the website support page? So that the user can edit the amount, choose a specific cause to support etc.
I am not yet sure about recurring payments (monthly / annually) but will have a look.

@BPerlakiH
Copy link
Collaborator Author

ipad_payment.mov

@Popolechien
Copy link
Member

Ok so I looked on Stripe to generate a CSR certificate and that clearly is above my skillset. @rgaudin can you please look into it?

@rgaudin
Copy link
Member

rgaudin commented Sep 24, 2024

@BPerlakiH I've created the CSR on Stripe and requested the certificate from Apple using it and received the certificate which I uploaded to Stripe as well. Both seem happy. Do you need anything else?

@BPerlakiH
Copy link
Collaborator Author

Thank you very much.
Q: should it reflect the full form from the website support page ?

@Popolechien
Copy link
Member

Popolechien commented Sep 25, 2024

A: not really, but potential donors should be given the choice of making this a one-time or monthly recurring donation (annual is never used, and donations will likely be flagged as coming from iOS so the priority and comment parts can also be ignored). I don't know how much leeway you have (or how much space is available before the screen gets crowded), but 10/34/custom amount is a decent range of choices.

Let me know what is doable within a reasonable amount of work (e.g. if it is a full day to implement a distinct recurring donation panel, then never mind and just make it a radio button for people to chose).

@BPerlakiH
Copy link
Collaborator Author

Thank you, I am looking into it what's the best way to achieve it.

@kelson42
Copy link
Contributor

kelson42 commented Oct 1, 2024

@BPerlakiH Do you have gain clarity here about the path to follow?

@BPerlakiH
Copy link
Collaborator Author

@kelson42 Yes, we need the user input in terms of what amount he/she wants to donate.
I managed to put together a UI for it, based on the form from the website. So it's possible to select from predefined amounts, and custom one as well. For simplicity the multi currency is only added to the custom amount, but I suppose that should be OK.

https://github.com/user-attachments/assets/70284c82-e23d-4d22-aef1-d6dff1291081
https://github.com/user-attachments/assets/ecb52232-e1ab-4f0b-ac82-969be23e0ab1
https://github.com/user-attachments/assets/427261c3-f898-4717-9b67-084c030c02c4

@Popolechien
Copy link
Member

Thanks a lot @BPerlakiH. Two questions:

@rgaudin
Copy link
Member

rgaudin commented Oct 4, 2024

Great ; I think the feature is here and we should work on making it a bit more appealing. A sentence (from @Popolechien, telling users why we ask for donations, etc), an icon maybe (love-receiving Kiwix?) and probably an Apple Pay logo as we want users to know that they wont need to take out their credit card to make a donation.
I believe regular users are not aware that we were required to use Apple Pay to add the feature to the app.
If we only accept Apple Pay, that seems important as well.

@Popolechien
Copy link
Member

I'd recommend sticking to the Signal playbook and have a minimalist text. Here is what they have

Image

(the Read more link adds a little popup with a bit more text but nothing much else except for a bigger heart - I do not think we need to go that route.

So for the header text here is my suggestion

No ads, no tracking 
Kiwix is a non-profit funded by people like you. If you enjoy Kiwix and find it useful, make a donation and help keep it fun. 

Note: as in the Signal banner the first line "No ads, no tracking" should be in a bigger font.

@rgaudin
Copy link
Member

rgaudin commented Oct 4, 2024

Latest Signal is a bit different. First of all, the donate menu is inside the Settings.
Then the process is two-steps with a card first and then the new version of what you shared.
It's not that minimalist anymore as there's the profile picture, accompanied with an icon (support level I think but not sure) and then when selecting an amount, there's an amount-related emoji animation

Screen.Recording.2024-10-04.at.10.mp4

I'm with you on following what others with more resources and success have (probably) thought-through and done but that should not prevent us from making our own decisions

@BPerlakiH
Copy link
Collaborator Author

BPerlakiH commented Oct 5, 2024

Thank you for the feedback.
@Popolechien:

Is there a default currency (e.g. the user's?) If not then make it USD

We can add as many currencies as we want (eg. Signal is using all possible currencies of the world), the limitation will come not from the development process, but rather from the payment provider, they might not accept all of them.
Yes, there's an easy way to get the user's local (language and) currency, so it's possible to default to that one.
Please remember, this brings up another layer we need to take care of, which is the currency rate, which ideally should be updated from an online source. Since USD/EUR/CHF are rather close by value to each other, we could default to values such as 10,15 etc without using a data source for currency rates. If we go full scale, other currencies will be rather volatile in this matter, so we would need to re-calculate those values, as an example from Signal, displaying values in IDR:

Image

On the plus side this is convenient for the user, on the other hand the whole section of donations will become dependent on "being online", and not just the final "Apple Pay" button.

@rgaudin Thanks for the suggestion with Signal, I did checked their iOS app as well, and that looks good. In terms of making it look nice, I think the iOS part is where the nice look and feel will end. On macOS the system provided components aren't that nice, to be honest... There's no real comparison, as there's no donation section for Signal macOS app, but Apple Pay will work equally good on macOS.

@BPerlakiH
Copy link
Collaborator Author

Additionally from what I can see on Signal, is that there's also a minimum amount for one time donation defined as well (USD 3$).

@Popolechien
Copy link
Member

Popolechien commented Oct 7, 2024

@BPerlakiH I think the $3 minimum is to discourage fraudulent transactions IIRC so we might as well implement it unless it's bein implemented by default.

As for currency let's default to EUR/USD only based on user location, with USD being the "real" default (that is, for non-EU users) and no bothering with FOREX adjustments.

@kelson42
Copy link
Contributor

kelson42 commented Oct 10, 2024

We should go now for a minimal version, with only USD and no custom design. It has to be clean and working bit nothing more. Improvements and refinements ideas should be tracked in new issues. It's important now to quickly move on the PR.

Remark: It's important his feature to have no impact on custom apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment