All Projects → ArioAtlas → react-native-cafe-bazaar

ArioAtlas / react-native-cafe-bazaar

Licence: MIT license
In-App billing for Cafe Bazaar (local android market)

Programming Languages

java
68154 projects - #9 most used programming language
AIDL
53 projects

Projects that are alternatives of or similar to react-native-cafe-bazaar

Poolakey
Android In-App Billing SDK for Cafe Bazaar App Store
Stars: ✭ 60 (+130.77%)
Mutual labels:  billing, bazaar, in-app-purchase, cafebazaar
RxBilling
Rx wrapper for Billing Library with connection management
Stars: ✭ 79 (+203.85%)
Mutual labels:  billing, inapp-billing
HiveMind
HiveMind is a project management and ERP application for services organizations. It features project/task management, request tracking, time tracking, expenses, invoices/payments, general ledger, and content management (wiki). HiveMind is based on Moqui Framework, Mantle Business Artifacts, and Simple Screens.
Stars: ✭ 40 (+53.85%)
Mutual labels:  payment, billing
cashier-paystack
Cashier provides an expressive, fluent interface to Paystack's subscription billing services.
Stars: ✭ 44 (+69.23%)
Mutual labels:  payment, billing
Commerce billing
A payment processing library for Elixir
Stars: ✭ 170 (+553.85%)
Mutual labels:  payment, billing
Gringotts
A complete payment library for Elixir and Phoenix Framework
Stars: ✭ 396 (+1423.08%)
Mutual labels:  payment, billing
DYFStoreKit
([Swift] https://github.com/chenxing640/DYFStore) A lightweight and easy-to-use iOS library for In-App Purchases (Objective-C). DYFStoreKit uses blocks and notifications to wrap StoreKit, provides receipt verification and transaction persistence and doesn't require any external dependencies.
Stars: ✭ 52 (+100%)
Mutual labels:  payment, in-app-purchase
drf-stripe-subscription
An out-of-box Django REST framework solution for payment and subscription management using Stripe.
Stars: ✭ 42 (+61.54%)
Mutual labels:  payment, billing
Stripe
A comprehensive PHP Library for the Stripe.
Stars: ✭ 256 (+884.62%)
Mutual labels:  payment, billing
Jetstream Cashier Billing Portal
Jetstream Cashier Billing Portal is a simple scaffolding billing portal to manage subscriptions, invoices and payment methods, built on top of Jetstream & Cashier Register.
Stars: ✭ 45 (+73.08%)
Mutual labels:  payment, billing
recurly
A Recurly API client written in golang. Actively maintained and unit tested. No external dependencies.
Stars: ✭ 40 (+53.85%)
Mutual labels:  payment, billing
subscribie
Collect recurring payments online - subscription payments collection automation
Stars: ✭ 36 (+38.46%)
Mutual labels:  billing
Tinkoff-Acquiring-SDK-Flutter
Flutter Tinkoff Acquiring SDK is a simple way to integrate payments into your mobile application.
Stars: ✭ 42 (+61.54%)
Mutual labels:  payment
omise-magento
Omise Magento Plugin
Stars: ✭ 32 (+23.08%)
Mutual labels:  payment
Banklink
PHP payment library to easily integrate Baltic banklinks (supports old and new iPizza protocol), E-commerce gateaway (Estcard, Nets Estonia), Liisi Payment Link and Pocopay.
Stars: ✭ 34 (+30.77%)
Mutual labels:  payment
csob-gateway
Client library for CSOB card payment gateway
Stars: ✭ 25 (-3.85%)
Mutual labels:  payment
cafebazaar flutter
CafeBazaar In-App Billing Plugin for flutter
Stars: ✭ 27 (+3.85%)
Mutual labels:  cafebazaar
africastalking-node.js
Official Node.js SDK for Africa's Talking
Stars: ✭ 113 (+334.62%)
Mutual labels:  payment
react-native-ad-consent
Google's User Messaging Platform (UMP SDK) for React Native.
Stars: ✭ 30 (+15.38%)
Mutual labels:  iab
direct-stripe
Stripe payment button for WordPress websites
Stars: ✭ 12 (-53.85%)
Mutual labels:  payment

InApp Billing for Cafe Bazaar (Android)

React Native Cafe Bazaar is built to provide an easy interface to InApp Billing for Cafe Bazaar,

⚠️ Notice: This ibrary is not being activeliy updated. You might want to use the RN library of the cafebazaar itself.

Installation

  1. npm install --save react-native-cafe-bazaar or yarn add react-native-cafe-bazaar
  2. Add the following in android/settings.gradle
...
include ':react-native-cafe-bazaar', ':app'
project(':react-native-cafe-bazaar').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-cafe-bazaar/android/app')
  1. And the following in android/app/build.gradle
...
dependencies {
    ...
    implementation project(':react-native-cafe-bazaar')
}
  1. Update MainActivity or MainApplication depending on React Native version.
  • React Native version >= 0.29 Edit MainApplication.java.
    1. Add import com.contoriel.cafebazaar.CafeBazaarPackage; in the top of the file.
    2. Register package:
    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        // add package here
        new CafeBazaarPackage()
      );
    }
  1. Add your CafeBazaar Public key as a line to your android/app/src/main/res/values/strings.xml with the name CAFE_BAZAAR_PUBLIC_KEY. For example:
<string name="CAFE_BAZAAR_PUBLIC_KEY">YOUR_CAFE_BAZAAR_PUBLIC_KEY_HERE</string>

Alternatively, you can add your license key as a parameter when registering the CafeBazaarPackage, like so:

.addPackage(new CafeBazaarPackage("YOUR_CAFE_BAZAAR_PUBLIC_KEY_HERE"))

or for React Native 29+

new CafeBazaarPackage("YOUR_CAFE_BAZAAR_PUBLIC_KEY_HERE")

Add the billing permission as follows to AndroidManifest.xml file:

<uses-permission android:name="com.farsitel.bazaar.permission.PAY_THROUGH_BAZAAR"></uses-permission>

ON THE BAZAAR DEVELOPER PANEL

  1. Upload the application to the Developer Panel.
  1. Using the Enter button in In-app Billing column of the created app, go to In-app Billing Panel.

  2. In that app, create your in-app items

  3. Grab the application's public key (a base-64 string) You can find the application's public key in the Dealer Apps page for your application.

Javascript API

Most of methods returns a Promise.

open()

Important: Opens the service channel to CafeBazaar. Must be called (once!) before any other billing methods can be called.

import CafeBazaar from 'react-native-cafe-bazaar'

...

CafeBazaar.open()
.then(() => CafeBazaar.purchase('YOUR_SKU','DEVELOPER_PAYLOAD',RC_REQUEST))
.catch(err => console.log('CafeBazaar err:', err))

close()

Important: Must be called to close the service channel to CafeBazaar, when you are done doing billing related work. Failure to close the service channel may degrade the performance of your app.

CafeBazaar.open()
.then(() => CafeBazaar.purchase('YOUR_SKU','DEVELOPER_PAYLOAD',RC_REQUEST))
.then((details) => {
  console.log(details)
  return CafeBazaar.close()
})
.catch(err => console.log('CafeBazaar err:', err))

purchase('YOUR_SKU','DEVELOPER_PAYLOAD',RC_REQUEST)

Parameter(s)
  • productSKU (required): String
  • developerPayload: String
  • rcRequest: Integer
Returns:
  • Details: JSONObject:
    • mDeveloperPayload:
    • mItemType:
    • mOrderId:
    • mOriginalJson:
    • mPackageName:
    • mPurchaseState:
    • mPurchaseTime:
    • mSignature:
    • mSku:
    • mToken:
CafeBazaar.purchase('YOUR_SKU','DEVELOPER_PAYLOAD',RC_REQUEST)
.then((details) => {
  console.log(details)
})
.catch(err => console.log('CafeBazaar err:', err))

consume('YOUR_SKU')

Parameter(s)
  • productSKU (required): String
Returns:
  • Details: JSONObject:
    • mDeveloperPayload:
    • mItemType:
    • mOrderId:
    • mOriginalJson:
    • mPackageName:
    • mPurchaseState:
    • mPurchaseTime:
    • mSignature:
    • mSku:
    • mToken:
CafeBazaar.consume('YOUR_SKU')
.then(...)
.catch(err => console.log('CafeBazaar err:', err))

loadOwnedItems()

Returns:
  • items: JSONArray:
CafeBazaar.loadOwnedItems()
.then((details) => {
  console.log(details)
})
.catch(err => console.log('CafeBazaar err:', err))

loadInventory([item1_SKU,item2_SKU,...])

Parameter(s)
  • productSKUs (required): Array
Returns:
  • mPurchaseMap: JSONObject
  • mSkuMap: JSONObject
CafeBazaar.loadInventory([])
.then(...)
.catch(err => console.log('CafeBazaar err:', err))

Use event listener

Below function dispatch Event instead of Promise and return value is same.

purchaseWithEvent('YOUR_SKU','DEVELOPER_PAYLOAD',RC_REQUEST)

consumeWithEvent('YOUR_SKU')

loadOwnedItemsWithEvent()

import {DeviceEventEmitter} from 'react-native';
...
  componentDidMount(){
    DeviceEventEmitter.addListener('CafeBazaar', function(e: Event) {
      // handle event.
      console.log(e);
    });
  }

BACK TO BAZAAR DEVELOPER PANEL

Upload the updated APK to Bazaar Developer Panel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].