react-native-moyasar-sdk
Version:
Official React Native Moyasar SDK - Integrate Credit Cards, Apple Pay, Samsung Pay, and STC Pay with simple interfaces for a seamless payment experience in your React Native app
36 lines (30 loc) • 1 kB
text/typescript
import type { HostComponent, ViewProps } from 'react-native';
import type {
DirectEventHandler,
Double,
} from 'react-native/Libraries/Types/CodegenTypes';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
export const SAMSUNG_PAY_BUTTON_COMPONENT_NAME = 'RTNSamsungPayButton';
export interface MerchantInfo {
serviceId: string;
merchantName: string;
merchantId: string;
merchantCountryCode: string;
amount: Double;
currency: string;
supportedNetworks: string[];
orderNumber?: string | null; // Must for VISA payments
/** Corner radius in DP unit */
buttonBorderRadius?: Double | null;
}
type SamsungPayPaymentResultEvent = {
result: string;
orderNumber: string;
};
export interface NativeProps extends ViewProps {
merchantInfo: MerchantInfo;
onPaymentResult: DirectEventHandler<SamsungPayPaymentResultEvent>;
}
export default codegenNativeComponent<NativeProps>(
'RTNSamsungPayButton'
) as HostComponent<NativeProps>;