All Projects → ZarinPal-Lab → Android-SDK-Payment

ZarinPal-Lab / Android-SDK-Payment

Licence: other
A Simple Library for handle ZarinPal Payment on Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Android-SDK-Payment

Android-MonetizeApp
A sample which uses Google's Play Billing Library and it makes In-app Purchases and Subscriptions.
Stars: ✭ 149 (+684.21%)
Mutual labels:  inapppurchase, inapp-billing
RxBilling
Rx wrapper for Billing Library with connection management
Stars: ✭ 79 (+315.79%)
Mutual labels:  inapppurchase, inapp-billing
KinApp
A Kotlin In App Purchase library that lets you easily manage your billing process in Android
Stars: ✭ 79 (+315.79%)
Mutual labels:  inapppurchase, inapp-billing
iran-payment
a Laravel package to handle Internet Payment Gateways for Iran Banking System
Stars: ✭ 16 (-15.79%)
Mutual labels:  zarinpal
Google-IAP
Android Library for easing Google Play Billing to your apps with support for Subscriptions, In-App Purchases and Consumables with a beautiful sample app.
Stars: ✭ 129 (+578.95%)
Mutual labels:  inapppurchase
hisha
Postgres SQL Cross Platform Web-based Client
Stars: ✭ 23 (+21.05%)
Mutual labels:  pg
casbin-pg-adapter
A go-pg adapter for casbin
Stars: ✭ 23 (+21.05%)
Mutual labels:  pg
pg-sql-helpers
A set helpers for writing dynamic SQL queries with `pg-sql` in Javascript.
Stars: ✭ 37 (+94.74%)
Mutual labels:  pg
pgspeck
Small block size Speck encryption in PostgreSQL
Stars: ✭ 16 (-15.79%)
Mutual labels:  pg
react-native-cafe-bazaar
In-App billing for Cafe Bazaar (local android market)
Stars: ✭ 26 (+36.84%)
Mutual labels:  inapp-billing
sqle
SQLE is a SQL audit platform | SQLE 是一个支持多场景,原生支持 MySQL 审核且数据库类型可扩展的 SQL 审核工具
Stars: ✭ 731 (+3747.37%)
Mutual labels:  pg
az-iranian-bank-gateways
درگاه اتصال به بانک های ایرانی ( درگاه پرداخت بانک ملی ایران،بانک سامان، بانک ملت، درگاه پرداخت زرین پال و ... ) با استفاده از پایتون
Stars: ✭ 308 (+1521.05%)
Mutual labels:  zarinpal
zarinpal-composer-library
transaction request library for zarinpal
Stars: ✭ 50 (+163.16%)
Mutual labels:  zarinpal
nestjs-api-mongoose
Collection example apps with NestJS and Typeorm, Sequelize, Mongodb, PostgreSQL, MySQL, GraphQL, Mercurius, etc. for the NestJS community 😻
Stars: ✭ 153 (+705.26%)
Mutual labels:  pg
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+57621.05%)
Mutual labels:  pg
Blog
Everything about database,business.(Most for PostgreSQL).
Stars: ✭ 6,330 (+33215.79%)
Mutual labels:  pg
zarinpal-laravel
Zarinpal payment for Laravel Framework
Stars: ✭ 31 (+63.16%)
Mutual labels:  zarinpal
laravel-multi-payment
Laravel online gateway payment package with multi driver support
Stars: ✭ 22 (+15.79%)
Mutual labels:  zarinpal
php-ipg-ir
IPG (Internet Payment Gateway) manager for Iran Banking System
Stars: ✭ 26 (+36.84%)
Mutual labels:  ipg

The Repo and Project has been DEPRECATED and Archived please check Android-SDK

ZarinPal Purchase Android SDK

ZarinPal Payment Requeset SDK on Android Platforms Simply Request to ZarinPal IPG and Callback Handling

ZarinPal Flow:

In first step You must initilize of ZarinPal by getPurchase after that, ZarinPal Ready to Payment. for begining you must create a PaymentRequest by getPaymentRequest, Now you must set parameters MerchantID, Amount (In Rials), Description and CallbackUrl

What is Payment Request?

Payment Request is require paramaters payment for Indentity in ZarinPal

Require Parameters:

  • Merchant id: An unique ID of your business payment gateway.
  • Amount: Amount of Purchase.
  • Callback URL: A valid URI or URL Address for sending result purchase.
  • Description: A Content for showing to payer.

Optional Parameters:

  • Mobile: Valid Mobile number of payer.
  • Email: Valid Email Address of payer.

You send a PaymentRequest for ZarinPal with parameters MerchantID, Amount (In Rials), Description and CallbackUrl . Then ZarinPal will reply to you with a unique purchase ID (Authority). Then with the Authority in Hand, You call startPayment method and ZarinPal in response will direct you to a payment gateway if the purchase ID is valid and after completing the purchase , Zarinpal send Purchase Result to CallbackUrl. After completing the purchase, you can send a verificationPayment request if it is successful, and ZarinPal will send you a RefID, which represents the transaction ID, in case of success.

for verifty purchase you must set getIntent().getData() and call verificationPayment for verify inner app sure ZarinPal don't recommend to use this method becuase this is not safe. That's better you do verifing flow on your server and notify your app.

Note: ZarinPal is not IAB or IAP, ZarinPal JUST provides payment solution.

How to use

  • Compile ZarinPal In App Purchase SDK:
   implementation 'com.zarinpal:purchase:0.0.10'
  • Internet Access Permission on AndroidManifest.xml:
    <uses-permission android:name="android.permission.INTERNET"/>
  • Set Your Application Scheme on AndroidManifest.xml to Callback for inner handling in App:
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>

         <category android:name="android.intent.category.DEFAULT"/>
         <category android:name="android.intent.category.BROWSABLE"/>

         <data android:scheme="<YOUR-APP-SCHEME>"/>
     </intent-filter>

Note: If You want handle and checking of verification your Payment on Your sever you must set your server address (aka URL) by setCallbackURL and no need to do the above step.

Example For Payment Request:

       ZarinPal       purchase = ZarinPal.getPurchase(this);
       PaymentRequest payment  = ZarinPal.getPaymentRequest();
       //If you will test on our sandbox, you can use it:
       PaymentRequest payment  = ZarinPal.getSandboxPaymentRequest();



       payment.setMerchantID("71c705f8-bd37-11e6-aa0c-000c295eb8fc");
       payment.setAmount(100);
       payment.isZarinGateEnable(true);  // If you actived `ZarinGate`, can handle payment by `ZarinGate`
       payment.setDescription("In App Purchase Test SDK");
       payment.setCallbackURL("yourapp://app");     /* Your App Scheme */
       payment.setMobile("09355106005");            /* Optional Parameters */
       payment.setEmail("[email protected]");     /* Optional Parameters */


       purchase.startPayment(payment, new OnCallbackRequestPaymentListener() {
           @Override
           public void onCallbackResultPaymentRequest(int status, String authority, Uri paymentGatewayUri, Intent intent) {


               if (status == 100) {
                   /*
                   When Status is 100 Open Zarinpal PG on Browser
                   */
                   startActivity(intent);
               } else {
                   Toast.makeText(getApplicationContext(), "Your Payment Failure :(", Toast.LENGTH_LONG).show();
               }

           }
       });

Example For Callback Handler:

        /**
        * When User Return to Application From IPG on Browser
        */
        Uri data = getIntent().getData();
       ZarinPal.getPurchase(this).verificationPayment(data, new OnCallbackVerificationPaymentListener() {
           @Override
           public void onCallbackResultVerificationPayment(boolean isPaymentSuccess, String refID, PaymentRequest paymentRequest) {


               if (isPaymentSuccess) {
                   /* When Payment Request is Success :) */
                   String message = "Your Payment is Success :) " + refID;
                   Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
               } else {
                   /* When Payment Request is Failure :) */
                   String message = "Your Payment is Failure :(";
                   Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
               }


           }
       });

New Options:

  • Support ZarinGate in 0.0.4 Version
  • Implemented SandBox Payment in 0.0.8 Version
  • ZarinGate is Optional attribute in 0.0.10 Version

Developed By

The Product developed by ZarinPal Team also You can Communicate and open issue

Note: This version is open source then you can open pull request and we check it, If project need to your change, We will certainly merge it.

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].