Skip to content

RazerMS/RazerMSGooglePayPlugin

Repository files navigation

banner RMSxGooglePay

[Mobile Plugin] - RazerMS Google Pay Plugin

This is the complete and functional Razer Merchant Services Google Pay Plugin payment module that is ready to be implemented into Android Studio application project through Maven framework.

Recommended configurations

- Android Studio Flamingo | 2022.2.1 Patch 2

- Minimum target version: Android 5.0 - API Level 21

Installation Guidance

Installation

Maven

Maven primarily aids in the download of dependencies, which are libraries or JAR files, for Java-based applications. For usage and installation instructions, visit their website. To integrate RazerMS Google Pay Plugin into your Android Studio project using CocoaPods, specify it in your file:

In file settings.gradle

    pluginManagement {
        repositories {
            ...
            mavenCentral()
        }
    }
    dependencyResolutionManagement {
        ...
        repositories {
            ...
            mavenCentral()
            maven { url 'https://jitpack.io' }
        }
    }
    rootProject.name = "Application Name"
    include ':app'

 In file build.gradle under app folder

    plugins {
        id 'com.android.application'
    }

    android {
        ...

        defaultConfig {
            ...
            minSdk 21
            ...
        }
        ...
    }

    dependencies {
        ...
        implementation 'com.github.RazerMS:RazerMSGooglePayPlugin:1.0.3'

        implementation "com.google.android.gms:play-services-pay:16.1.0"
        implementation "com.google.android.gms:play-services-wallet:19.2.0-beta01"
        implementation 'androidx.appcompat:appcompat:1.5.1'
        implementation 'com.google.android.material:material:1.6.1'
        implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
        implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.1"
        implementation 'org.apache.commons:commons-lang3:3.4'
        implementation 'com.google.zxing:core:3.5.0'
        ...

    }

Quick Guide

Demo App Link : https://github.com/RazerMS/RazerMSGooglePayPlugin/tree/demo-app

Refer to the Demo App for easy integration guidance.

All these 5 classes are compulsory to be created in your app :
1) CheckoutActivity
2) CheckoutSuccessActivity
3) PaymentsUtil
4) CheckoutViewModel
5) Constants

Create your own classes based on your app preferences.
Refer Demo App res folder for necessary resources guidance.

Payment results

=========================================
Sample transaction result in JSON string:
=========================================

{
    amount = "1.10";
    appcode = 179367;
    channel = CREDIT;
    currency = MYR;
    domain = "merchant_Dev";
    orderid = order54;
    paydate = "2022-09-22 17:49:08";
    skey = 54XXXXXXXXXXXXXXXXXXXXXXXXXXd;
    status = 00;
    tranID = 1278569348;
    xdkHTMLRedirection = "xxxxxxxxxx";
};

Parameter and meaning:

"status_code" - "00" for Success, "11" for Failed, "22" for *Pending. 

"amount" - The transaction amount
"paydate" - The transaction date
"order_id" - The transaction order id
"channel" - The transaction channel description
"txn_ID" - The transaction id generated by MOLPay

* Notes: You may ignore other parameters and values not stated above

=====================================
* Sample error result in JSON string:
=====================================

{
    "error_code" = A01;
    "error_desc" = "Fail to detokenize Google Pay Token given";
    status = 0;
}

Parameter and meaning:

"Fail to detokenize Google Pay Token given" - Error starting a payment process due to several possible reasons, please contact Razer Merchant Services support should the error persists.
1) Misconfigure GooglePay setup
2) API credentials (username, password, merchant id, verify key)
3) Razer Merchant Services server offline.

Resources

Support

Submit issue to this repository or email to our [email protected]

Merchant Technical Support / Customer Care : [email protected]
Sales/Reseller Enquiry : sales-sa@razer
Marketing Campaign : marketing-sa@razer
Channel/Partner Enquiry : channel-sa@razer
Media Contact : [email protected]
R&D and Tech-related Suggestion : [email protected]
Abuse Reporting : [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages