Git Product home page Git Product logo

africastalking-scala's Introduction

africastalking-scala

Usage

The SDK needs to be configured with your app username and API key, which you get from the dashboard.

You can use this SDK for either production or sandbox apps. For sandbox, the app username is ALWAYS sandbox

Services

All methods are asynchronous (i.e. will not block current thread Future based)

All phone numbers use the international format. e.g. +234xxxxxxxx.

All amount strings contain currency code as well. e.g. UGX 443.88.

ApplicationService

  • fetchApplicationData(): Get app information. e.g. balance

AirtimeService

  • send(String phoneNumber, String amount): Send airtime to a phone number. Example amount would be KES 150.

For more information about status notification, please read http://docs.africastalking.com/airtime/callback

SmsService

  • send(String message, String[] recipients): Send a message

  • sendPremium(String message, String keyword, String linkId, String[] recipients): Send a premium SMS

  • fetchMessages(): Fetch your messages

  • fetchSubscription(String shortCode, String keyword): Fetch your premium subscription data

  • createSubscription(String shortCode, String keyword, String phoneNumber, String checkoutToken): Create a premium subscription

  • deleteSubscription(String shortCode, String keyword, String phoneNumber): Remove a phone number from a premium subscription

For more information on:

PaymentService

  • cardCheckout(String productName, String amount, PaymentCard paymentCard, String narration, Map metadata): Initiate card checkout.

  • validateCardCheckout(String transactionId, String otp): Validate a card checkout

  • bankCheckout(String productName, String amount, BankAccount bankAccount, String narration, Map metadata): Initiate bank checkout.

  • validateBankCheckout(String transactionId, String otp): Validate a bank checkout

  • bankTransfer(String productName, List<Bank> recipients): Move money form payment wallet to bank account

  • mobileCheckout(String productName, String phoneNumber, String amount): Initiate mobile checkout.

  • mobileB2C(String productName, List<Consumer> consumers): Send mobile money to consumer.

  • mobileB2B(String productName, Business recipient): Send mobile money to business.

  • walletTransfer(String productName, long targetProductCode, String amount, HashMap<String, String> metadata): Move money form one payment product to another.

  • topupStash(String productName, String amount, HashMap<String, String> metadata): Move money from payment product to app's stash.

For more information, please read http://docs.africastalking.com/payments

VoiceService

  • call(String phoneNumber): Initiate a phone call

  • fetchQueuedCalls(String phoneNumber): Get queued calls

  • uploadMediaFile(String phoneNumber, String url): Upload voice media file

  • ActionBuilder: Build voice xml when callback URL receives a POST from Africa's Talking

    • say(): Add a Say action.

    • play(): Add a Play action.

    • getDigits(): Add a GetDigits action.

    • dial(): Add a Dial action.

    • conference(): Add a Conferemce action.

    • record(): Add a Record action.

    • enqueue(): Add a Enqueue action.

    • dequeue(): Add a Dequeue action.

    • reject(): Add a Reject action.

    • redirect(): Add a Redirect action.

    • build(): Finally build the xml

For more information, please read http://docs.africastalking.com/voice

TokenService

  • createCheckoutToken(String phoneNumber): Create a new checkout token for phoneNumber.

  • generateAuthToken(): Generate an auth token to use for authentication instead of an API key.

USSDService

For more information, please read http://docs.africastalking.com/ussd

Issues

If you find a bug, please file an issue on [our issue tracker on GitHub]

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.