Skip to main content

Payments

The Payments module provides unified access to major South African payment gateways.

Supported Gateways

GatewayFeaturesBest For
PayFastCards, EFT, Scan to PayE-commerce, Subscriptions
OzowInstant EFTReal-time bank transfers
YocoCards, OnlineSME / Startup payments
PayShapReal-time ClearingInstant B2B / B2C transfers

Usage Examples

TypeScript

const payment = await client.payments.payfast.createPayment({
amount: 199.99,
itemName: 'Pro Subscription',
merchantId: '10000100',
merchantKey: '46f0cd694581a',
returnUrl: 'https://example.com/success',
cancelUrl: 'https://example.com/cancel'
});
console.log('Redirect user to:', payment.url);

Python

payment = await client.payments.payfast.create_payment(
amount=199.99,
item_name="Pro Subscription",
return_url="https://example.com/success"
)
print(f"Redirect user to: {payment.url}")

Go

payment, err := client.Payments().PayFast().CreatePayment(ctx, &luna.PaymentParams{
Amount: 199.99,
ItemName: "Pro Subscription",
})
fmt.Printf("Redirect user to: %s\n", payment.URL)