├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .npmignore ├── .prettierrc.js ├── Example ├── .buckconfig ├── .watchmanconfig ├── ApplePayGpay.tsx ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ │ └── xml │ │ │ │ └── network_security_config.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── cloudipsp │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ ├── debug.keystore.properties │ │ └── release.keystore │ └── settings.gradle ├── babel.config.js ├── index.tsx ├── ios │ ├── .xcode.env │ ├── Podfile │ ├── Podfile.lock │ ├── RNCloudipspSdkExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── RNCloudipspSdkExample.xcscheme │ ├── RNCloudipspSdkExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── RNCloudipspSdkExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── RNCloudipspSdkExample.entitlements │ │ └── main.m ├── metro.config.js ├── package.json └── tsconfig.json ├── RNCloudipsp.podspec ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── cloudipsp │ └── rn │ ├── RNCloudipspModule.java │ └── RNCloudipspPackage.java ├── ios ├── RNCloudipsp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── RNCloudipsp.xcscheme └── RNCloudipsp │ ├── RNCloudipsp.h │ └── RNCloudipsp.m ├── package.json ├── src ├── CardFieldBase.tsx ├── CardFieldCvv.ts ├── CardFieldExpMm.ts ├── CardFieldExpYy.ts ├── CardFieldNumber.ts ├── CardInput.tsx ├── CardLayout.tsx ├── Cloudipsp.ts ├── CloudipspWebview.tsx ├── CvvUtils.ts ├── Native.ts ├── index.ts └── models │ ├── Card.ts │ ├── Currency.ts │ ├── Failure.ts │ ├── Lang.ts │ ├── Order.ts │ ├── Receipt.ts │ ├── Verification.ts │ ├── index.ts │ └── req.ts └── tsconfig.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | 37 | # BUCK 38 | buck-out/ 39 | \.buckd/ 40 | android/app/libs 41 | android/keystores/debug.keystore 42 | 43 | Example/ios/Pods 44 | package-lock.json 45 | dist/ 46 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | .DS_Store 3 | 4 | # node.js 5 | node_modules/ 6 | npm-debug.log 7 | 8 | # Xcode 9 | build/ 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | *.xcworkspace 19 | !default.xcworkspace 20 | xcuserdata 21 | profile 22 | *.moved-aside 23 | DerivedData 24 | .idea/ 25 | 26 | # Pods 27 | Pods 28 | 29 | 30 | ./.deco 31 | ./Example 32 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /Example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/ApplePayGpay.tsx: -------------------------------------------------------------------------------- 1 | import React, {useState, useEffect, useRef} from 'react'; 2 | import {View, Button, Alert, Platform, SafeAreaView} from 'react-native'; 3 | import {Order, Cloudipsp, CloudipspWebView} from 'react-native-cloudipsp'; 4 | 5 | // Merchant ID for payment processing 6 | const Merchant = 1396424; 7 | 8 | const ApplePayGpay = () => { 9 | // State to manage the visibility of the WebView 10 | const [webView, setWebView] = useState(0); 11 | 12 | // Reference to the Cloudipsp WebView component 13 | const _cloudipspWebViewRef = useRef(null); 14 | 15 | // State to manage if the device supports Apple Pay or Google Pay 16 | const [supportedPayments, setSupportedPayments] = useState({ 17 | applePay:false, 18 | googlePay:false 19 | }); 20 | 21 | // Function to check if the device supports Apple Pay or Google Pay 22 | const isSupportingAppleOrGPay = async () => { 23 | const isIOS = Platform.OS === 'ios'; 24 | 25 | // Check for Apple Pay support on iOS devices 26 | if (isIOS) { 27 | const supportsApplePay = await Cloudipsp.supportsApplePay(); 28 | if (supportsApplePay) { 29 | setSupportedPayments({ ...supportedPayments,applePay:true }); 30 | return; 31 | } 32 | Alert.alert('Apple Pay is not supported on this device'); 33 | } 34 | 35 | // Check for Google Pay support on Android devices 36 | const supportsGooglePay = await Cloudipsp.supportsGooglePay(); 37 | if (supportsGooglePay) { 38 | setSupportedPayments( { ...supportedPayments, googlePay: true } ); 39 | return; 40 | } 41 | Alert.alert('Google Pay is not supported on this device'); 42 | }; 43 | 44 | // useEffect to run the payment support check when the component mounts 45 | useEffect(() => { 46 | isSupportingAppleOrGPay(); 47 | }, []); 48 | 49 | // Function to initialize the Cloudipsp instance with the Merchant ID 50 | const _cloudipsp = (): Cloudipsp => { 51 | return new Cloudipsp(Merchant, (payConfirmator) => { 52 | setWebView(1); // Show the WebView for payment confirmation 53 | return payConfirmator(_cloudipspWebViewRef.current!); 54 | }); 55 | }; 56 | 57 | // Function to handle the Google Pay button press 58 | const handleGooglePayPress = async () => { 59 | 60 | const cloudipsp = _cloudipsp(); // Initialize the payment process with the merchant ID 61 | 62 | const order = new Order( // Create an order object 63 | 10, // Amount 64 | 'GEL', // Currency 65 | 'rn_' + Math.random(), // Unique order ID 66 | 'test payment', // Description 67 | 'test@gmail.com' // Customer email 68 | ); 69 | 70 | try { 71 | // Process the Google Pay transaction and return the receipt 72 | const receipt = await cloudipsp.googlePay(order); 73 | setWebView(0); // Hide the WebView after payment processing 74 | console.log('Payment successful:', receipt); 75 | } catch (error) { 76 | // Handle payment errors 77 | console.error('Payment error:', error); 78 | } 79 | }; 80 | 81 | 82 | 83 | // Function to handle the Google Pay button press 84 | const handleGooglePayPressWithToken = async () => { 85 | 86 | const cloudipsp = _cloudipsp(); // Initialize the payment process with the merchant ID 87 | 88 | try { 89 | // Process the Google Pay transaction and return the receipt 90 | const receipt = await cloudipsp.googlePayToken('59e582f09c17acad57ff2388b96ad775d44d8db4'); 91 | setWebView(0); // Hide the WebView after payment processing 92 | console.log('Payment successful:', receipt); 93 | } catch (error) { 94 | // Handle payment errors 95 | console.error('Payment error:', error); 96 | } 97 | }; 98 | 99 | // Function to handle the Apple Pay button press 100 | const handleApplePayPress = async () => { 101 | const cloudipsp = _cloudipsp(); // Initialize the payment process with the merchant ID 102 | const order = new Order( // Create an order object 103 | 100, // Amount 104 | 'GEL', // Currency 105 | 'rn_' + Math.random(), // Unique order ID 106 | 'test payment', // Description 107 | 'test@gmail.com' // Customer email 108 | ); 109 | 110 | try { 111 | // Process the Apple Pay transaction and return the receipt 112 | const receipt = await cloudipsp.applePay(order); 113 | console.log('Payment successful:', receipt); 114 | } catch (error) { 115 | // Handle payment errors 116 | console.error('Payment error:', error); 117 | } 118 | }; 119 | 120 | // Render the WebView if webView state is true 121 | if (webView) { 122 | return 123 | 124 | 125 | } 126 | 127 | // Render the main view with the Google Pay button if payment is supported 128 | return ( 129 | 130 | {supportedPayments.googlePay && ( 131 |