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
50 lines • 3 kB
TypeScript
import type { ApplePayConfig } from './apple_pay_config';
import { CreditCardConfig } from './credit_card_config';
import type { SamsungPayConfig } from './samsung_pay_config';
/**
Used by Moyasar API along with any of the supported sources.
*/
export declare class PaymentConfig {
givenId?: string | null;
publishableApiKey: string;
amount: number;
merchantCountryCode: string;
currency: string;
description: string;
metadata?: Record<string, string | number | boolean> | null;
supportedNetworks: string[];
applePay?: ApplePayConfig;
creditCard: CreditCardConfig;
createSaveOnlyToken: boolean;
samsungPay?: SamsungPayConfig;
/**
* Constructs a new PaymentConfig instance with the provided settings.
* @param givenId - Optional UUID for the payment (UUID v4 is recommended). It will be attached with the payment creation request to support idempotency. `It is going be the ID of the created payment`.
* @param publishableApiKey - Your Moyasar publishable API key - https://docs.moyasar.com/get-your-api-keys.
* @param amount - The amount to be charged in the smallest currency unit. For example, to charge `SAR 257.58` you will have the [amount] as `25758`. In other words, 10 SAR = 10 * 100 Halalas. Integer values only.
* @param merchantCountryCode - The country code of the merchant’s principle place of business. Defaults to 'SA'. Must be in ISO 3166-1 alpha-2 country code format.
* @param currency - The currency code for the payment. Defaults to 'SAR'. Must be in ISO 4217 3-letter currency code format.
* @param description - Can be any string you want to tag the payment. For example `Payment for Order #34321`.
* @param metadata - Adds searchable key/value pairs to the payment. For example `{"size": "xl"}`.
* @param supportedNetworks - Card networks supported for Apple Pay & Samsung Pay. Defaults to all available: ['mada', 'visa', 'mastercard', 'amex'].
* @param applePay - Required for Apple Pay feature.
* @param creditCard - Optional for Credit Card feature.
* @param createSaveOnlyToken - Optional to process a save only token flow for a Credit Card. Defaults to false - https://docs.moyasar.com/create-token
* @param samsungPay - Required for Samsung Pay feature.
*/
constructor({ givenId, publishableApiKey, amount, merchantCountryCode, currency, description, metadata, supportedNetworks, applePay, creditCard, createSaveOnlyToken, samsungPay, }: {
givenId?: string | null;
publishableApiKey: string;
amount: number;
merchantCountryCode?: string;
currency?: string;
description: string;
metadata?: Record<string, string | number | boolean> | null;
supportedNetworks?: string[];
applePay?: ApplePayConfig;
creditCard?: CreditCardConfig;
createSaveOnlyToken?: boolean;
samsungPay?: SamsungPayConfig;
});
}
//# sourceMappingURL=payment_config.d.ts.map