Payment Links
Payment Links allow you to easily accept online payments by generating a unique URL that you can share with your customers. Customers can use this link to access a secure payment page and complete their payment.
Payment Links can be customized to match your brand and payment requirements. You can set the amount, currency, description, image, call-to-action button, confirmation message, redirect URL.
Creating a Payment Link
You can create a payment link by providing the required details such as title, amount, and currency.
- C#
- curl
- PHP
var paymentLink = new CreatePaymentLink
{
Title = "Service Payment",
Amount = 100.00,
Currency = "AUD"
};
var svc = new payfurl.sdk.PaymentLink();
svc.Create(paymentLink);
curl -d '{"Title":"Service Payment", "Amount":100.00, "Currency":"AUD"}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.payfurl.com/payment_link
<?
$svc = new PaymentLink();
$result = $svc->Create([
"Title" => "Service Payment",
"Amount" => 100.00,
"Currency" => "AUD"
]);
?>
Customizing the Payment Page
You can customize the payment page using the following fields:
Description
: Additional information about the payment.Image
: Base64-encoded image to display on the payment page.CallToAction
: The text for the payment button.ConfirmationMessage
: Message shown after payment is completed.RedirectUrl
: URL to redirect the customer after payment.
Example with Customization
- C#
- curl
- PHP
var paymentLink = new CreatePaymentLink
{
Title = "Service Payment",
Amount = 100.00,
Currency = "AUD",
Description = "Payment for services",
Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAACXBIWXMAACF0AAAhdAFhwPt.....",
CallToAction = "Donate",
RedirectUrl = "https://payfurl.com"
};
var svc = new payfurl.sdk.PaymentLink();
svc.Create(paymentLink);
curl -d '{"Title":"Service Payment", "Amount":100.00, "Currency":"AUD", "Description":"blah-blah-blah", "Image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAACXBIWXMAACF0AAAhdAFhwPt.....", "CallToAction":"Donate", "RedirectUrl":"https://payfurl.com"}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.payfurl.com/payment_link
<?
$svc = new PaymentLink();
$result = $svc->Create([
"Title" => "Service Payment",
"Amount" => 100.00,
"Currency" => "AUD",
"Description" => "blah-blah-blah",
"Image" => "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAACXBIWXMAACF0AAAhdAFhwPt.....",
"CallToAction" => "Donate",
"RedirectUrl" => "https://payfurl.com"
]);
?>
Limiting the Number of Payments
You can restrict the number of payments that can be made using a payment link by setting LimitPayments
.
- C#
- curl
- PHP
var paymentLink = new CreatePaymentLink
{
Title = "Service Payment",
Amount = 100.00,
Currency = "AUD",
LimitPayments = 1
};
var svc = new payfurl.sdk.PaymentLink();
svc.Create(paymentLink);
curl -d '{"Title":"Service Payment", "Amount":100.00, "Currency":"AUD", "LimitPayments":1}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.payfurl.com/payment_link
<?
$svc = new PaymentLink();
$result = $svc->Create([
"Title" => "Service Payment",
"Amount" => 100.00,
"Currency" => "AUD",
"LimitPayments" => 1
]);
?>
Restricting Available Payment Methods with AllowedPaymentTypes
The AllowedPaymentTypes
field lets you control which payment methods are shown on the payment form. You can specify one or more of the following values:
card
paypal
applepay
googlepay
upi
payto
payid
shift
pesapal
paybyaccount
payglocal
zip
Example with AllowedPaymentTypes
- C#
- curl
- PHP
var paymentLink = new CreatePaymentLink
{
Title = "Service Payment",
Amount = 100.00,
Currency = "AUD",
AllowedPaymentTypes = new[] { "card", "paypal", "googlepay" }
};
var svc = new payfurl.sdk.PaymentLink();
svc.Create(paymentLink);
curl -d '{"Title":"Service Payment", "Amount":100.00, "Currency":"AUD", "AllowedPaymentTypes":["card","paypal","googlepay"]}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.payfurl.com/payment_link
<?
$svc = new PaymentLink();
$result = $svc->Create([
"Title" => "Service Payment",
"Amount" => 100.00,
"Currency" => "AUD",
"AllowedPaymentTypes" => ["card", "paypal", "googlepay"]
]);
?>
Add AllowedPaymentTypes
to your payment link to restrict which payment methods are available to your customers.
Retrieving a Payment Link
To get information about a specific payment link, use the following:
- C#
- curl
- PHP
var svc = new payfurl.sdk.PaymentLink();
var result = svc.Single("some-payment-link-id");
curl -H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X GET https://sandbox-api.payfurl.com/payment_link/some-payment-link-id
<?
$svc = new PaymentLink();
$result = $svc->Single("some-payment-link-id");
?>