Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Billpay: Updates to List Billers API, Webhooks, Custom payment #173

Merged
merged 5 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
{
"pincode": "pincode"
},
{
"country": "country"
},
{
"coverage": "coverage"
},
{
"state": "state"
},
Expand All @@ -33,6 +39,9 @@
},
{
"paymentMode": "paymentMode"
},
{
"updatedSince": "updatedSince"
}
],
"header": [
Expand Down
57 changes: 52 additions & 5 deletions api-references/payments/billpay/api-integration.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,41 @@
"type": "string"
}
},
{
"name": "coverage",
"in": "query",
"schema": {
"type": "string"
},
"example": "IND-TEL-Hyderabad",
"description": "Fetches billers in the provided coverage area"
},
{
"name": "country",
"in": "query",
"schema": {
"type": "string"
},
"example": "IND",
"description": "Fetches billers in the provided country"
},
{
"name": "state",
"in": "query",
"schema": {
"type": "string"
}
},
"example": "TEL",
"description": "Fetches billers in the provided state"
},
{
"name": "city",
"in": "query",
"schema": {
"type": "string"
}
},
"example": "Hyderabad",
"description": "Fetches billers in the provided city"
},
{
"name": "tags",
Expand Down Expand Up @@ -165,6 +187,16 @@
]
}
}
},
{
"name": "updatedSince",
"in": "query",
"schema": {
"type": "string",
"format": "date-time"
},
"example": "2020-12-12T13:12:00+05:30",
"description": "Fetches billers updated on or after the provided timestamp"
}
],
"responses": {
Expand Down Expand Up @@ -1756,18 +1788,28 @@
],
"type": "object",
"properties": {
"bbpsUpdateTimestamp": {
"type": "string",
"format": "date-time",
"example": "2020-12-12T13:12:00+05:30",
"description": "The timestamp when the biller was last updated accurate to the nearest day"
},
"categoryName": {
"type": "string",
"example": "loan-repayment"
},
"city": {
"type": "string",
"example": "city"
"example": "Hyderabad"
},
"coverage": {
"country": {
"type": "string",
"example": "IND"
},
"coverage": {
"type": "string",
"example": "IND-TEL-Hyderabad"
},
"createdAt": {
"type": "string",
"format": "date-time",
Expand All @@ -1787,6 +1829,11 @@
"$ref": "#/components/schemas/customerParamsGroupItem"
}
},
"enforcesSameDayFetchPay": {
"type": "boolean",
"example": true,
"description": "Denotes whether the biller requires biller payment to be made on the same calendar day as the bill fetch."
},
"exactness": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -1851,7 +1898,7 @@
},
"state": {
"type": "string",
"example": "state"
"example": "TEL"
},
"supportsPendingStatus": {
"type": "boolean",
Expand Down
53 changes: 29 additions & 24 deletions content/payments/billpay/api-integration/objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -347,36 +347,41 @@ Maxium amount accepted by the biller for the [Payment Channel](#payment-channel)
| after | `string` | Billers are sorted via the Biller ID. Providing a biller Id fetches billers right after this biller in a paginated way. |
| search | `string` | searches the provided text over biller name and biller alias |
| pincode | `string` | |
| state | `string` | |
| city | `string` | |
| coverage | `string` | BBPS coverage. Used to search billers having a specific coverage area |
| country | `string` | BBPS Country Code. Used to search billers operating in a certain country |
| state | `string` | BBPS state code. Used to search billers operating in a certain state |
| city | `string` | city name, used to search billers operating in a certain city |
| updatedSince | `date-time` | Fetch billers updated on or after the provided timestamp |
| tags | `string` | |
| paymentChannel | [Payment Channel](#payment-channel)`[]` | |
| paymentMode | [Payment Mode](#payment-mode)`[]` | |

### Response

| parameter | type | description |
| ---------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| categoryName | `string` | Biller Category |
| city | `string` | Biller City |
| coverage | `string` | Biller coverage |
| createdAt | `date-time` | Biller Created At |
| customerParams | [Biller Customer Params](#biller-customer-params)`[]` | Customer Parameter format descrption |
| exactness | [Exactness](#exactness) | Biller Exactness |
| fetchApiType | [Fetch API Type](#fetch-api-type) | Biller Fetch API Type |
| id | `string` | Biller ID |
| logo | `string` | Biller logo |
| modifiedAt | `date-time` | Biller Created At |
| name | `string` | Biller Name |
| payWithoutFetchAllowed | `bool` | Whether biller allows bill payment without a fetch or not. Even in case of `BILL_FETCH` API type, certain bills make the fetch optional |
| paymentChannels | [Biller Payment Channel](#bill-payment-channel)`[]` | Payment Channel limits set by the biller. |
| paymentModes | [Payment Limit](#payment-limit)`[]` | Payment mode limits set by the biller. |
| pincode | `string` | Biller Pincode |
| supportsPendingStatus | `bool` | Whether the biller supports pending status. In this case, a payment can be in progress for up to 2 days. |
| tags | `string` | Additional Tags of the biller. |
| state | `string` | Biller State |
| plans | [Biller-Plan-Information](#biller-plan-information)`[]` | Plans provided by the biller. |

| parameter | type | description |
| ----------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| categoryName | `string` | Biller Category |
| city | `string` | Biller City |
| country | `string` | Biller Country |
| coverage | `string` | Biller coverage |
| createdAt | `date-time` | Biller Created At |
| customerParams | [Biller Customer Params](#biller-customer-params)`[]` | Customer Parameter format descrption |
| exactness | [Exactness](#exactness) | Biller Exactness |
| fetchApiType | [Fetch API Type](#fetch-api-type) | Biller Fetch API Type |
| id | `string` | Biller ID |
| logo | `string` | Biller logo |
| modifiedAt | `date-time` | Biller Modified At |
| name | `string` | Biller Name |
| payWithoutFetchAllowed | `bool` | Whether biller allows bill payment without a fetch or not. Even in case of `BILL_FETCH` API type, certain bills make the fetch optional |
| paymentChannels | [Biller Payment Channel](#bill-payment-channel)`[]` | Payment Channel limits set by the biller. |
| paymentModes | [Payment Limit](#payment-limit)`[]` | Payment mode limits set by the biller. |
| pincode | `string` | Biller Pincode |
| supportsPendingStatus | `bool` | Whether the biller supports pending status. In this case, a payment can be in progress for up to 2 days. |
| tags | `string` | Additional Tags of the biller. |
| state | `string` | Biller State |
| plans | [Biller-Plan-Information](#biller-plan-information)`[]` | Plans provided by the biller. |
| enforcesSameDayFetchPay | `bool` | Whether the biller requires bill payment to be on the same calendar day as bill fetch. |
| bbpsUpdateTimestamp | `date-time` | Last updated date-time of the Biller accurate to the nearest day. |
<hr class="primary" />

## Dispute Request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You need to call the following APIs—
Create one time link
</a>
2. <a
href="/payments/billpay/api-reference/white-label#/category~CustomPaymentWebhook/operation~CouCustomPaymentWebhook"
href="/payments/billpay/pre-built-screens/custom-payment/apis#webhook"
target="_blank"
>
Confirm payment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,17 @@ Here is a sample of the Java Interface class needed by the webview—
}
/** Show a toast from the web page */
@JavascriptInterface
public void initiatePayment(String orderId, String beneVpa, String amount, String callback, String remarks) {
public void initiatePayment(String orderId, String beneVpa, String amount, String callback, String remarks, String mobileNumber, String refId, String customerId, String allowedPaymentModes) {
Intent intent = new Intent(mContext, PaymentScreen.class);
intent.putExtra("BENE_VPA", beneVpa);
intent.putExtra("ORDER_ID", orderId);
intent.putExtra("AMOUNT", amount);
intent.putExtra("CALLBACK_URL", success_url);
intent.putExtra("REMARKS", remarks);
intent.putExtra("MOBILE_NUMBER", remarks);
intent.putExtra("REF_ID", refId);
intent.putExtra("CUSTOMER_ID", customerId);
intent.putExtra("ALLOWED_PAYMENT_MODES", allowedPaymentModes)
mContext.startActivity(intent);
}
/** Show a toast from the web page */
Expand All @@ -181,11 +185,15 @@ The interface will contain 2 methods—

`initiatePayment` on the Android interface takes the following parameters

- `orderId` on the Setu COU System. Example— `Z7pFtTgr9LtO`
- `orderId` on the Setu COU System. Example— `COUWLZ7pFtTgr9LtO`
- `amount` to be paid by the customer: Example— `3522.20`
- `callback` which needs to be loaded if the payment is completed. Example—`//billpay.setu.co/cou/payment-callback/68c7217b-8fa7-4c1f-8e5f-317ff3027668`
- `callback` which needs to be loaded if the payment is completed. Example—`https://billpay.setu.co/cou/payment-callback/68c7217b-8fa7-4c1f-8e5f-317ff3027668`
- `beneVpa` to which amount is to be transferred—this is relevant only if you can transfer in real time using UPI rails.
- `remarks` used to communicate information between mobile app and webview
- `mobileNumber` mobile number used for the session. Example - `9876543210`
- `refId` BBPS reference ID linked to a particular bill (only available for fetch billers). Example - `CMA0I65RCU2I32C3L0H0KNYQYAG40021831`
- `customerId` linked to a particular session. Example - `cust@1234`
- `allowedPaymentModes` comma separated list of modes allowed for this payment. One of these should be sent in the `paymentMode` in the <a href="/payments/billpay/pre-built-screens/custom-payment/apis#webhook">payment confirmation webhook.</a>

When `initiatePayment` is called by the webview, your app needs to do the following—

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ The `orderId` is always prefixed with `COUWL` to identify Setu payment requests.
}`}
</CodeBlockWithCopy>

See <a href="/payments/billpay/api-reference/white-label#/category~CustomPaymentWebhook/operation~CouCustomPaymentWebhook" target="_blank">API reference</a> for more information.

<hr class="primary" />

### APIs you need to support
Expand Down
Loading