{"size": 1234, "ext": "js", "max_stars_repo_path": "src/RNPaymentSDKLibrary.js", "max_stars_repo_name": "KhaledAlramam/react-native-paytabs-library", "max_stars_repo_stars_event_min_datetime": "2020-01-14T07:29:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-16T19:35:10.000Z", "max_issues_repo_path": "src/RNPaymentSDKLibrary.js", "max_issues_repo_name": "KhaledAlramam/react-native-paytabs-library", "max_issues_repo_issues_event_min_datetime": "2020-01-29T12:20:36.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-06T12:15:30.000Z", "max_forks_repo_path": "src/RNPaymentSDKLibrary.js", "max_forks_repo_name": "KhaledAlramam/react-native-paytabs-library", "max_forks_repo_forks_event_min_datetime": "2019-12-28T13:12:34.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-09T07:19:39.000Z"}
{"max_stars_count": 11, "max_issues_count": 25, "max_forks_count": 15, "avg_line_length": 34.2777777778, "max_line_length": 84, "alphanum_fraction": 0.556726094}
import { NativeModules } from 'react-native';

export default class RNPaymentSDKLibrary {
    static startCardPayment(config) {
        return new Promise((resolver, reject) => {
            const RNPaymentManager = NativeModules.RNPaymentManager;
            RNPaymentManager.startCardPayment(config).then( result => {
                resolver(result); 
               }, function(error) {
                reject(error);
               });
        })
    };

    static startApplePayPayment(config) {
        return new Promise((resolver, reject) => {
            const RNPaymentManager = NativeModules.RNPaymentManager;
            RNPaymentManager.startApplePayPayment(config).then( result => {
                resolver(result); 
               }, function(error) {
                reject(error);
               });
        })
    };

    static startAlternativePaymentMethod(config) {
        return new Promise((resolver, reject) => {
            const RNPaymentManager = NativeModules.RNPaymentManager;
            RNPaymentManager.startAlternativePaymentMethod(config).then( result => {
                resolver(result); 
               }, function(error) {
                reject(error);
               });
        })
    };
}