1.0.31 • Published 2 months ago
@tap-payments/apple-pay-rn v1.0.31
@tap-payments/apple-pay-rn
ReactNative wrapper for apple pay button
Installation
npm install @tap-payments/apple-pay-rn
cd ios && pod install
Configure SDK Example
enum SdkMode {
production,
sandbox,
}
enum AllowedCardNetworks {
VISA = 'VISA',
AMEX = 'AMEX',
JCB = 'JCB',
MADA = 'MADA',
}
enum MerchantCapabilities {
threeDSecure,
credit,
debit,
}
ApplePayConfig = {
sandboxKey: string;
productionKey: string;
countryCode: string;
transactionCurrency: TapCurrencyCode;
allowedCardNetworks: AllowedCardNetworks[];
environmentMode: SdkMode;
merchantId: string;
amount: number;
merchantCapabilities: MerchantCapabilities[];
};
Usage
const init = useCallback(async () => {
try {
const config = {
sandboxKey: 'pk_test_xxxxxxxxxxxxxxxxxxx', // public key
productionKey: 'pk_test_xxxxxxxxxxxxxxxxxxx', // public key
countryCode: 'US',
transactionCurrency: TapCurrencyCode.USD,
allowedCardNetworks: [AllowedCardNetworks.VISA],
environmentMode: SdkMode.sandbox,
merchantId: 'xxxxxxx',
amount: 23,
merchantCapabilities: [
MerchantCapabilities.threeDSecure,
MerchantCapabilities.credit,
MerchantCapabilities.debit,
],
};
let res: AppleToken = await getApplePayToken(config);
// let res: TapToken = await getTapToken(config);
console.log("🚀", JSON.stringify(res))
} catch (error) {
console.log("🚀", JSON.stringify(error))
}
}, []);
enum ApplePayButtonType {
appleLogoOnly,
buyWithApplePa,
setupApplePay,
payWithApplePa,
donateWithApplePay,
checkoutWithApplePay,
bookWithApplePay,
subscribeWithApplePay,
}
enum ApplePayButtonStyle {
Black,
White,
WhiteOutline,
Auto,
}
<ApplePay
style={styles.button}
onPress={init}
buttonStyle={ApplePayButtonStyle.Black}
buttonType={ApplePayButtonType.appleLogoOnly}
/>
1.0.31
2 months ago
1.0.30
5 months ago
1.0.29
5 months ago
1.0.28
6 months ago
1.0.27
7 months ago
1.0.26
8 months ago
0.1.8
10 months ago
0.1.7
1 year ago
0.1.6
1 year ago
0.1.5
1 year ago
0.1.4
1 year ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.1-alpha.1
2 years ago
0.1.3
2 years ago
0.1.1-alpha.0
2 years ago
0.1.0
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago