Skip to content

stashgg/stash-native

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stash Pay for Android / iOS [Preview]

Standalone packages that enable Stash Pay checkout flows within native Android and iOS applications. They are adapted from the Stash Pay Unity plugin to work directly with native applications.

Warning

This repository is currently being actively built. Information may be incorrect or outdated. Please reach out to developers@stash.gg if you have any issues.

Warning

Stash primarily maintains the Unity version. Changes and patches may be propagated slowly to the standalone versions.

Platforms

Platform Readme Description
Android Android SDK Native Android library with Gradle support.
iOS iOS SDK Native iOS framework with Swift Package Manager support.

Quick Start

Android

// Initialize
StashPayCard stashPay = StashPayCard.getInstance();
stashPay.setActivity(this);

// Set up callbacks
stashPay.setListener(new StashPayCard.StashPayListenerAdapter() {
    @Override
    public void onPaymentSuccess() {
        // Handle success
    }
    
    @Override
    public void onPaymentFailure() {
        // Handle failure
    }
});

// Open checkout
stashPay.openCheckout("https://your-checkout-url.com");

iOS (Swift)

// Initialize
let stashPay = StashPayCard.sharedInstance()
stashPay.delegate = self

// Open checkout
stashPay.openCheckout(withURL: "https://your-checkout-url.com")
// Implement delegate
extension YourViewController: StashPayCardDelegate {
    func stashPayCardDidCompletePayment() {
        // Handle success
    }
    
    func stashPayCardDidFailPayment() {
        // Handle failure
    }
}

iOS (Objective-C)

// Initialize
StashPayCard *stashPay = [StashPayCard sharedInstance];
stashPay.delegate = self;

// Open checkout
[stashPay openCheckoutWithURL:@"https://your-checkout-url.com"];
// Implement delegate
- (void)stashPayCardDidCompletePayment {
    // Handle success
}

- (void)stashPayCardDidFailPayment {
    // Handle failure
}

Callbacks / Events

Event Description
Payment Success Called when the payment completes successfully
Payment Failure Called when the payment fails
Dialog Dismissed Called when the user dismisses the checkout UI
Page Loaded Called when the checkout page finishes loading (with load time)

Web-Based Checkout

If you need to use the system browser instead of the in-app card UI:

// Android - Use Chrome Custom Tabs
stashPay.setForceWebBasedCheckout(true);
// iOS - Use SFSafariViewController
stashPay.forceWebBasedCheckout = true

Sample Apps

Both platforms include sample apps demonstrating SDK integration:

  • Android: ./Android/sample/
  • iOS: ./iOS/Sample/

Versioning

This package follows Semantic Versioning (major.minor.patch):

  • Major: Breaking changes
  • Minor: New features (backward compatible)
  • Patch: Bug fixes

Support

About

📦 Stash Pay checkout plugin for native iOS/Android applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published