forked from LiveCarta/PayPal-PHP-SDK
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:
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"description" : "Bill an outstanding amount for an agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement.",
|
||||
"title" : "bill-balance",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.bill-balance",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/{Agreement-Id}/bill-balance",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"note":"Billing Balance Amount",
|
||||
"amount": {
|
||||
"value" : "100",
|
||||
"currency" : "USD"
|
||||
}
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "204 No Content",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"description" : "This operation cancels the agreement",
|
||||
"title" : "Cancel agreement",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.cancel",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/{Agreement-Id}/cancel",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"note": "Cancelling the profile"
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "204 No Content",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"description": "This operation creates agreement having Credit card as payment option",
|
||||
"title": "Agreement created using credit card",
|
||||
"runnable": true,
|
||||
"operationId": "agreement.create",
|
||||
"user": {
|
||||
"scopes": ["https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials": {
|
||||
"oauth": {
|
||||
"path": "/v1/oauth/token",
|
||||
"clientId": "",
|
||||
"clientSecret": ""
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"path": "v1/payments/billing-agreements/",
|
||||
"method": "POST",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"name": "DPRP",
|
||||
"description": "Payment with credit Card ",
|
||||
"start_date": "2015-06-17T9:45:04Z",
|
||||
"plan": {
|
||||
"id": "P-1WJ68935LL406420PUTENA2I"
|
||||
},
|
||||
"shipping_address": {
|
||||
"line1": "111 First Street",
|
||||
"city": "Saratoga",
|
||||
"state": "CA",
|
||||
"postal_code": "95070",
|
||||
"country_code": "US"
|
||||
},
|
||||
"payer": {
|
||||
"payment_method": "credit_card",
|
||||
"payer_info": {
|
||||
"email": "jaypatel512-facilitator@hotmail.com"
|
||||
},
|
||||
"funding_instruments": [
|
||||
{
|
||||
"credit_card": {
|
||||
"type": "visa",
|
||||
"number": "4417119669820331",
|
||||
"expire_month": "12",
|
||||
"expire_year": "2017",
|
||||
"cvv2": "128"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
"response": {
|
||||
"status": "200 OK",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"id": "I-V8SSE9WLJGY6",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://stage2p2163.qa.paypal.com/v1/payments/billing-agreements/I-V8SSE9WLJGY6",
|
||||
"rel": "self",
|
||||
"method": "GET"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
{
|
||||
"description": "This operation creates agreement having PayPal as payment option",
|
||||
"title": "Agreement created having PayPal as payment option",
|
||||
"runnable": true,
|
||||
"operationId": "agreement.create",
|
||||
"user": {
|
||||
"scopes": ["https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials": {
|
||||
"oauth": {
|
||||
"path": "/v1/oauth/token",
|
||||
"clientId": "",
|
||||
"clientSecret": ""
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"path": "v1/payments/billing-agreements/",
|
||||
"method": "POST",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"name": "Base Agreement",
|
||||
"description": "Basic agreement",
|
||||
"start_date": "2015-06-17T9:45:04Z",
|
||||
"plan": {
|
||||
"id": "P-1WJ68935LL406420PUTENA2I"
|
||||
},
|
||||
"payer": {
|
||||
"payment_method": "paypal"
|
||||
},
|
||||
"shipping_address": {
|
||||
"line1": "111 First Street",
|
||||
"city": "Saratoga",
|
||||
"state": "CA",
|
||||
"postal_code": "95070",
|
||||
"country_code": "US"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"response": {
|
||||
"status": "201 Created",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"name": "Base Agreement",
|
||||
"description": "Basic agreement",
|
||||
"plan": {
|
||||
"id": "P-1WJ68935LL406420PUTENA2I",
|
||||
"state": "ACTIVE",
|
||||
"name": "Fast Speed Plan",
|
||||
"description": "Bathinda",
|
||||
"type": "INFINITE",
|
||||
"payment_definitions": [
|
||||
{
|
||||
"id": "PD-9WG6983719571780GUTENA2I",
|
||||
"name": "Payment Definition-1",
|
||||
"type": "REGULAR",
|
||||
"frequency": "Day",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "10"
|
||||
},
|
||||
"charge_models": [
|
||||
{
|
||||
"id": "CHM-8373958130821962WUTENA2Q",
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "CHM-2937144979861454NUTENA2Q",
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "2"
|
||||
}
|
||||
}
|
||||
],
|
||||
"cycles": "0",
|
||||
"frequency_interval": "1"
|
||||
},
|
||||
{
|
||||
"id": "PD-89M493313S710490TUTENA2Q",
|
||||
"name": "Payment Definition-1",
|
||||
"type": "TRIAL",
|
||||
"frequency": "Month",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "100"
|
||||
},
|
||||
"charge_models": [
|
||||
{
|
||||
"id": "CHM-78K47820SS4923826UTENA2Q",
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "CHM-9M366179U7339472RUTENA2Q",
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"cycles": "5",
|
||||
"frequency_interval": "2"
|
||||
}
|
||||
],
|
||||
"merchant_preferences": {
|
||||
"setup_fee": {
|
||||
"currency": "GBP",
|
||||
"value": "1234"
|
||||
},
|
||||
"max_fail_attempts": "21",
|
||||
"return_url": "http://www.paypal.com",
|
||||
"cancel_url": "http://www.yahoo.com",
|
||||
"auto_bill_amount": "YES",
|
||||
"initial_fail_amount_action": "CONTINUE"
|
||||
}
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "https://stage2p2163.qa.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-32P34986EV202211E",
|
||||
"rel": "approval_url",
|
||||
"method": "REDIRECT"
|
||||
},
|
||||
{
|
||||
"href": "https://stage2p2163.qa.paypal.com/v1/payments/billing-agreements/EC-32P34986EV202211E/agreement-execute",
|
||||
"rel": "execute",
|
||||
"method": "POST"
|
||||
}
|
||||
],
|
||||
"start_date": "2114-06-17T9:45:04Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
{
|
||||
"description" : "This operation creates agreement having PayPal as payment option",
|
||||
"title" : "Agreement created having PayPal as payment option",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.create",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"name":"Override Agreement",
|
||||
"description": "Agreement where merchant preferences and charge model is overridden",
|
||||
"start_date" : "2014-06-17T03:05:05Z",
|
||||
"payer":{
|
||||
"payment_method":"paypal",
|
||||
"payer_info":
|
||||
{
|
||||
"email":"kkarunanidhi-per1@paypal.com"
|
||||
}
|
||||
},
|
||||
"plan":{
|
||||
"id":"P-1WJ68935LL406420PUTENA2I"
|
||||
},
|
||||
"shipping_address":{
|
||||
"line1":"Hotel Staybridge",
|
||||
"line2":"Crooke Street",
|
||||
"city":"San Jose",
|
||||
"state":"CA",
|
||||
"postal_code":"95112",
|
||||
"country_code":"US"
|
||||
},
|
||||
"override_merchant_preferences":{
|
||||
"setup_fee": {
|
||||
"value" : "3",
|
||||
"currency" : "GBP"
|
||||
},
|
||||
"return_url":"http://indiatimes.com",
|
||||
"cancel_url":"http://rediff.com",
|
||||
"auto_bill_amount": "YES",
|
||||
"initial_fail_amount_action": "CONTINUE",
|
||||
"max_fail_attempts": "11"
|
||||
},
|
||||
"override_charge_models":[
|
||||
{
|
||||
"charge_id": "CHM-8373958130821962WUTENA2Q",
|
||||
"amount": {
|
||||
"value" :"1",
|
||||
"currency" : "GBP"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
"response" : {
|
||||
"status" : "201 Created",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"name": "Override Agreement",
|
||||
"description": "Agreement where merchant preferences and charge model is overridden",
|
||||
"plan": {
|
||||
"id": "P-1WJ68935LL406420PUTENA2I",
|
||||
"state": "ACTIVE",
|
||||
"name": "Fast Speed Plan",
|
||||
"description": "Vanilla plan",
|
||||
"type": "INFINITE",
|
||||
"payment_definitions": [
|
||||
{
|
||||
"id": "PD-9WG6983719571780GUTENA2I",
|
||||
"name": "Payment Definition-1",
|
||||
"type": "REGULAR",
|
||||
"frequency": "Day",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "10"
|
||||
},
|
||||
"charge_models": [
|
||||
{
|
||||
"id": "CHM-8373958130821962WUTENA2Q",
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "CHM-2937144979861454NUTENA2Q",
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "2"
|
||||
}
|
||||
}
|
||||
],
|
||||
"cycles": "0",
|
||||
"frequency_interval": "1"
|
||||
},
|
||||
{
|
||||
"id": "PD-89M493313S710490TUTENA2Q",
|
||||
"name": "Payment Definition-1",
|
||||
"type": "TRIAL",
|
||||
"frequency": "Month",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "100"
|
||||
},
|
||||
"charge_models": [
|
||||
{
|
||||
"id": "CHM-78K47820SS4923826UTENA2Q",
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "CHM-9M366179U7339472RUTENA2Q",
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "GBP",
|
||||
"value": "12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"cycles": "5",
|
||||
"frequency_interval": "2"
|
||||
}
|
||||
],
|
||||
"merchant_preferences": {
|
||||
"setup_fee": {
|
||||
"currency": "GBP",
|
||||
"value": "3"
|
||||
},
|
||||
"max_fail_attempts": "11",
|
||||
"return_url": "http://indiatimes.com",
|
||||
"cancel_url": "http://rediff.com",
|
||||
"auto_bill_amount": "YES",
|
||||
"initial_fail_amount_action": "CONTINUE"
|
||||
}
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "https://stage2p2163.qa.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-83C745436S346813F",
|
||||
"rel": "approval_url",
|
||||
"method": "REDIRECT"
|
||||
},
|
||||
{
|
||||
"href": "https://stage2p2163.qa.paypal.com/v1/payments/billing-agreements/EC-83C745436S346813F/agreement-execute",
|
||||
"rel": "execute",
|
||||
"method": "POST"
|
||||
}
|
||||
],
|
||||
"start_date": "2014-06-17T03:05:05Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"description" : "Create PayPal agreement after buyer approval",
|
||||
"title" : "Agreement creation",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.execute",
|
||||
"user" : {
|
||||
"scopes" : ["https://uri.paypal.com/services/subscriptions" ]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/EC-6CT996018D989343F/agreement-execute",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "200 OK",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"id": "I-5D3XDN2D5FH1",
|
||||
"links": [
|
||||
{
|
||||
"href": "https://stage2p2163.qa.paypal.com/v1/payments/billing-agreements/I-5D3XDN2D5FH1",
|
||||
"rel": "self",
|
||||
"method": "GET"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"description": "This operation fetches details of the agreement",
|
||||
"title": "Fetch agreement details",
|
||||
"runnable": true,
|
||||
"operationId": "agreement.get",
|
||||
"user": {
|
||||
"scopes": ["https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials": {
|
||||
"oauth": {
|
||||
"path": "/v1/oauth/token",
|
||||
"clientId": "",
|
||||
"clientSecret": ""
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"path": "v1/payments/billing-agreements/I-5D3XDN2D5FH1",
|
||||
"method": "GET",
|
||||
"headers": {},
|
||||
"body": {}
|
||||
},
|
||||
"response": {
|
||||
"status": "200 OK",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"id": "I-V8SSE9WLJGY6",
|
||||
"state": "Active",
|
||||
"description": "Payment with credit Card ",
|
||||
"plan": {
|
||||
"payment_definitions": [
|
||||
{
|
||||
"type": "TRIAL",
|
||||
"frequency": "Week",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "9.19"
|
||||
},
|
||||
"cycles": "2",
|
||||
"charge_models": [
|
||||
{
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "2.00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
}
|
||||
}
|
||||
],
|
||||
"frequency_interval": "5"
|
||||
},
|
||||
{
|
||||
"type": "REGULAR",
|
||||
"frequency": "Month",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "100.00"
|
||||
},
|
||||
"cycles": "12",
|
||||
"charge_models": [
|
||||
{
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "12.00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "10.00"
|
||||
}
|
||||
}
|
||||
],
|
||||
"frequency_interval": "2"
|
||||
}
|
||||
],
|
||||
"merchant_preferences": {
|
||||
"setup_fee": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
},
|
||||
"max_fail_attempts": "0",
|
||||
"auto_bill_amount": "YES"
|
||||
}
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/suspend",
|
||||
"rel": "suspend",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/re-activate",
|
||||
"rel": "re_activate",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/cancel",
|
||||
"rel": "cancel",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/bill-balance",
|
||||
"rel": "self",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/set-balance",
|
||||
"rel": "self",
|
||||
"method": "POST"
|
||||
}
|
||||
],
|
||||
"start_date": "2015-06-17T16:45:04Z",
|
||||
"agreement_details": {
|
||||
"outstanding_balance": {
|
||||
"currency": "USD",
|
||||
"value": "200.00"
|
||||
},
|
||||
"cycles_remaining": "2",
|
||||
"cycles_completed": "0",
|
||||
"next_billing_date": "2015-06-17T10:00:00Z",
|
||||
"last_payment_date": "2014-10-28T22:48:56Z",
|
||||
"last_payment_amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
},
|
||||
"final_payment_date": "2017-06-26T10:00:00Z",
|
||||
"failed_payment_count": "0"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"description": "This operation fetches details of the agreement",
|
||||
"title": "Fetch agreement details",
|
||||
"runnable": true,
|
||||
"operationId": "agreement.get",
|
||||
"user": {
|
||||
"scopes": ["https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials": {
|
||||
"oauth": {
|
||||
"path": "/v1/oauth/token",
|
||||
"clientId": "",
|
||||
"clientSecret": ""
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"path": "v1/payments/billing-agreements/I-5D3XDN2D5FH1",
|
||||
"method": "GET",
|
||||
"headers": {},
|
||||
"body": {}
|
||||
},
|
||||
"response": {
|
||||
"status": "200 OK",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"id": "I-V8SSE9WLJGY6",
|
||||
"state": "Cancelled",
|
||||
"description": "Payment with credit Card ",
|
||||
"plan": {
|
||||
"payment_definitions": [
|
||||
{
|
||||
"type": "TRIAL",
|
||||
"frequency": "Week",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "9.19"
|
||||
},
|
||||
"cycles": "2",
|
||||
"charge_models": [
|
||||
{
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "2.00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
}
|
||||
}
|
||||
],
|
||||
"frequency_interval": "5"
|
||||
},
|
||||
{
|
||||
"type": "REGULAR",
|
||||
"frequency": "Month",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "100.00"
|
||||
},
|
||||
"cycles": "12",
|
||||
"charge_models": [
|
||||
{
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "12.00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "10.00"
|
||||
}
|
||||
}
|
||||
],
|
||||
"frequency_interval": "2"
|
||||
}
|
||||
],
|
||||
"merchant_preferences": {
|
||||
"setup_fee": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
},
|
||||
"max_fail_attempts": "0",
|
||||
"auto_bill_amount": "YES"
|
||||
}
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/suspend",
|
||||
"rel": "suspend",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/re-activate",
|
||||
"rel": "re_activate",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/cancel",
|
||||
"rel": "cancel",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/bill-balance",
|
||||
"rel": "self",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/set-balance",
|
||||
"rel": "self",
|
||||
"method": "POST"
|
||||
}
|
||||
],
|
||||
"start_date": "2015-06-17T16:45:04Z",
|
||||
"agreement_details": {
|
||||
"outstanding_balance": {
|
||||
"currency": "USD",
|
||||
"value": "0.00"
|
||||
},
|
||||
"cycles_remaining": "2",
|
||||
"cycles_completed": "0",
|
||||
"next_billing_date": "2015-06-17T10:00:00Z",
|
||||
"last_payment_date": "2014-10-28T22:48:56Z",
|
||||
"last_payment_amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
},
|
||||
"final_payment_date": "2017-06-26T10:00:00Z",
|
||||
"failed_payment_count": "0"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"description": "This operation fetches details of the agreement",
|
||||
"title": "Fetch agreement details",
|
||||
"runnable": true,
|
||||
"operationId": "agreement.get",
|
||||
"user": {
|
||||
"scopes": ["https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials": {
|
||||
"oauth": {
|
||||
"path": "/v1/oauth/token",
|
||||
"clientId": "",
|
||||
"clientSecret": ""
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"path": "v1/payments/billing-agreements/I-5D3XDN2D5FH1",
|
||||
"method": "GET",
|
||||
"headers": {},
|
||||
"body": {}
|
||||
},
|
||||
"response": {
|
||||
"status": "200 OK",
|
||||
"headers": {},
|
||||
"body": {
|
||||
"id": "I-V8SSE9WLJGY6",
|
||||
"state": "Suspended",
|
||||
"description": "Payment with credit Card ",
|
||||
"plan": {
|
||||
"payment_definitions": [
|
||||
{
|
||||
"type": "TRIAL",
|
||||
"frequency": "Week",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "9.19"
|
||||
},
|
||||
"cycles": "2",
|
||||
"charge_models": [
|
||||
{
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "2.00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
}
|
||||
}
|
||||
],
|
||||
"frequency_interval": "5"
|
||||
},
|
||||
{
|
||||
"type": "REGULAR",
|
||||
"frequency": "Month",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "100.00"
|
||||
},
|
||||
"cycles": "12",
|
||||
"charge_models": [
|
||||
{
|
||||
"type": "TAX",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "12.00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SHIPPING",
|
||||
"amount": {
|
||||
"currency": "USD",
|
||||
"value": "10.00"
|
||||
}
|
||||
}
|
||||
],
|
||||
"frequency_interval": "2"
|
||||
}
|
||||
],
|
||||
"merchant_preferences": {
|
||||
"setup_fee": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
},
|
||||
"max_fail_attempts": "0",
|
||||
"auto_bill_amount": "YES"
|
||||
}
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/suspend",
|
||||
"rel": "suspend",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/re-activate",
|
||||
"rel": "re_activate",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/cancel",
|
||||
"rel": "cancel",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/bill-balance",
|
||||
"rel": "self",
|
||||
"method": "POST"
|
||||
},
|
||||
{
|
||||
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-XTN3V7NY6KG7/set-balance",
|
||||
"rel": "self",
|
||||
"method": "POST"
|
||||
}
|
||||
],
|
||||
"start_date": "2015-06-17T16:45:04Z",
|
||||
"agreement_details": {
|
||||
"outstanding_balance": {
|
||||
"currency": "USD",
|
||||
"value": "0.00"
|
||||
},
|
||||
"cycles_remaining": "2",
|
||||
"cycles_completed": "0",
|
||||
"next_billing_date": "2015-06-17T10:00:00Z",
|
||||
"last_payment_date": "2014-10-28T22:48:56Z",
|
||||
"last_payment_amount": {
|
||||
"currency": "USD",
|
||||
"value": "1.00"
|
||||
},
|
||||
"final_payment_date": "2017-06-26T10:00:00Z",
|
||||
"failed_payment_count": "0"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"description" : "This operation lists the transactions for the agreement",
|
||||
"title" : "Transaction listing of agreement",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.transactions",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/{Agreement-Id}/transaction?start-date=yyyy-mm-dd&end-date=yyyy-mm-dd",
|
||||
"method" : "GET",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "200 OK",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"agreement_transaction_list": [
|
||||
{
|
||||
"transaction_id": "I-V8SSE9WLJGY6",
|
||||
"status": "Created",
|
||||
"transaction_type": "Recurring Payment",
|
||||
"payer_email": "",
|
||||
"payer_name": " ",
|
||||
"time_stamp": "2014-06-16T13:46:53Z",
|
||||
"time_zone": "GMT"
|
||||
},
|
||||
{
|
||||
"transaction_id": "I-V8SSE9WLJGY6",
|
||||
"status": "Suspended",
|
||||
"transaction_type": "Recurring Payment",
|
||||
"payer_email": "",
|
||||
"payer_name": " ",
|
||||
"time_stamp": "2014-06-16T13:52:26Z",
|
||||
"time_zone": "GMT"
|
||||
},
|
||||
{
|
||||
"transaction_id": "I-V8SSE9WLJGY6",
|
||||
"status": "Reactivated",
|
||||
"transaction_type": "Recurring Payment",
|
||||
"payer_email": "",
|
||||
"payer_name": " ",
|
||||
"time_stamp": "2014-06-16T14:00:23Z",
|
||||
"time_zone": "GMT"
|
||||
},
|
||||
{
|
||||
"transaction_id": "I-V8SSE9WLJGY6",
|
||||
"status": "Canceled",
|
||||
"transaction_type": "Recurring Payment",
|
||||
"payer_email": "",
|
||||
"payer_name": " ",
|
||||
"time_stamp": "2014-06-16T14:02:54Z",
|
||||
"time_zone": "GMT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"description" : "This operation activates the suspended agreement",
|
||||
"title" : "Reactivate agreement",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.re-activate",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/{Agreement-Id}/re-activate",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"note": "Reactivating the profile"
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "204 No Content",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"description" : "Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a common_currency object in the request JSON that specifies the currency type and value of the balance.",
|
||||
"title" : "set-balance",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.set-balance",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/{Agreement-Id}/set-balance",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"value" : "200",
|
||||
"currency" : "USD"
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "204 No Content",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"description" : "This operation suspends the agreement",
|
||||
"title" : "Suspend agreement",
|
||||
"runnable" : true,
|
||||
"operationId" : "agreement.suspend",
|
||||
"user" : {
|
||||
"scopes" : [ "https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials" : {
|
||||
"oauth": {
|
||||
"path" : "/v1/oauth/token",
|
||||
"clientId":"",
|
||||
"clientSecret":""
|
||||
}
|
||||
},
|
||||
"request" : {
|
||||
"path" : "v1/payments/billing-agreements/{Agreement-Id}/suspend",
|
||||
"method" : "POST",
|
||||
"headers" : {},
|
||||
"body" :
|
||||
{
|
||||
"note": "Suspending the profile"
|
||||
}
|
||||
},
|
||||
"response" : {
|
||||
"status" : "204 No Content",
|
||||
"headers" : {},
|
||||
"body" : {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"description": "This operation updates agreement",
|
||||
"title": "Update agreement",
|
||||
"runnable": true,
|
||||
"operationId": "agreement.update",
|
||||
"user": {
|
||||
"scopes": ["https://uri.paypal.com/services/subscriptions"]
|
||||
},
|
||||
"credentials": {
|
||||
"oauth": {
|
||||
"path": "/v1/oauth/token",
|
||||
"clientId": "",
|
||||
"clientSecret": ""
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"path": "v1/payments/billing-agreements/{Agreement-Id}",
|
||||
"method": "PATCH",
|
||||
"headers": {},
|
||||
"body": [
|
||||
{
|
||||
"op": "replace",
|
||||
"path": "/",
|
||||
"value": {
|
||||
"description": "Updated description",
|
||||
"start_date": "2024-06-18T10:00:00Z",
|
||||
"shipping_address":{
|
||||
"line1":"Hotel Blue Diamond",
|
||||
"line2":"Church Street",
|
||||
"city":"San Jose",
|
||||
"state":"CA",
|
||||
"postal_code":"95112",
|
||||
"country_code":"US"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
"response": {
|
||||
"status": "200 OK",
|
||||
"headers": {},
|
||||
"body": {}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user