expo-paypal
v1.4.1
Published
Paypal payment gateway for expo from adlerware.
Downloads
91
Maintainers
Readme
Expo-Paypal
Paypal integration with expo ReactNative by Zeeshan Karim
Installation :
npm i expo-paypal
Usage :
Before using this package please make sure your props are valid and all the required info are filled up in paypal.html inside package folder
import PayPal from "expo-paypal";
const PaymentScreen=()=>{
const sendPayment = async (startProcess) => {
if (amount === null) {
alert("Please enter amount")
return;
}
startProcess()
};
<View style={{flex:1}}>
<PayPal
popupContainerStyle={{ height: 400 }}
onPress={(startProcess) => sendPayment(startProcess)}
title="Submit"
buttonStyles={styles?.Button}
btnTextStyles={styles?.text}
amount={23}//i.e $20
success={(a) => {
//callback after payment has been successfully compleated
console.log(a)
}}
failed={(a) => {
//callback if payment is failed
console.log(a)
}}
/>
</View>
}
Props
- amount : Total amount that is payed through paypal. (Required)-(STRING OR NUMBER)
- popupContainerStyle={}
- buttonStyles={}
- btnTextStyles={}
- success : Callback that is fired after transaction has been Successful. (Optional)-(FUNCTION)
- failed : Callback that is fired if transaction has is failed. (Optional)-(FUNCTION)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.