public interface IPoyntCustomDiscountService
extends android.os.IInterface
Sample Service
<service
android:name=".CustomCouponService"
android:enabled="true"
android:exported="true"
android:permission="co.poynt.capability.PAYMENT">
<!-- define the intent filter with an action as IPoyntCustomDiscountService interface -->
<intent-filter>
<action android:name="co.poynt.os.services.v1.IPoyntCustomDiscountService" />
</intent-filter>
<!-- define the details of your discount service inside an xml resource -->
<!-- This xml will be used by the poynt system to expose this discount service to
other POS systems installed in the poynt device -->
<meta-data
android:name="co.poynt.os.service.capability"
android:resource="@xml/coupons_capabilities"/>
<!-- Optional: Provide a logo that will appear on screen -->
<meta-data
android:name="co.poynt.os.service.logo"
android:resource="@drawable/custom_tender" />
</service>
Sample discount XML
<?xml version="1.0" encoding="utf-8"?>
<!-- This xml defines what capabilities are supported by the discount service that uses this xml.
Capabilities will be used by PoyntOS on behalf of the service to
get inputs from merchant/customer. -->
<capability xmlns:android="http://schemas.android.com/apk/res/android">
<!-- REQUIRED: application id of this app this appid is issued by poynt web portal
IMPORTANT: Replace this appid with your appid.-->
<!--<appid>urn:aid:0f39b7a3-b9db-41f1-9cdb-9f04a3620ade</appid>-->
<appid>urn:aid:d3462a56-737b-4419-b54c-39a59f4dc8d6</appid>
<!-- REQUIRED: type of capbility, should be one of
CUSTOM_TRANSACTION, DISCOUNT, LOYALTY,
please see CapabilityType defined in PoyntSDK for list of types supported.
-->
<type>DISCOUNT</type>
<!-- descriptive name of this capability -->
<provider>Poynt Coupon</provider>>
<!-- entry method could be one of the following
MANUAL -> will result in showing a icon to the merchant to manually launch the capability.
CARDREAD -> card data will be directly passed to this capability provider.
QRCODE -> qr code entry.
OTHER -> other entry methods.
each entry method can be additionally filtered with eval tag.
-->
<entry_method type="MANUAL"></entry_method>
<entry_method type="QRCODE"></entry_method>
</capability>
Modifier and Type | Interface and Description |
---|---|
static class |
IPoyntCustomDiscountService.Stub
Local-side IPC implementation stub class.
|
Modifier and Type | Method and Description |
---|---|
void |
applyDiscount(java.lang.String requestId,
co.poynt.api.model.Order order,
co.poynt.api.model.Transaction transaction,
java.lang.String code,
IPoyntCustomDiscountServiceListener callback)
Verify a given discount code or customer information provided is valid.
|
void |
cancelDiscount(java.lang.String requestId,
co.poynt.api.model.Order order,
co.poynt.api.model.Transaction transaction,
IPoyntCustomDiscountServiceListener callback)
Cancel the discount, This service should cancel the discounts it was added to the order in
applyDiscount(java.lang.String, co.poynt.api.model.Order, co.poynt.api.model.Transaction, java.lang.String, co.poynt.os.services.v1.IPoyntCustomDiscountServiceListener) . |
void |
confirmDiscount(java.lang.String requestId,
co.poynt.api.model.Order order,
co.poynt.api.model.Transaction transaction,
IPoyntCustomDiscountServiceListener callback)
Once the discount is applied to the order this discount has to be finalized/settled.
|
void applyDiscount(java.lang.String requestId, co.poynt.api.model.Order order, co.poynt.api.model.Transaction transaction, java.lang.String code, IPoyntCustomDiscountServiceListener callback) throws android.os.RemoteException
IPoyntCustomDiscountServiceListener#onSucess
,
Some or whole of the Order can be paid with this account/coupon codes.
This call can happen multiple times during order processing.requestId
- Request id of the call originator.transaction
- co.poynt.api.Transaction
for which the discount code is being requested fororder
- co.poynt.api.Order
containing the item list for which the discount code is being requested fordiscount
- or coupon code to applycallback
- IPoyntCustomDiscountServiceListener
android.os.RemoteException
void confirmDiscount(java.lang.String requestId, co.poynt.api.model.Order order, co.poynt.api.model.Transaction transaction, IPoyntCustomDiscountServiceListener callback) throws android.os.RemoteException
applyDiscount(java.lang.String, co.poynt.api.model.Order, co.poynt.api.model.Transaction, java.lang.String, co.poynt.os.services.v1.IPoyntCustomDiscountServiceListener)
call.requestId
- Request id of the call originator.order
- object to authorize.callback
- IPoyntCustomDiscountServiceListener
android.os.RemoteException
void cancelDiscount(java.lang.String requestId, co.poynt.api.model.Order order, co.poynt.api.model.Transaction transaction, IPoyntCustomDiscountServiceListener callback) throws android.os.RemoteException
applyDiscount(java.lang.String, co.poynt.api.model.Order, co.poynt.api.model.Transaction, java.lang.String, co.poynt.os.services.v1.IPoyntCustomDiscountServiceListener)
. If discount(s) in the order were already finalized, then discount(s)
needs to be refunded.requestId
- Request id of the call originator.order
- object with discounts to cancel.callback
- IPoyntCustomDiscountServiceListener
android.os.RemoteException