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,148 @@
{
"description": "Creates a payment resource.",
"title": "payment",
"runnable": true,
"operationId": "payment.create",
"user": {
"scopes": [ ]
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": { },
"openIdConnect": { }
},
"request": {
"headers": { },
"body": {
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"number": "4417119669820331",
"type": "visa",
"expire_month": 11,
"expire_year": 2018,
"cvv2": "874",
"first_name": "Betsy",
"last_name": "Buyer",
"billing_address": {
"line1": "111 First Street",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}
}
]
},
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.41",
"tax": "0.03",
"shipping": "0.03"
}
},
"description": "This is the payment transaction description."
}
]
},
"path": "/v1/payments/payment",
"method": "POST"
},
"response": {
"headers": { },
"body": {
"id": "PAY-17S8410768582940NKEE66EQ",
"create_time": "2013-01-31T04:12:02Z",
"update_time": "2013-01-31T04:12:04Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"type": "visa",
"number": "xxxxxxxxxxxx0331",
"expire_month": "11",
"expire_year": "2018",
"first_name": "Betsy",
"last_name": "Buyer",
"billing_address": {
"line1": "111 First Street",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}
}
]
},
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"tax": "0.03",
"shipping": "0.03"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "4RR959492F879224U",
"create_time": "2013-01-31T04:12:02Z",
"update_time": "2013-01-31T04:12:04Z",
"state": "completed",
"amount": {
"total": "7.47",
"currency": "USD"
},
"parent_payment": "PAY-17S8410768582940NKEE66EQ",
"links": [
{
"href": "https://api.paypal.com/v1/payments/sale/4RR959492F879224U",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/sale/4RR959492F879224U/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-17S8410768582940NKEE66EQ",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-17S8410768582940NKEE66EQ",
"rel": "self",
"method": "GET"
}
]
},
"status": "201 Created"
}
}

View File

@@ -0,0 +1,177 @@
{
"description": "Creates a payment resource.",
"title": "payment",
"runnable": true,
"operationId": "payment.create",
"user": {
"scopes": []
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": {},
"openIdConnect": {}
},
"request": {
"headers": {},
"body": {
"intent": "sale",
"payer": {
"payment_method": "paypal",
"payer_info": {
"tax_id_type": "BR_CPF",
"tax_id": "Fh618775611"
}
},
"redirect_urls": {
"return_url": "http://localhost/Server-SDK/rest-api-sdk-php/sample/payments/ExecutePayment.php?success=true",
"cancel_url": "http://localhost/Server-SDK/rest-api-sdk-php/sample/payments/ExecutePayment.php?success=false"
},
"transactions": [
{
"amount": {
"total": "20.00",
"currency": "USD",
"details": {
"subtotal": "17.50",
"tax": "1.30",
"shipping": "1.20",
"handling_fee": "1.00",
"shipping_discount": "-1.00",
"insurance": "0.00"
}
},
"description": "This is the payment transaction description.",
"custom": "EBAY_EMS_90048630024435",
"invoice_number": "48787589677",
"payment_options": {
"allowed_payment_method": "INSTANT_FUNDING_SOURCE"
},
"soft_descriptor": "ECHI5786786",
"item_list": {
"items": [
{
"name": "hat",
"description": "Browncolorsatinhat",
"quantity": "1",
"price": "7.50",
"tax": "0.30",
"sku": "1",
"currency": "USD"
},
{
"name": "handbag",
"description": "Blackcolorhandbag",
"quantity": "5",
"price": "2.00",
"tax": "0.20",
"sku": "product34",
"currency": "USD"
}
],
"shipping_address": {
"recipient_name": "HelloWorld",
"line1": "2211 North First Street",
"city": "San Jose",
"country_code": "US",
"postal_code": "95131",
"phone": "011862212345678",
"state": "CA"
}
}
}
]
},
"path": "/v1/payments/payment",
"method": "POST"
},
"response": {
"headers": {},
"body": {
"id": "PAY-17S8410768582940NKEE66EQ",
"create_time": "2013-01-31T04: 12: 02Z",
"update_time": "2013-01-31T04: 12: 04Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"type": "visa",
"number": "xxxxxxxxxxxx0331",
"expire_month": "11",
"expire_year": "2018",
"first_name": "Betsy",
"last_name": "Buyer",
"billing_address": {
"line1": "111FirstStreet",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}
}
]
},
"transactions": [
{
"amount": {
"total": "20.00",
"currency": "USD",
"details": {
"subtotal": "17.50",
"tax": "1.30",
"shipping": "1.20"
}
},
"description": "Thisisthepaymenttransactiondescription.",
"related_resources": [
{
"sale": {
"id": "4RR959492F879224U",
"create_time": "2013-01-31T04: 12: 02Z",
"update_time": "2013-01-31T04: 12: 04Z",
"state": "completed",
"amount": {
"total": "7.47",
"currency": "USD"
},
"parent_payment": "PAY-17S8410768582940NKEE66EQ",
"links": [
{
"href": "https: //api.paypal.com/v1/payments/sale/4RR959492F879224U",
"rel": "self",
"method": "GET"
},
{
"href": "https: //api.paypal.com/v1/payments/sale/4RR959492F879224U/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https: //api.paypal.com/v1/payments/payment/PAY-17S8410768582940NKEE66EQ",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https: //api.paypal.com/v1/payments/payment/PAY-17S8410768582940NKEE66EQ",
"rel": "self",
"method": "GET"
}
]
},
"status": "201 Created"
}
}

View File

@@ -0,0 +1,98 @@
{
"description": "Completes a payment.",
"title": "Execute Payment",
"runnable": true,
"operationId": "payment.execute",
"user": {
"scopes": []
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": {},
"openIdConnect": {}
},
"request": {
"headers": {},
"body": {
"payer_id": "CR87QHB7JTRSC"
},
"path": "/v1/payments/payment/PAY-34629814WL663112AKEE3AWQ/execute",
"method": "POST"
},
"response": {
"headers": {},
"body": {
"id": "PAY-34629814WL663112AKEE3AWQ",
"create_time": "2013-01-30T23:44:26Z",
"update_time": "2013-01-30T23:44:28Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "paypal",
"payer_info": {
"email": "bbuyer@example.com",
"first_name": "Betsy",
"last_name": "Buyer",
"payer_id": "CR87QHB7JTRSC"
}
},
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"tax": "0.04",
"shipping": "0.06"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "1KE4800207592173L",
"create_time": "2013-01-30T23:44:26Z",
"update_time": "2013-01-30T23:44:28Z",
"state": "completed",
"amount": {
"total": "7.47",
"currency": "USD"
},
"parent_payment": "PAY-34629814WL663112AKEE3AWQ",
"links": [
{
"href": "https://api.paypal.com/v1/payments/sale/1KE4800207592173L",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/sale/1KE4800207592173L/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-34629814WL663112AKEE3AWQ",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-34629814WL663112AKEE3AWQ",
"rel": "self",
"method": "GET"
}
]
},
"status": "200 OK"
}
}

View File

@@ -0,0 +1,109 @@
{
"description": "Obtain the payment resource for the given identifier.",
"title": "Get a payment resource",
"runnable": true,
"operationId": "payment.get",
"user": {
"scopes": []
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": {},
"openIdConnect": {}
},
"request": {
"headers": {},
"body": {},
"path": "/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
"method": "GET"
},
"response": {
"headers": {},
"body": {
"id": "PAY-17S8410768582940NKEE66EQ",
"create_time": "2013-01-31T04:12:02Z",
"update_time": "2013-01-31T04:12:04Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"type": "visa",
"number": "xxxxxxxxxxxx0331",
"expire_month": "11",
"expire_year": "2018",
"first_name": "Betsy",
"last_name": "Buyer",
"billing_address": {
"line1": "111 First Street",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}
}
]
},
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"tax": "0.03",
"shipping": "0.03"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "4RR959492F879224U",
"create_time": "2013-01-31T04:12:02Z",
"update_time": "2013-01-31T04:12:04Z",
"state": "completed",
"amount": {
"total": "7.47",
"currency": "USD"
},
"parent_payment": "PAY-17S8410768582940NKEE66EQ",
"links": [
{
"href": "https://api.paypal.com/v1/payments/sale/4RR959492F879224U",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/sale/4RR959492F879224U/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-17S8410768582940NKEE66EQ",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-17S8410768582940NKEE66EQ",
"rel": "self",
"method": "GET"
}
]
},
"status": "200 OK"
}
}

View File

@@ -0,0 +1,100 @@
{
"description": "Obtain the payment resource for the given identifier.",
"title": "Get a payment resource",
"runnable": true,
"operationId": "payment.get",
"user": {
"scopes": []
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": {},
"openIdConnect": {}
},
"request": {
"headers": {},
"body": {},
"path": "/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
"method": "GET"
},
"response": {
"headers": {},
"body": {
"id": "PAY-5YK922393D847794YKER7MUI",
"create_time": "2013-02-19T22:01:53Z",
"update_time": "2013-02-19T22:01:55Z",
"state": "approved",
"intent": "sale",
"payer": {
"payment_method": "paypal",
"status": "VERIFIED"
},
"transactions": [
{
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.47"
}
},
"description": "This is the payment transaction description.",
"related_resources": [
{
"sale": {
"id": "36C38912MN9658832",
"create_time": "2013-02-19T22:01:53Z",
"update_time": "2013-02-19T22:01:55Z",
"amount": {
"total": "7.47",
"currency": "USD"
},
"payment_mode": "INSTANT_TRANSFER",
"state": "pending",
"reason_code": "ECHECK",
"protection_eligibility": "ELIGIBLE",
"protection_eligibility_type": "ELIGIBLE",
"clearing_time": "2014-06-12T07:00:00Z",
"parent_payment": "PAY-5YK922393D847794YKER7MUI",
"links": [
{
"href": "https://api.paypal.com/v1/payments/sale/36C38912MN9658832",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/sale/36C38912MN9658832/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://www.paypal.com/cgi-bin/webscr?cmd=_complete-express-checkout&token=EC-92V50600P8987630S",
"rel": "payment_instruction_redirect",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"links": [
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI",
"rel": "self",
"method": "GET"
}
]
},
"status": "200 OK"
}
}

View File

@@ -0,0 +1,60 @@
{
"description": "Lookup a Sale resource.",
"title": "Sale Resource",
"runnable": true,
"operationId": "sale.get",
"user": {
"scopes": []
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": {},
"openIdConnect": {}
},
"request": {
"headers": {},
"body": {},
"path": "/v1/sales/4RR959492F879224U",
"method": "GET"
},
"response": {
"headers": {},
"body":
{
"id": "4RR959492F879224U",
"create_time": "2014-10-28T19:27:39Z",
"update_time": "2014-10-28T19:28:02Z",
"amount": {
"total": "7.47",
"currency": "USD"
},
"payment_mode": "INSTANT_TRANSFER",
"state": "completed",
"protection_eligibility": "ELIGIBLE",
"protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"parent_payment": "PAY-17S8410768582940NKEE66EQ",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/5SA006225W236580K",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/5SA006225W236580K/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-48W25034R6080713AKRH64KY",
"rel": "parent_payment",
"method": "GET"
}
]
},
"status": "201 OK"
}
}

View File

@@ -0,0 +1,62 @@
{
"description": "Creates a refunded sale resource.",
"title": "Refund a Sale",
"runnable": true,
"operationId": "sale.refund",
"user": {
"scopes": []
},
"credentials": {
"oauth": {
"clientId": "",
"clientSecret": "",
"path": ""
},
"login": {},
"openIdConnect": {}
},
"request": {
"headers": {},
"body": {
"amount": {
"total": "2.34",
"currency": "USD"
}
},
"path": "/v1/sales/4RR959492F879224U/refund",
"method": "POST"
},
"response": {
"headers": {},
"body": {
"id": "4CF18861HF410323U",
"create_time": "2013-01-31T04:13:34Z",
"update_time": "2013-01-31T04:13:36Z",
"state": "completed",
"amount": {
"total": "2.34",
"currency": "USD"
},
"sale_id": "4RR959492F879224U",
"parent_payment": "PAY-17S8410768582940NKEE66EQ",
"links": [
{
"href": "https://api.paypal.com/v1/payments/refund/4CF18861HF410323U",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/payment/PAY-46E69296BH2194803KEE662Y",
"rel": "parent_payment",
"method": "GET"
},
{
"href": "https://api.paypal.com/v1/payments/sale/2MU78835H4515710F",
"rel": "sale",
"method": "GET"
}
]
},
"status": "201 Created"
}
}