Create Subscription Scheduled Payment
This API is used to create a schedule payment with dynamic amount.
Idempotent Key and Rule*
Idempotent is controlled by merchantId, merchantTransId, and transactionId.
- If merchantId and merchantTransId have been created and the key information is consistent, then current payment results will be returned.
- If merchantId and merchantTransId have been created but the key information isn’t consistent, then REPEAT_REQ_INCONSISTENT will be returned.
- The key information includes:
merchantId,clientId,orderAmount,buyer,seller, andproductCode.
Notes
When a merchant call this API occurs some system error/network error or get PAYMENT_IN_PROCESS/SYSTEM_ERROR in return, that means the merchant doesn’t get the accurate result. Merchant should do the retry logic and call this API with the same parameters again, or call Query Payment API to get order status. DANA does not give any notification to the merchant. So, the retry should be done by merchant. If when retrying the parameters are not the same, then DANA will treat as two different transactions and merchant must pay both of them.
Value:
dana.acquiring.order.subscription.applyAUTO_DEBITAUTO_DEBIT, means this mode for 2nd/scheduled payment, the system will run agreement pay to create and pay the order.
IPG solution should use this mode
- Value: Order amount, including the cents
- Currency: Currency code based on ISO
For example: To create a charge for $1.00, set amount=100 (100 cents)
- Value: Amount, including the cents
- Currency: Currency code based on ISO
For example: To create a charge for $1.00, set amount=100 (100 cents)
PAY_RETURNNOTIFICATION
{
"request":{
"head":{
"version":"1.0",
"function":"dana.acquiring.order.subscription.apply",
"clientId":"1343415315",
"clientSecret":"67asdf",
"reqTime":"2001-07-04T12:08:56+07:00",
"reqMsgId":"1234567asdfasdf1123fda",
"accessToken":"123456",
"reserve":"{ \"attr1\":\"val1\" }"
},
"body":{
"productCode":"51051000101000100052",
"merchantId":"21414135325252323",
"transactionId":"trxId",
"paymentMode":"AUTO_DEBIT",
"subscriptionId":"subId",
"order":{
"orderTitle":"Women Summer Dress New White Lace",
"orderAmount":{
"currency":"IDR",
"value":"239"
},
"merchantTransId":"201505080001",
"merchantTransType":"This is a sample",
"orderMemo":"Memo",
"createdTime":"2001-07-04T12:08:56-07:00",
"expiryTime":"2017-07-04T12:08:56-07:00",
"goods":[
{
"merchantGoodsId":"24525635625623",
"description":"Women Summer Dress New White Lace",
"category":"travelling/subway",
"price":{
"currency":"IDR",
"value":"239"
},
"unit":"Kg",
"quantity":"3.2",
"merchantShippingId":"564314314574327545",
"snapshotUrl":"[http://snap.url.com]",
"extendInfo":"{ \"objectId\": \"87884393857\",\"objectCode\": \"62\"}"
}
]
},
"notificationUrls":[
{
"url":"http://notify.com",
"type":"NOTIFICATION"
}
],
"mcc":"5732",
"envInfo":{
"sessionId":"8EU6mLl5mUpUBgyRFT4v7DjfQ3fcauthcenter",
"tokenId":"a8d359d6-ca3d-4048-9295-bbea5f6715a6",
"websiteLanguage":"en_US",
"clientIp":"10.15.8.189",
"osType":"Windows.PC",
"appVersion":"1.0",
"sdkVersion":"1.0",
"sourcePlatform":"IPG",
"orderTerminalType":"WEB",
"terminalType":"APP",
"orderOsType":"IOS",
"merchantAppVersion":"1.0",
"extendInfo":"{\"deviceId\":\"CV19A56370e8a00d54293aab8001e4794\"}"
},
"extendInfo":"{\"memo\":\"memo\"}"
}
},
"signature":"signature string"
}
Value:
dana.acquiring.order.subscription.applyS: SuccessF: FailureU: Unknown
SUCCESS- Value: Order amount, including the cents
- Currency: Currency code based on ISO
For example: To create a charge for $1.00, set amount=100 (100 cents)
SUCCESSSUCCESSDIRECT{
"response":{
"head":{
"version":"1.0",
"function":"dana.acquiring.order.subscription.apply",
"clientId":"1343415315",
"clientSecret":"67asdf",
"respTime":"2001-07-04T12:08:56+07:00",
"reqMsgId":"1234567asdfasdf1123fda",
"accessToken":"123456",
"reserve":"reserve"
},
"body":{
"resultInfo":{
"resultStatus":"S",
"resultCodeId":"00000000",
"resultCode":"SUCCESS",
"resultMsg":"success"
},
"merchantTransId":"51051001000000000002",
"acquirementId":"231241241241412412",
"subscriptionId":"2015032412007101547201352747sub",
"orderAmount":{
"currency":"IDR",
"value":"239"
},
"createdTime":"2001-07-04T12:08:56+07:00",
"paidTime":"2001-07-04T12:08:56+07:00",
"checkoutUrl":null
}
},
"signature":"signature string"
}
| ResultStatus | ResultCodeId | ResultCode | ResultMessage | Solution |
|---|---|---|---|---|
| S | 00000 | SUCCESS | SUCCESS | Mark Create Subscription Scheduled Payment process as Success |
| U | 00000900 | SYSTEM_ERROR | SYSTEM_ERROR | Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload |
| F | 12005129 | SYSTEM_ERROR | SYSTEM_ERROR | Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload |
| F | 12005131 | SUBSCRIPTION_NOT_EXIST | SUBSCRIPTION_NOT_EXIST | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12005132 | INVALID_SUBSCRIPTION_SCHEDULE | INVALID_SUBSCRIPTION_SCHEDULE | Mark Create Subscription Scheduled Payment process as Failed. Retry request when already in the period of scheduled payment or can contact DANA |
| F | 12005133 | AMOUNT_IS_NOT_CORRECT | AMOUNT_IS_NOT_CORRECT | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12005134 | USER_NOT_EXIST | USER_NOT_EXIST | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| U | 12005135 | PAYMENT_IN_PROCESS | PAYMENT_IN_PROCESS | Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload |
| F | 12005136 | PAYMENT_FAILED | PAYMENT_FAILED | Mark Create Subscription Scheduled Payment process as Failed. Create an order with new merchantTransId |
| F | 12005136 | SUBSCRIPTION_SCHEDULE_NOT_EXIST | SUBSCRIPTION_SCHEDULE_NOT_EXIST | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12005140 | PARAM_MISSING | PARAM_MISSING | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015134 | USER_NOT_EXIST | USER_NOT_EXIST | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015144 | PARAM_ILLEGAL | PARAM_ILLEGAL | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015147 | SUBSCRIPTION_PAYMENT_NOT_READY | SUBSCRIPTION_PAYMENT_NOT_READY | Mark Create Subscription Scheduled Payment process as Failed. Retry request when already in the period of scheduled payment |
| F | 12015148 | ORDER_NOT_CONSISTENT | repeat order create request, but the 'orderAmount' is not consistent | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015149 | INVALID_USER_INFO | invalid user info | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015150 | USER_STATUS_IS_FROZEN | USER_STATUS_IS_FROZEN | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter or can contact DANA to check the user/account status |
| F | 12015152 | WITHOUT_AVAILABLE_PAY_METHOD | without available pay method | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015153 | UNKNOWN_EXCEPTION | unknown exception | Mark Create Subscription Scheduled Payment process as Pending. Retry request periodically by sending same request payload |
| F | 12015161 | BALANCE_NOT_ENOUGH | balance not enough | Mark Create Subscription Scheduled Payment process as Failed. Check source of funds availability |
| F | 12015170 | TRX_ID_EMPTY | TRX_ID in extInfo cannot be empty | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015171 | REJECT_BY_RISK_CTL | reject by risk | Mark Create Subscription Scheduled Payment process as Failed. Retry request periodically or contact DANA to consult |
| F | 12015172 | INVALID_SUBSCRIPTION_AMOUNT | invalid subscription amount | Mark Create Subscription Scheduled Payment process as Failed. Retry request with proper parameter |
| F | 12015173 | ORDER_IS_CLOSED | order is closed | Mark Create Subscription Scheduled Payment process as Failed. Create an order with new merchantTransId |