Giter Site home page Giter Site logo

opendonation's Introduction

OpenDonation

An Open Source donation app for Android making use of the Square card reader.

Add a custom logo & background

To add your own custom logo to the top of the donation box, create a transparent .png image and copy it over the top of:

Portrait logo: app/src/main/res/drawable/custom_logo.png

Landscape logo: app/src/main/res/drawable/custom_logo_land.png

Then set the logo to appear in the file MainActivity.java by un-commenting out setCustomLogo();

To change the background colour, edit colorPrimary in app/src/main/res/values/colors.xml.

Other settings

Open MainActivity.java and scroll to Setup default donation values where you can set:

minimumDonationValue = 5;
maximumDonationValue = 99;
donationValue = 5; // currently selected value
transactionTimeout = 4; // in seconds
showDialogs = true; // set false to hide success dialogs
dialogAutoDismissTimeout = 10; // in seconds

Register your app

Don’t forget to register your app under your Square dev account: https://connect.squareup.com/apps

You’ll need your package name: com.company.opendonation

And the fingerprint of your debug certificate, which you can find with this one-liner:

$ keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Full instructions: https://docs.connect.squareup.com/articles/android-app-fingerprint

Secrets

Secrets are stored in a file you’ll need to create:

<!-- Inside of `app/src/main/res/values/secrets.xml` -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="square_client_id">YOUR_CLIENT_ID</string>
</resources>

Usage:

getString(R.string.square_client_id);
<meta-data
    android:name="com.squareup"
    android:value="@string/square_client_id"/>

Follow the guide to get YOUR_CLIENT_ID: https://docs.connect.squareup.com/articles/point-of-sale-api-android

Credits

Idea by Ashleigh Hull.

Open Donation logo by simpvi.

opendonation's People

Contributors

sighmon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

cybershambles

opendonation's Issues

FEATURE 3: Theme

This kind of depends on how we handle the scroller - but I'd like to be able to theme the application

Min: https://generozity.com.au/ purple

ok: maybe an animated cycle with the logo or something

better: fully themed animated application.

Maybe if half of the app was interaction and the second half was just "empty space" for artwork to cycle thru

Square: NFC Reader seems to unsync from mobile - require hard reboot

I got home today, and the reader was disconnected from the mobile phone.

Tried to resync with a quick click of the button as requested, but it refused to sync.

had to hold the button down for 15~ seconds until the lights went from orange to red,
then resync with the device..

Might need to speak with Square regarding bugs?

OR have a method of sending "test pings" to the unit on a regular basis?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.