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

react-native-tamara-sdk

v1.0.8

Published

Tamara React Native SDK

Downloads

650

Readme

React Native SDK

Setup SDK

Install

  • run command line TamaraSDK Module: #Case use sdk from local:
  • npm install + npm run example
  • cd example + npm start ================================== #Case use sdk from link npmjs: Add dependencies "react-native-webview":"version" -> package.json in example project
  • npm install
  • cd example + npm install + npm start ==================================

How to use it

Include function:

  • Init: Initialize before using it:
TamaraPayment.initialize(AUTH_TOKEN, API_URL, NOTIFICATION_WEB_HOOK_URL, PUBLISH_KEY, NOTIFICATION_TOKEN, isSandbox)

Create and pay order

Before adding order's information, create Order by call this method with referenceOrderId and description. RefId is your unique id of your order.

TamaraPayment.createOrder(referenceOrderId, description)

These informations are mandatory:

Set customer's information:

TamaraPayment.setCustomerInfo(firstName, lastName,
            phoneNumber, email, isFirstOrder)

Example: import { setCustomerInfo} from 'react-native-tamara-sdk' setCustomerInfo(textInputFirstName, textInputLastName, textInputPhone, textInputEmail, isChecked);


Set payment type (optional: default: PAY_BY_INSTALMENTS):

TamaraPayment.setPaymentType(paymentType)

Example:
import { setPaymentType} from 'react-native-tamara-sdk'
setPaymentType("PAY_BY_INSTALMENTS");

Add Item with its price, tax and discount:

TamaraPayment.addItem(name, referenceId ,sku, type, unitPrice,
                    taxAmount ,discountAmount, quantity)

Set shipping address and billing address:

TamaraPayment.setShippingAddress(firstName,lastName, phone,
                    addressLine1, addressLine2, country, region, city)
TamaraPayment.setBillingAddress(firstName,lastName, phone,
                    addressLine1, addressLine2, country, region, city)

Set shipping fee:

TamaraPayment.setShippingAmount(shippingFee)

Set discount (optional):

TamaraPayment.setDiscount(discount, name)

Set instalments:

TamaraPayment.setInstalments(instalments)

Set platform: import { setPlatform } from 'react-native-tamara-sdk' setPlatform("Android");//IOS


Set locale:

TamaraPayment.setLocale(locale)


Set order number:

TamaraPayment.setOrderNumber(orderNumber)


Set expires in minutes:

TamaraPayment.setExpiresInMinutes(expiresInMinutes)


Set risk assessment:

TamaraPayment.setRiskAssessment(jsonData)

Example:
import {setRiskAssessment} from 'react-native-tamara-sdk'
let result = await setRiskAssessment(jsonData); // return value true or false
if (result) {
  //json ok
}

Set additional data:

TamaraPayment.setAdditionalData(jsonData)

Add Custom Fields AdditionalData: Example val jsonData = "{"custom_field1": 42, "custom_field2": "value2" }"

TamaraPayment.addCustomFieldsAdditionalData(jsonData)

Example: import { addCustomFieldsAdditionalData } from 'react-native-tamara-sdk' addCustomFieldsAdditionalData("{"custom_field1": 42, "custom_field2": "value2" }");


Processes to Tamara payment page using:

TamaraPayment.paymentOrder()

Example: 
import {paymentOrder} from 'react-native-tamara-sdk';
const jsonString = await paymentOrder();
const result = JSON.parse(jsonString);

Order detail

Get order detail param mandatory: orderId

TamaraPayment.getOrderDetail(orderId)

Example: Import function

import { orderDetail } from 'react-native-tamara-sdk'

After get response json string and parse to json

const result = await orderDetail(orderId);
const data = JSON.parse(result)

Authorise order

Authorise order by call this method with orderId. param mandatory: orderId

TamaraPayment.authoriseOrder(orderId)

Example: Import function

import { authoriseOrder } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result = await authoriseOrder(orderId)
const data = JSON.parse(result)

Cancel order

Note: Need call authorise order method before call cancel order Cancel order reference by call this method with orderId and jsonData.

param mandatory: orderId jsonData: use library convert class CancelOrderRequest to json (Gson)

TamaraPayment.cancelOrder(orderId, jsonData)

Example: Import function

import { cancelOrder } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result = await cancelOrder(JSON.stringify(jsonData))
const data = JSON.parse(result)

Update order reference

Update order reference by call this method with orderId and orderReference.

param mandatory: orderId, orderReference

TamaraPayment.updateOrderReference(orderId, orderReference)

Example: Import function

import { updateOrderReference } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result = await updateOrderReference(orderId, orderReference)
const data = JSON.parse(result)

Capture a payment

Note: Need call authorise order method before call capture a payment Cancel order reference by call this method with orderId and jsonData.

param mandatory: orderId jsonData: use library convert class Capture to json (Gson)

TamaraPayment.getCapturePayment(jsonData)

Example: Import function

import { capturePayment } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result = await capturePayment(JSON.stringify(jsonData))
const data = JSON.parse(result)

Refunds

Cancel order reference by call this method with orderId and jsonData. Note: Need call authorise order method before call Refunds

param mandatory: orderId jsonData: use library convert class Refund to json (Gson)

TamaraPayment.refunds(orderId, jsonData)

Example: Import function

import { refunds } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result =  await refunds(orderId, jsonData)
const data = JSON.parse(result)

Render widget cart page

Render widget cart page reference by call this method with language, country, publicKey, amount. param mandatory: language, country, publicKey, amount

TamaraPayment.renderWidgetCartPage(language, country, publicKey, amount)

Example: Import function

import { renderCartPage } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result =  await renderCartPage(language, country, publicKey, amount)
const data = JSON.parse(result)

Render widget product

Render widget cart page reference by call this method with language, country, publicKey, amount. param mandatory: language, country, publicKey, amount

TamaraPayment.renderWidgetProduct(language, country, publicKey, amount)

Example: Import function

import { renderProduct } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result =  await renderProduct(language, country, publicKey, amount)
const data = JSON.parse(result)

Check payment options available

Check payment option by call this method with orderId and jsonData. jsonData: use library convert class PaymentOptions to json (Gson)

TamaraPayment.paymentOptions(jsonData)

Example: Import function

import { checkPaymentOptions } from 'react-native-tamara-sdk'

Get response json string and parse to json

const result = await await checkPaymentOptions(JSON.stringify(jsonData))
const data = JSON.parse(result)

Checkout URL

Checkout URL is a component and displays when passed in the url. Example: Import component

import { TamaraCheckoutURL } from 'react-native-tamara-sdk'

Use component

<TamaraCheckoutURL
    checkoutURL={checkout_url}
    successURL={success_url}
    failURL={fail_url}
    cancelURL={cancel_url}
    onSuccess={handleSuccess}
    onFail={handleFail}
    onCancel={handleCancel}
/>