Skip to content

Latest commit

 

History

History
69 lines (59 loc) · 1.56 KB

USAGE_3.X.md

File metadata and controls

69 lines (59 loc) · 1.56 KB

Usage

Package Version 3.x.x

Request One Time Payment

import {
  requestOneTimePayment,
} from "expo-braintree";

const result: BTPayPalAccountNonceResult | BTPayPalError  = await requestOneTimePayment({
        clientToken: 'Token",
        merchantAppLink: "https://braintree-example-app.web.app",
        amount: '5.0',
        currencyCode: 'USD'
    })

Card tokenization

import {
  tokenizeCard,
} from "expo-braintree";

const result: BTCardTokenizationNonceResult | BTPayPalError = await tokenizeCard({
        clientToken: 'Token",
        number: '1111222233334444',
        expirationMonth: '11',
        expirationYear: '24',
        cvv: '123',
        postalCode: '',
    })

Request PayPal billing agreement

import {
  requestBillingAgreement,
} from "expo-braintree";

const result: BTPayPalAccountNonceResult | BTPayPalError  = await requestBillingAgreement({
        clientToken: 'Token",
        merchantAppLink: "https://braintree-example-app.web.app",
    })
    .then(result => console.log(result))
    .catch((error) => console.log(error));

Call Data Collector and get correlation id

import {
  getDeviceDataFromDataCollector,
} from "expo-braintree";
const result: string = await getDeviceDataFromDataCollector(clientToken)

Get Venmo Nonce

import {
  requestVenmoNonce,
} from "expo-braintree";

const nonce = await requestVenmoNonce({
    clientToken,
    vault: BoolValue.true,
    paymentMethodUsage: BTVenmoPaymntMethodUsage.multiUse,
    totalAmount: '5',
});