npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gif-games/capacitor-samsung-iap

v1.1.0

Published

Capacitor plugin for Samsung IAP Android SDK

Downloads

2

Readme

@gif-games/capacitor-samsung-iap

Capacitor plugin for Samsung IAP Android SDK

Install

npm install @gif-games/capacitor-samsung-iap
npx cap sync

Include sub dependencies

Add this to your app's settings.gradle

include ':IAP6Helper'
project(':IAP6Helper').projectDir = new File('../node_modules/@gif-games/capacitor-samsung-iap/android/IAP6Helper')

API

setOperationMode(...)

setOperationMode(options: SetOperationModeOptions) => Promise<void>

IAP supports three operational modes. One is for enabling billing for item purchases and the other two are for testing IAP functions without billing app users for item purchases.

| Param | Type | | ------------- | --------------------------------------------------------------------------- | | options | SetOperationModeOptions |


getOwnedList(...)

getOwnedList(options: GetOwnedListOptions) => Promise<OwnedList>

returns a list of in-app items that the app user currently has from previous purchases:

  • Consumable items that have not yet been used and not yet reported as consumed
  • Non-consumable items
  • Subscription items currently in a free trial or an active subscription period (this includes canceled subscription items until their active subscription period has ended)

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | GetOwnedListOptions |

Returns: Promise<OwnedList>


getProductsDetails(...)

getProductsDetails(options: GetProductsDetailsOptions) => Promise<ProductList>

returns information for one, more, or all in-app items registered to the app.

| Param | Type | | ------------- | ------------------------------------------------------------------------------- | | options | GetProductsDetailsOptions |

Returns: Promise<ProductList>


startPayment(...)

startPayment(options: StartPaymentOptions) => Promise<PurchaseVo>

initiates the purchase and payment transaction of the specified in-app item and can notify the end user if the purchase succeeded or failed.

| Param | Type | | ------------- | ------------------------------------------------------------------- | | options | StartPaymentOptions |

Returns: Promise<PurchaseVo>


consumePurchasedItems(...)

consumePurchasedItems(options: ConsumePurchasedItemsOptions) => Promise<ConsumeList>

reports one or more purchased consumable items as consumed, which makes the items available for another purchase.

| Param | Type | | ------------- | ------------------------------------------------------------------------------------- | | options | ConsumePurchasedItemsOptions |

Returns: Promise<ConsumeList>


Interfaces

SetOperationModeOptions

| Prop | Type | Description | | ---------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | mode | 'production' | 'test' | 'test_fail' | - production : startPayment() requests are processed as specified, financial transactions do occur for successful requests, and actual results are returned (successful or failed). Note: For all other IAP Helper requests: Only items purchased in OPERATION_MODE_PRODUCTION mode are considered owned items. - test : startPayment() requests are processed as specified, except financial transactions do not occur (licensed testers are not billed for item purchases), and successful results are always returned. For details of the payment window shown in OPERATION_MODE_TEST mode, see below. Note: For all other IAP Helper requests: - Only items purchased in OPERATION_MODE_TEST mode are considered owned items. - In order to purchase in-app items, testers must be registered as a License Tester in the seller's Seller Portal profile. In this mode, licensed testers always get your in-app items for free. All other users see an error message if they try to purchase an in-app item. - test_fail : All IAP Helper requests fail. It is meant to be a negative testing to ensure that your app can handle errors such as improper input and user actions. |

OwnedList

| Prop | Type | | ---------- | ----------------------------- | | data | OwnedProductVo[] |

OwnedProductVo

| Prop | Type | | -------------------------- | ------------------- | | mPaymentId | string | | mPurchaseId | string | | mPurchaseDate | string | | mPassThroughParam | string | | mSubscriptionEndDate | string |

GetOwnedListOptions

| Prop | Type | Description | | ----------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | productType | 'item' | 'subscription' | 'all' | (Required) Type of in-app items to be returned: - item : Both consumable and non-consumable items - subscription : Auto-recurring subscription items - all : Consumable, non-consumable, and auto-recurring subscription items |

ProductList

| Prop | Type | | ---------- | ------------------------ | | data | ProductVo[] |

ProductVo

| Prop | Type | | ------------------------------------------- | ------------------- | | mItemImageUrl | string | | mItemDownloadUrl | string | | mReserved1 | string | | mReserved2 | string | | mFreeTrialPeriod | string | | mSubscriptionDurationUnit | string | | mSubscriptionDurationMultiplier | string | | mTieredSubscriptionYN | string | | mTieredPrice | string | | mTieredPriceString | string | | mTieredSubscriptionCount | string | | mTieredSubscriptionDurationMultiplier | string | | mTieredSubscriptionDurationUnit | string | | mShowStartDate | number | | mShowEndDate | number |

GetProductsDetailsOptions

| Prop | Type | Description | | ---------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | productIds | string[] | (Required) One or more in-app item IDs specified by either: Empty array [] that designates all in-app items or One or more unique in-app item ID values You can get the IDs from Seller Portal (Applications page > Click status of the app > In App Purchase tab > Item ID). |

PurchaseVo

| Prop | Type | | ----------------------- | ------------------- | | mPaymentId | string | | mPurchaseId | string | | mPurchaseDate | string | | mVerifyUrl | string | | mPassThroughParam | string | | mItemImageUrl | string | | mItemDownloadUrl | string | | mReserved1 | string | | mReserved2 | string | | mOrderId | string | | mUdpSignature | string |

StartPaymentOptions

| Prop | Type | Description | | ---------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | itemId | string | (Required) Unique identifier value of the in-app item to be purchased. | | passThroughParam | string | Optional Unique identifier (maximum: 255 bytes) assigned by your Android app to the purchase and payment transaction. When specified, the value will be returned by OnPaymentListener interface. When the iap/v6/receipt is called from the Samsung IAP Server API to verify a purchase, the value will be returned by the pathThroughParam field. |

ConsumeList

| Prop | Type | | ---------- | ------------------------ | | data | ConsumeVo[] |

ConsumeVo

| Prop | Type | | ------------------- | ------------------- | | mPurchaseId | string | | mStatusString | string | | mStatusCode | number |

ConsumePurchasedItemsOptions

| Prop | Type | Description | | ----------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | purchaseIds | string[] | (Required) One or more unique identifier values of the purchase and payment transactions of consumable in-app items that are to be reported as consumed |