The Cube SDK provides flexibility in managing both payments and delivery services.
Below is a detailed breakdown of the payload data structure required when integrating the Cube SDK into your application.
The payload is a JavaScript object passed to the CubeSDK.config() method, containing essential details about the transaction, customer, and delivery.
Feel free to conduct direct testing on this website. We strongly encourage and recommend utilising this feature as an efficient means to promptly test functionalities and configurations on your end.
Sample
Copy
CubeSDK.config({ public_key: "", // Replace with your Public API Key amount: 9000.458, // Amount to be charged currency: "NGN", // Transaction currency country: "NG", // Country code payment_options: ["USSD", "Transfer"], // Available payment options. customer: {...}, // Customer details merchant_details: {...}, // Merchant details handle_delivery: true, // Enable delivery handling charge_delivery: true, // Apply delivery charges item_weight: 0.5, // Weight of the item(s) for delivery delivery_items: [...], // List of delivery items pickup_location: {...}, // Pickup location details redirect_url: "", // URL to redirect after payment onCancel: (data) => {...}, // Handle payment cancellation onSuccess: (transaction) => {...}, // Handle successful payment onFailed: (transaction) => {...}, // Handle failed payment onError: (error) => {...}, // Handle errors during the transaction});
Contains customer details required for the transaction.name: Full name of the customer.phone_number: Primary contact phone number.email: Customer’s email address.
Details about the merchant processing the payment.title: The name of the merchant or business.description: A short description of the transaction or product.logo: A URL pointing to the merchant’s logo.
Example:
Copy
merchant_details: { title: "Merchant", description: "Sell With Mervii", logo: "https://mervii.com/android-chrome-512x512.png"}
Details about the pickup location for the delivery.region: Coordinates (latitude and longitude) of the pickup location.city: The city where the pickup is taking place.state_code: The code of the state where the pickup is located.country_code: The code of the country where the pickup is located.contacts: Information about the contact person at the pickup location.