Enabled Billing Plans and Agreements APIs

- Added API Classes, Samples, and Tests
- Updated Functional Tests
- Updated Documentation with new SDK Name
- Updated Few Samples to use newer nicer result page
This commit is contained in:
japatel
2014-10-31 10:16:13 -05:00
parent f55fd3d984
commit 4d481ad104
192 changed files with 13310 additions and 1045 deletions

View File

@@ -0,0 +1,186 @@
{
"description": "This operation creates a billing plan having a regular and trial billing period",
"title": "Billing Plan with regular and trial billing period",
"runnable": true,
"operationId": "plan.create",
"user": {
"scopes": ["https://uri.paypal.com/services/subscriptions"]
},
"credentials": {
"oauth": {
"path": "/v1/oauth/token",
"clientId": "",
"clientSecret": ""
}
},
"request": {
"path": "v1/payments/billing-plans/",
"method": "POST",
"headers": {},
"body": {
"name": "Sample Plan",
"description": "Plan with regular and trial",
"type": "fixed",
"payment_definitions": [
{
"name": "Regular Payment Definition",
"type": "REGULAR",
"frequency": "MONTH",
"frequency_interval": "2",
"amount": {
"value": "100",
"currency": "USD"
},
"cycles": "12",
"charge_models": [
{
"type": "SHIPPING",
"amount": {
"value": "10",
"currency": "USD"
}
},
{
"type": "TAX",
"amount": {
"value": "12",
"currency": "USD"
}
}
]
},
{
"name": "Trial Payment Definition",
"type": "trial",
"frequency": "week",
"frequency_interval": "5",
"amount": {
"value": "9.19",
"currency": "USD"
},
"cycles": "2",
"charge_models": [
{
"type": "SHIPPING",
"amount": {
"value": "1",
"currency": "USD"
}
},
{
"type": "TAX",
"amount": {
"value": "2",
"currency": "USD"
}
}
]
}
],
"merchant_preferences": {
"setup_fee": {
"value": "1",
"currency": "USD"
},
"return_url": "http://www.paypal.com",
"cancel_url": "http://www.yahoo.com",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE",
"max_fail_attempts": "0"
}
}
},
"response": {
"status": "201 Created",
"headers": {},
"body": {
"id": "P-7DC96732KA7763723UOPKETA",
"state": "CREATED",
"name": "Sample Plan",
"description": "Plan with regular and trial",
"type": "FIXED",
"payment_definitions": [
{
"id": "PD-0MF87809KK310750TUOPKETA",
"name": "Regular Payment Definition",
"type": "REGULAR",
"frequency": "Month",
"amount": {
"currency": "USD",
"value": "100"
},
"charge_models": [
{
"id": "CHM-89H01708244053321UOPKETA",
"type": "SHIPPING",
"amount": {
"currency": "USD",
"value": "10"
}
},
{
"id": "CHM-1V202179WT9709019UOPKETA",
"type": "TAX",
"amount": {
"currency": "USD",
"value": "12"
}
}
],
"cycles": "12",
"frequency_interval": "2"
},
{
"id": "PD-03223056L66578712UOPKETA",
"name": "Trial Payment Definition",
"type": "TRIAL",
"frequency": "Week",
"amount": {
"currency": "USD",
"value": "9.19"
},
"charge_models": [
{
"id": "CHM-7XN63093LF858372XUOPKETA",
"type": "SHIPPING",
"amount": {
"currency": "USD",
"value": "1"
}
},
{
"id": "CHM-6JY06508UT8026625UOPKETA",
"type": "TAX",
"amount": {
"currency": "USD",
"value": "2"
}
}
],
"cycles": "2",
"frequency_interval": "5"
}
],
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "1"
},
"max_fail_attempts": "0",
"return_url": "http://www.paypal.com",
"cancel_url": "http://www.yahoo.com",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE"
},
"create_time": "2014-06-16T07:40:20.940Z",
"update_time": "2014-06-16T07:40:20.940Z",
"links": [
{
"href": "https://localhost:12379/v1/payments/billing-plans/P-7DC96732KA7763723UOPKETA",
"rel": "self",
"method": "GET"
}
]
}
}
}

View File

@@ -0,0 +1,93 @@
{
"description" : "This operation creates a billing plan with no charge models and minimal merchant preferences",
"title" : "Billing Plan with no charge model and minimal merchant preferences",
"runnable" : true,
"operationId" : "plan.create",
"user" : {
"scopes" : ["https://uri.paypal.com/services/subscriptions" ]
},
"credentials" : {
"oauth": {
"path" : "/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request" : {
"path" : "v1/payments/billing-plans/",
"method" :"POST",
"headers" : {},
"body" :
{
"name":"Plan with minimal merchant pref",
"description":"Plan with one payment definition,minimal merchant preferences and no charge models",
"type":"fixed",
"payment_definitions":[
{
"name":"Payment Definition-1",
"type":"REGULAR",
"frequency":"MONTH",
"frequency_interval":"2",
"amount": {
"value" : "100",
"currency" : "USD"
},
"cycles":"12"
}
],
"merchant_preferences":{
"return_url":"http://www.paypal.com",
"cancel_url":"http://www.yahoo.com"
}
}
},
"response" : {
"status" : "201 Created",
"headers" : {},
"body" :
{
"id": "P-1TV69435N82273154UPWDU4I",
"state": "CREATED",
"name": "Plan with minimal merchant pref",
"description": "Plan with one payment definition,minimal merchant preferences and no charge models",
"type": "FIXED",
"payment_definitions": [
{
"id": "PD-62U12008P21526502UPWDU4I",
"name": "Payment Definition-1",
"type": "REGULAR",
"frequency": "Month",
"amount": {
"currency": "USD",
"value": "100"
},
"charge_models": [],
"cycles": "12",
"frequency_interval": "2"
}
],
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "0"
},
"max_fail_attempts": "0",
"return_url": "http://www.paypal.com",
"cancel_url": "http://www.yahoo.com",
"auto_bill_amount": "NO",
"initial_fail_amount_action": "CONTINUE"
},
"create_time": "2014-06-16T09:05:06.161Z",
"update_time": "2014-06-16T09:05:06.161Z",
"links": [
{
"href": "https://localhost:12379/v1/payments/billing-plans/P-1TV69435N82273154UPWDU4I",
"rel": "self",
"method": "GET"
}
]
}
}
}

View File

@@ -0,0 +1,116 @@
{
"description" : "This operation fetches billing plan details cooresponding to the id.",
"title" : "Fetch billing plan details",
"runnable" : true,
"operationId" : "plan.get",
"user" : {
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
},
"credentials" : {
"oauth": {
"path" : "/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request" : {
"path" : "v1/payments/billing-plans/P-7DC96732KA7763723UOPKETA",
"method" : "GET",
"headers" : {},
"body" : {}
},
"response" : {
"status" : "200 OK",
"headers" : {},
"body" :
{
"id": "P-7DC96732KA7763723UOPKETA",
"state": "CREATED",
"name": "Sample Plan",
"description": "Plan with regular and trial",
"type": "FIXED",
"payment_definitions": [
{
"id": "PD-03223056L66578712UOPKETA",
"name": "Trial Payment Definition",
"type": "TRIAL",
"frequency": "Week",
"amount": {
"currency": "USD",
"value": "9.19"
},
"charge_models": [
{
"id": "CHM-6JY06508UT8026625UOPKETA",
"type": "TAX",
"amount": {
"currency": "USD",
"value": "2"
}
},
{
"id": "CHM-7XN63093LF858372XUOPKETA",
"type": "SHIPPING",
"amount": {
"currency": "USD",
"value": "1"
}
}
],
"cycles": "2",
"frequency_interval": "5"
},
{
"id": "PD-0MF87809KK310750TUOPKETA",
"name": "Regular Payment Definition",
"type": "REGULAR",
"frequency": "Month",
"amount": {
"currency": "USD",
"value": "100"
},
"charge_models": [
{
"id": "CHM-1V202179WT9709019UOPKETA",
"type": "TAX",
"amount": {
"currency": "USD",
"value": "12"
}
},
{
"id": "CHM-89H01708244053321UOPKETA",
"type": "SHIPPING",
"amount": {
"currency": "USD",
"value": "10"
}
}
],
"cycles": "12",
"frequency_interval": "2"
}
],
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "1"
},
"max_fail_attempts": "0",
"return_url": "http://www.paypal.com",
"cancel_url": "http://www.yahoo.com",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE"
},
"create_time": "2014-06-16T07:40:20.940Z",
"update_time": "2014-06-16T07:40:20.940Z",
"links": [
{
"href": "https://localhost:12379/v1/payments/billing-plans/P-7DC96732KA7763723UOPKETA",
"rel": "self",
"method": "GET"
}
]
}
}
}

View File

@@ -0,0 +1,87 @@
{
"description" : "This operation fetches billing plan list",
"title" : "Billing Plan list",
"runnable" : true,
"operationId" : "plans",
"user" : {
"scopes" : ["https://uri.paypal.com/services/subscriptions" ]
},
"credentials" : {
"oauth": {
"path" : "/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request" : {
"path" : "v1/payments/billing-plans?page_size=3&status=ACTIVE&page_size=2&page=1&total_required=yes",
"method" : "GET",
"headers" : {},
"body" : {}
},
"response" : {
"status" : "200 OK",
"headers" : {},
"body" :
{
"total_items": "166",
"total_pages": "83",
"plans": [
{
"id": "P-7DC96732KA7763723UOPKETA",
"state": "ACTIVE",
"name": "Testing1-Regular3",
"description": "Create Plan for Regular",
"type": "FIXED",
"create_time": "2014-08-22T04:41:52.836Z",
"update_time": "2014-08-22T04:41:53.169Z",
"links": [
{
"href": "https://stage2p1353.qa.paypal.com/v1/payments/billing-plans/P-6EM196669U062173D7QCVDRA",
"rel": "self",
"method": "GET"
}
]
},
{
"id": "P-83567698LH138572V7QCVZJY",
"state": "ACTIVE",
"name": "Testing1-Regular4",
"description": "Create Plan for Regular",
"type": "INFINITE",
"create_time": "2014-08-22T04:41:55.623Z",
"update_time": "2014-08-22T04:41:56.055Z",
"links": [
{
"href": "https://stage2p1353.qa.paypal.com/v1/payments/billing-plans/P-83567698LH138572V7QCVZJY",
"rel": "self",
"method": "GET"
}
]
}
],
"links": [
{
"href": "https://stage2p1353.qa.paypal.com/v1/payments/billing-plans?page_size=2&page=1&start=3&status=active",
"rel": "start",
"method": "GET"
},
{
"href": "https://stage2p1353.qa.paypal.com/v1/payments/billing-plans?page_size=2&page=0&status=active",
"rel": "previous_page",
"method": "GET"
},
{
"href": "https://stage2p1353.qa.paypal.com/v1/payments/billing-plans?page_size=2&page=2&status=active",
"rel": "next_page",
"method": "GET"
},
{
"href": "https://stage2p1353.qa.paypal.com/v1/payments/billing-plans?page_size=2&page=82&status=active",
"rel": "last",
"method": "GET"
}
]
}
}
}

View File

@@ -0,0 +1,40 @@
{
"description" : "Patch operation for changing merchant preferences values",
"title" : "Patch Operation for changing merchant preferences",
"runnable" : true,
"operationId" : "plan.update",
"user" : {
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
},
"credentials" : {
"oauth": {
"path" : "/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request" : {
"path" : "v1/payments/billing-plans/{PLAN-ID}/",
"method" : "PATCH",
"headers" : {},
"body" :
[
{
"op":"replace",
"path":"/merchant-preferences",
"value" : {
"cancel_url":"http://www.cancel.com",
"setup_fee": {
"value" :"5",
"currency" : "USD"
}
}
}
]
},
"response" : {
"status" : "200 OK",
"headers" : {},
"body" : { }
}
}

View File

@@ -0,0 +1,41 @@
{
"description" : "Patch operation for changing payment definition values",
"title" : "Patch operation for payment definition",
"runnable" : true,
"operationId" : "plan.update",
"user" : {
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
},
"credentials" : {
"oauth": {
"path" : "/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request" : {
"path" : "v1/payments/billing-plans/{PLAN-ID}/",
"method" : "PATCH",
"headers" : {},
"body" :
[
{
"op":"replace",
"path":"/payment-definitions/PD-4816080302132415WUQBT7WA",
"value" : {
"name": "Updated Payment Definition",
"frequency": "Day",
"amount": {
"currency": "USD",
"value": "1"
}
}
}
]
},
"response" : {
"status" : "200 OK",
"headers" : {},
"body" : { }
}
}

View File

@@ -0,0 +1,39 @@
{
"description" : "This operation changes the state of billing plan to active if its in created state.",
"title" : "Patch Request for changing state",
"runnable" : true,
"operationId" : "plan.update",
"user" : {
"scopes" : ["https://uri.paypal.com/services/subscriptions" ]
},
"credentials" : {
"oauth": {
"path" : "/v1/oauth/token",
"clientId":"",
"clientSecret":""
}
},
"request" : {
"path" : "v1/payments/billing-plans/{PLAN-ID}/",
"method" : "PATCH",
"headers" : {},
"body" :
[
{
"op":"replace",
"path":"/",
"value":{
"state":"ACTIVE"
}
}
]
},
"response" : {
"status" : "200 OK",
"headers" : {},
"body" : { }
}
}