This document focuses on the acknowledgePurchase
API used for server-side subscription purchase acknowledgement.
After you have verified the purchase, you should acknowledge it.
The following sample code illustrates the associated request using the acknowledgePurchase
API.
import requests url = "https://payments-api.now.gg/v2/seller/order/acknowledgepurchase" payload = 'purchaseToken=nowgg-_purchase_token' headers = { 'Authorization': 'payment_api_key_here', 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
Payment API Key
can be found within the credentials section of nowStudio. More information.The following is a sample response from the acknowledgePurchase
API.
{ "success": true, "code": 0, "codeMsg": "success", "data": {} }
Params | Type | Description |
---|---|---|
success | boolean | Returns success as true or false. |
code | int | Returns 0 for success and non-zero for failure. |
codeMsg | string | Returns msg related to error code. |
data | object | Data returned as a response. |
Error Code | Message | Description |
---|---|---|
5001 | NO_VALID_SUBSCRIPTION_FOUND | No valid subscriptions found. |
5002 | INVALID_SUBSCRIPTION_OPERATION | The subscription operation is not valid. |
5004 | SUBSCRIPTION_INACTIVE | The request subscription is inactive. |
5006 | ACTIVE_SUBSCRIPTION_ALREADY_EXISTS | An active subscription already exists. |
Payments Module
Payments Module
Document Rev. 1.0