Go SDK
Use PayU GO SDK to integrate PayU payment in your website which is built using GO. PayU GO SDK takes care of the low-level details of the API integration and help you to start collecting payment with just a few lines of code and a function call.
Supported Payment Features
With this GO SDK you can:
- Collect Payments — Create a Payment form to collect payment.
- Verify Payments — Verify the transaction or check the transaction status
- Handle Refunds — Initiate/cancel refunds and check the status of a refund.
- Check Settlements — Retrieve settlement details that the bank has to settle you.
- Check Bank downtime Status — Get information on eligible payment options and PG/BANK downtime details.
- Check Eligibility — Check the customer’s eligibility for EMI and get the amount according to the EMI interest.
- Manage Invoices — Create/Expire invoice link through the function.
Steps to integrate
Before you start with the integration, enable the payment methods that you want to offer to your customers from Dashboard > Settings > Payment methods. We enable Cards, UPI, and other payment methods by default, and we recommend that you enable other payment methods that are relevant to you.
Download Go SDKYou can download the Go web SDK from the following GitHub link: https://github.com/payu-india/web-sdk-go
Create a PayU account
First, create a PayU account. See Register for a Merchant Account.
Install the SDK
To install the PayU GO SDK using go get , run the following command:
go get github.com/payu-india/web-sdk-goBuild the PayU object
Use the following sample code for creating an instance of the PayU Object:
import (
payu "github.com/payu-india/web-sdk-go"
)
payuClient, err := payu.NewClient(
<YOUR_MERCHANT_KEY>,
<YOUR_MERCHANT_SALT>,
<ENVIRONMENT>,
) Test and Go-live
Test your integration
After the integration is complete, you must test the integration before you go live and start collecting payment. You can start accepting actual payments from your customers once the test is successful.
You can make test payments using one of the payment methods configured at the Checkout.
Configure setIsProduction()
Set the value of the setIsProduction() to false in the payment integration code. This enables the integration to accept live payments.
Test credentials
Following are the payment methods supported in PayU Test mode.
Test credentials for Net Banking
Use the following credentials to test the Net Banking integration:
- user name: payu
- password: payu
- OTP: 123456
Test VPA for UPI
You can use either of the following VPAs to test your UPI-related integration:
- anything@payu
- [email protected]
CalloutThe UPI in-app and UPI intent flow is not available in the Test mode.
Test cards for EMI
You can use the following Debit and Credit cards to test Emi integration.
</th>
<th>
</th>
</tr>Kotak DC EMI
<td>
1. **Card Number**: 4706-1378-0509-9594 2. **Expiry**: any future date (mm/yy) 3. **CVV**: 123 4. **OTP**: 111111 5. **Name**: Any name 6. **Mobile Number**: 9123412345 (mandatory for EMI)
</td>
</tr>
<tr>
<td>
AXIS DC EMI
</td>
<td>
1. **Card Number**: 4011-5100-0000-0007 2. **Expiry**: any future date (mm/yy) 3. **CVV**: 123 4. **OTP**: 111111 5. **Name**: Any name 6. **Mobile Number**: 9123412345 (mandatory for EMI)
</td>
</tr>
<tr>
<td>
HDFC CC EMI
</td>
<td>
1. **Card Number**: 4453-3410-65876437 2. **Expiry**: any future date (mm/yy) 3. **CVV**: 123 4. **OTP**: 111111 5. **Name**: Any name 6. **Mobile Number**: 9123412345 (mandatory for EMI)
</td>
</tr>
<tr>
<td>
ICICI CC EMI
</td>
<td>
1. **Card Number**: 4453-3410-65876437 2. **Expiry**: any future date (mm/yy) 3. **CVV**: 123 4. **OTP**: 111111 5. **Name**: Any name 6. **Mobile Number**: 9123412345 (mandatory for EMI)
</td>
</tr>
Test Wallets
You can use the following wallets and their corresponding credentials to test wallet integration.
<th>
Mobile Number
</th>
<th>
OTP
</th>
</tr>PayTM
<td>
7777777777
</td>
<td>
888888
</td>
</tr>
<tr>
<td>
PhonePe
</td>
<td>
Use the Phonepe Pre-Prod app for testing purposes as described in the following PhonePe doc. location:
[https://developer.phonepe.com/v1/docs/setting-up-test-account](https://developer.phonepe.com/v1/docs/setting-up-test-account)
Download the app and register your mobile number and follow the instructions as described in the above PhonePe docs.
</td>
<td>
NA
</td>
</tr>
<tr>
<td>
AmazonPay
</td>
<td>
You can test using your original Amazon account details.
</td>
<td>
</td>
</tr>
Updated 4 days ago
