1.0.1 • Published 5 months ago

seerbit-svelte v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago
npm install seerbit-svelte

API Documentation

https://doc.seerbit.com

Support

If you have any problems, questions or suggestions, create an issue here or send your inquiry to care@seerbit.com

Implementation

You should already have your API keys. If not, go to dashboard.seerbitapi.com. Login -> Settings menu -> API Keys menu -> Copy your public key

Properties

PropertyTypeRequiredDefaultDesc
currencyStringOptionalNGNThe currency for the transaction e.g NGN
emailStringRequiredNoneThe email of the user to be charged
descriptionStringOptionalNoneThe transaction description which is optional
fullNameStringOptionalNoneThe fullname of the user to be charged
countryStringOptionalNoneTransaction country which can be optional
transRefStringRequiredNoneSet a unique transaction reference for every transaction
amountStringRequiredNoneThe transaction amount in kobo
callbackUrlStringOptionalNoneThis is the redirect url when transaction is successful
publicKeyStringRequiredNoneYour Public key or see above step to get yours
closeOnSuccessboolOptionalFalseClose checkout when trasaction is successful
closePromptboolOptionalFalseClose the checkout page if transaction is not initiated
setAmountByCustomerboolOptionalFalseSet to true if you want user to enter transaction amount
pocketRefStringOptionalNoneThis is your pocket reference for vendors with pocket
vendorIdStringOptionalNoneThis is the vendorId of your business using pocket
tokenizeboolOptionalFalseTokenize card
customizationCustomizationModelOptionalCustomizationModelCustomizationMode( borderColor: "#000000", backgroundColor: "#004C64", buttonColor: "#0084A0", paymentMethod:PayChannel.card, PayChannel.account, PayChannel.transfer, PayChannel.momo, confetti: false , logo: "logo_url or base64")
onSuccessMethodOptionalNoneCallback method if transaction was successful
onCancelMethodOptionalNoneCallback method if transaction was cancelled

Usage

 <script>
  import Seerbit from "seerbit-svelte";
</script>

	<Seerbit   
		public_key="YOUR PUBLIC KEY"
		tranref={new Date().getTime()}
		full_name="John Doe"
		amount="145.00"
		email="test@emaildomain.com"
		currency="NGN"
		country="NG"
		mobile_no=""
		productId=""
		description=""
		planId=""
		vendorId=""
		pocketReference=""
		setAmountByCustomer={false}
		tokenize={false}
		customization={{
			payment_method: ["card", "account", "transfer", "ussd", "momo"],
			confetti: true,
			logo: "",
			theme: {
			border_color:'fff',
			background_color:'fff',
			button_color:'fff',
			}
		}}
		onSuccess={(response, closeModal) => {
			console.log(response);

      setTimeout(() => closeModal(), 3000)
		}}
		close={(close) => {
			console.log(close);
		}}
		buttonText="Make Payment"
		buttonStyle={{
			style: "padding-top: 40px; padding-bottom: 40px; width: 50%; border-radius: 20px; color: #fff; background-color: red; font-size: 10px",
		}}
/>

onSuccess you will recieve a Map containing the response from the payment request.