Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions dist/FlutterwaveButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ var FlutterwaveButton = function FlutterwaveButton(_a) {
var style = _a.style, alignLeft = _a.alignLeft, children = _a.children, disabled = _a.disabled, onPress = _a.onPress;
// render primary button
return (<TouchableHighlight underlayColor={colors.primaryLight} disabled={disabled} onPress={onPress} style={[
styles.button,
disabled ? styles.buttonBusy : {},
alignLeft ? styles.buttonAlignLeft : {},
style
]} activeOpacity={1} testID='flw-button'>
styles.button,
disabled ? styles.buttonBusy : {},
alignLeft ? styles.buttonAlignLeft : {},
style
]} activeOpacity={1} testID='flw-button'>
<>
{children ? children : (<Image source={pryContent} resizeMode="contain" resizeMethod="resize" style={styles.buttonContent} fadeDuration={0}/>)}
{disabled
? (<View style={styles.buttonBusyOvelay}/>)
: null}
? (<View style={styles.buttonBusyOvelay}/>)
: null}
</>
</TouchableHighlight>);
};
Expand All @@ -28,13 +28,13 @@ var styles = StyleSheet.create({
top: 0,
bottom: 0,
right: 0,
backgroundColor: 'rgba(255, 255, 255, 0.6)'
backgroundColor: 'rgba(255, 255, 255, 0.6)',
},
buttonBusy: {
borderColor: colors.primaryLight
borderColor: colors.primaryLight,
},
buttonAlignLeft: {
justifyContent: 'flex-start'
justifyContent: 'flex-start',
},
button: {
paddingHorizontal: 16,
Expand All @@ -47,13 +47,13 @@ var styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'row',
overflow: 'hidden'
overflow: 'hidden',
},
buttonContent: {
resizeMode: 'contain',
width: 187.3,
height: 187.3 / contentSizeDimension
}
},
});
// export component as default
export default FlutterwaveButton;
50 changes: 25 additions & 25 deletions dist/FlutterwaveCheckout.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ var FlutterwaveCheckout = function FlutterwaveCheckout(props) {
Animated.timing(animation.current, {
toValue: 1,
duration: 700,
easing: Easing["in"](Easing.elastic(0.72)),
useNativeDriver: false
easing: Easing.in(Easing.elastic(0.72)),
useNativeDriver: false,
}).start();
}, []);
var animateOut = React.useCallback(function () {
return new Promise(function (resolve) {
Animated.timing(animation.current, {
toValue: 0,
duration: 400,
useNativeDriver: false
useNativeDriver: false,
}).start(function () {
setShow(false);
resolve();
Expand All @@ -61,7 +61,7 @@ var FlutterwaveCheckout = function FlutterwaveCheckout(props) {
{
text: 'Yes, Cancel',
style: 'destructive',
onPress: function () { return handleAbort(true); }
onPress: function () { return handleAbort(true); },
},
]);
return;
Expand Down Expand Up @@ -99,21 +99,21 @@ var FlutterwaveCheckout = function FlutterwaveCheckout(props) {
}, [doAnimate]);
var marginTop = animation.current.interpolate({
inputRange: [0, 1],
outputRange: [windowHeight, 0]
outputRange: [windowHeight, 0],
});
var opacity = animation.current.interpolate({
inputRange: [0, 0.3, 1],
outputRange: [0, 1, 1]
outputRange: [0, 1, 1],
});
return (<Modal transparent={true} animated={false} hardwareAccelerated={false} visible={show}>
<FlutterwaveCheckoutBackdrop onPress={function () { return handleAbort(); }} animation={animation.current}/>
<Animated.View style={[
styles.webviewContainer,
{
marginTop: marginTop,
opacity: opacity
}
]} testID='flw-checkout-dialog'>
styles.webviewContainer,
{
marginTop: marginTop,
opacity: opacity
}
]} testID='flw-checkout-dialog'>
<WebView ref={webviewRef} source={{ uri: link || '' }} style={styles.webview} startInLoadingState={true} scalesPageToFit={true} javaScriptEnabled={true} onShouldStartLoadWithRequest={handleNavigationStateChange} renderError={function () { return <FlutterwaveCheckoutError hasLink={!!link} onTryAgain={handleReload}/>; }} renderLoading={function () { return <FlutterwaveCheckoutLoader />; }}/>
</Animated.View>
</Modal>);
Expand All @@ -123,7 +123,7 @@ var FlutterwaveCheckoutBackdrop = function FlutterwaveCheckoutBackdrop(_a) {
// Interpolation backdrop animation
var backgroundColor = animation.interpolate({
inputRange: [0, 0.3, 1],
outputRange: [colors.transparent, colors.transparent, 'rgba(0,0,0,0.5)']
outputRange: [colors.transparent, colors.transparent, 'rgba(0,0,0,0.5)'],
});
return (<TouchableWithoutFeedback testID='flw-checkout-backdrop' onPress={onPress}>
<Animated.View style={Object.assign({}, styles.backdrop, { backgroundColor: backgroundColor })}/>
Expand Down Expand Up @@ -153,17 +153,17 @@ var styles = StyleSheet.create({
errorActionButtonText: {
textAlign: 'center',
color: colors.primary,
fontSize: 16
fontSize: 16,
},
errorActionButton: {
paddingHorizontal: 16,
paddingVertical: 16
paddingVertical: 16,
},
errorText: {
color: colors.secondary,
textAlign: 'center',
marginBottom: 32,
fontSize: 18
fontSize: 18,
},
error: {
position: 'absolute',
Expand All @@ -174,19 +174,19 @@ var styles = StyleSheet.create({
backgroundColor: '#ffffff',
justifyContent: 'center',
alignItems: 'center',
paddingHorizontal: 56
paddingHorizontal: 56,
},
backdrop: {
position: 'absolute',
left: 0,
right: 0,
bottom: 0,
top: 0
top: 0,
},
loadingImage: {
width: 64,
height: 64,
resizeMode: 'contain'
resizeMode: 'contain',
},
loading: {
position: 'absolute',
Expand All @@ -196,20 +196,20 @@ var styles = StyleSheet.create({
left: 0,
backgroundColor: 'rgba(255, 255, 255, 0.3)',
justifyContent: 'center',
alignItems: 'center'
alignItems: 'center',
},
webviewContainer: {
top: Platform.select({ ios: 96, android: 64 }),
top: Platform.select({ ios: 96, android: 64 }), // status bar height aware for ios
flex: 1,
backgroundColor: '#efefef',
paddingBottom: Platform.select({ ios: 96, android: 64 }),
paddingBottom: Platform.select({ ios: 96, android: 64 }), // status bar height aware for ios
overflow: 'hidden',
borderTopLeftRadius: windowHeight * borderRadiusDimension,
borderTopRightRadius: windowHeight * borderRadiusDimension
borderTopRightRadius: windowHeight * borderRadiusDimension,
},
webview: {
flex: 1,
backgroundColor: 'rgba(0,0,0,0)'
}
backgroundColor: 'rgba(0,0,0,0)',
},
});
export default FlutterwaveCheckout;
5 changes: 2 additions & 3 deletions dist/FlutterwaveInit.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="react-native" />
export declare type Currency = 'AUD' | 'BIF' | 'CDF' | 'CAD' | 'CVE' | 'EUR' | 'GBP' | 'GHS' | 'GMD' | 'GNF' | 'KES' | 'LRD' | 'MWK' | 'MZN' | 'NGN' | 'RWF' | 'SLL' | 'STD' | 'TZS' | 'UGX' | 'USD' | 'XAF' | 'XOF' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWD';
export type Currency = 'AED' | 'ALL' | 'ARS' | 'AUD' | 'BGN' | 'BHD' | 'BIF' | 'BND' | 'BRL' | 'BWP' | 'CAD' | 'CDF' | 'CFA' | 'CHF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ETB' | 'EUR' | 'GBP' | 'GHS' | 'GMD' | 'GNF' | 'GTQ' | 'HKD' | 'HNL' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'ISK' | 'JOD' | 'JPY' | 'KES' | 'KHR' | 'KMF' | 'KRW' | 'KWD' | 'LBP' | 'LKR' | 'LRD' | 'LYD' | 'MAD' | 'MOP' | 'MUR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NGN' | 'NOK' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PHP' | 'PLN' | 'PYG' | 'QAR' | 'RUB' | 'RWF' | 'SAR' | 'SDD' | 'SEK' | 'SGD' | 'SLL' | 'STD' | 'SVC' | 'SYP' | 'THB' | 'TND' | 'TRY' | 'TWD' | 'TZS' | 'UGX' | 'USD' | 'UYI' | 'VEF' | 'VND' | 'VUV' | 'XAF' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWD';
export interface FlutterwaveInitSubAccount {
id: string;
transaction_split_ratio?: number;
Expand Down Expand Up @@ -28,7 +27,7 @@ export interface FlutterwaveInitCustomizations {
logo?: string;
description?: string;
}
export declare type FlutterwaveInitOptions = FlutterwaveInitOptionsBase & {
export type FlutterwaveInitOptions = FlutterwaveInitOptionsBase & {
authorization: string;
tx_ref: string;
customer: FlutterwaveInitCustomer;
Expand Down
2 changes: 1 addition & 1 deletion dist/FlutterwaveInit.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions dist/FlutterwaveInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
Expand Down Expand Up @@ -57,19 +57,19 @@ import { STANDARD_URL } from './configs';
*/
export default function FlutterwaveInit(options, abortController) {
return __awaiter(this, void 0, void 0, function () {
var authorization, body, headers, fetchOptions, response, responseData, _a, _b, e_1, error;
var authorization, body, headers, fetchOptions, response, responseData, _a, _b, e_1, errorObject, error;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
_c.trys.push([0, 4, , 5]);
authorization = options.authorization, body = __rest(options, ["authorization"]);
headers = new Headers;
headers.append('Content-Type', 'application/json');
headers.append('Authorization', "Bearer " + authorization);
headers.append('Authorization', "Bearer ".concat(authorization));
fetchOptions = {
method: 'POST',
body: JSON.stringify(body),
headers: headers
headers: headers,
};
// add abortController if defined
if (abortController) {
Expand All @@ -89,9 +89,10 @@ export default function FlutterwaveInit(options, abortController) {
return [2 /*return*/, _b.apply(_a, [_c.sent()])];
case 4:
e_1 = _c.sent();
errorObject = e_1;
error = e_1 instanceof FlutterwaveInitError
? e_1
: new FlutterwaveInitError({ message: e_1.message, code: e_1.name.toUpperCase() });
? errorObject
: new FlutterwaveInitError({ message: errorObject.message, code: errorObject.name.toUpperCase() });
// resolve with error
return [2 /*return*/, Promise.reject(error)];
case 5: return [2 /*return*/];
Expand Down
3 changes: 1 addition & 2 deletions dist/FlutterwaveInitV2.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="react-native" />
import { Currency, FlutterwaveInitSubAccount } from './FlutterwaveInit';
export interface FlutterwaveInitOptionsBase {
amount: number;
Expand All @@ -17,7 +16,7 @@ interface FlutterwavePaymentMetaV2 {
metaname: string;
metavalue: string;
}
export declare type FlutterwaveInitV2Options = FlutterwaveInitOptionsBase & {
export type FlutterwaveInitV2Options = FlutterwaveInitOptionsBase & {
txref: string;
PBFPubKey: string;
customer_firstname?: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/FlutterwaveInitV2.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading