forked from LiveCarta/PayPal-PHP-SDK
Enabled Vault Credit Card List API
- Added Credit Card List API Operation - Updated Credit Card to include new properties - Updated Tests - Updated Samples - Fixed Billing Agreement Sample (Expired Set Date).
This commit is contained in:
@@ -56,7 +56,7 @@ $agreement = new Agreement();
|
||||
|
||||
$agreement->setName('DPRP')
|
||||
->setDescription('Payment with credit Card')
|
||||
->setStartDate('2015-06-17T9:45:04Z');
|
||||
->setStartDate('2019-06-17T9:45:04Z');
|
||||
|
||||
// Add Plan ID
|
||||
// Please note that the plan Id should be only set in this case.
|
||||
|
||||
@@ -39,7 +39,7 @@ $agreement = new Agreement();
|
||||
|
||||
$agreement->setName('Base Agreement')
|
||||
->setDescription('Basic Agreement')
|
||||
->setStartDate('2015-06-17T9:45:04Z');
|
||||
->setStartDate('2019-06-17T9:45:04Z');
|
||||
|
||||
// Add Plan ID
|
||||
// Please note that the plan Id should be only set in this case.
|
||||
|
||||
@@ -30,7 +30,29 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "billing/CreateBillingAgreementWithCreditCard",
|
||||
"title": "CreateBillingAgreementWithCreditCard"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Create Billing Agreement with Credit Card as Payment Source",
|
||||
"slug": "create-billing-agreement-with-credit-card-as-payment-source"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Create Agreement",
|
||||
"slug": "create-agreement"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -48,7 +70,37 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "billing/CreateBillingAgreementWithPayPal",
|
||||
"title": "CreateBillingAgreementWithPayPal"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Create Billing Agreement with PayPal as Payment Source",
|
||||
"slug": "create-billing-agreement-with-paypal-as-payment-source"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Create Agreement",
|
||||
"slug": "create-agreement"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Get redirect url",
|
||||
"slug": "get-redirect-url"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -66,7 +118,45 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "billing/CreatePlan",
|
||||
"title": "CreatePlan"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Create Plan Sample",
|
||||
"slug": "create-plan-sample"
|
||||
},
|
||||
"depth": 1
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Basic Information",
|
||||
"slug": "basic-information"
|
||||
},
|
||||
"depth": 1
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Payment definitions for this billing plan.",
|
||||
"slug": "payment-definitions-for-this-billing-plan"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Create Plan",
|
||||
"slug": "create-plan"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -246,7 +336,29 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "billing/UpdatePlan",
|
||||
"title": "UpdatePlan"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Update a plan",
|
||||
"slug": "update-a-plan"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Making Plan Active",
|
||||
"slug": "making-plan-active"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -346,29 +458,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "invoice/GetInvoice",
|
||||
"title": "GetInvoice"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Get Invoice Sample",
|
||||
"slug": "get-invoice-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Retrieve Invoice",
|
||||
"slug": "retrieve-invoice"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -512,7 +602,53 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "invoice/UpdateInvoice",
|
||||
"title": "UpdateInvoice"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Update Invoice Sample",
|
||||
"slug": "update-invoice-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Update Invoice",
|
||||
"slug": "update-invoice"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "NOTE: These are the work-around added to the",
|
||||
"slug": "note-these-are-the-work-around-added-to-the"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Update Invoice",
|
||||
"slug": "update-invoice"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Retrieve Invoice",
|
||||
"slug": "retrieve-invoice"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
@@ -576,18 +712,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "lipp/ObtainUserConsent",
|
||||
"title": "ObtainUserConsent"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Get User Consent URL",
|
||||
"slug": "get-user-consent-url"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -605,18 +730,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "lipp/UserConsentRedirect",
|
||||
"title": "UserConsentRedirect"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "User Consent Response",
|
||||
"slug": "user-consent-response"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}
|
||||
]
|
||||
}, {
|
||||
@@ -788,40 +902,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "notifications/ValidateWebhookEvent",
|
||||
"title": "ValidateWebhookEvent"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Validate Webhook",
|
||||
"slug": "validate-webhook"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 2,
|
||||
"title": "Received Body from Webhook",
|
||||
"slug": "received-body-from-webhook"
|
||||
},
|
||||
"depth": 2,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Validate Received Event Method",
|
||||
"slug": "validate-received-event-method"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1283,7 +1364,37 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "payments/ExecutePayment",
|
||||
"title": "ExecutePayment"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Execute Payment Sample",
|
||||
"slug": "execute-payment-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Approval Status",
|
||||
"slug": "approval-status"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Payment Execute",
|
||||
"slug": "payment-execute"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1337,7 +1448,29 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "payments/GetPayment",
|
||||
"title": "GetPayment"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "GetPaymentSample",
|
||||
"slug": "getpaymentsample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Retrieve payment",
|
||||
"slug": "retrieve-payment"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1355,7 +1488,29 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "payments/ListPayments",
|
||||
"title": "ListPayments"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "GetPaymentList",
|
||||
"slug": "getpaymentlist"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Retrieve payment",
|
||||
"slug": "retrieve-payment"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1391,7 +1546,53 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "payments/OrderCapture",
|
||||
"title": "OrderCapture"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Capture Order Sample",
|
||||
"slug": "capture-order-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Approval Status",
|
||||
"slug": "approval-status"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Retrieve the order",
|
||||
"slug": "retrieve-the-order"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Create Capture Object",
|
||||
"slug": "create-capture-object"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Capture Order",
|
||||
"slug": "capture-order"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1499,29 +1700,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "payments/OrderGet",
|
||||
"title": "OrderGet"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Get Order Sample",
|
||||
"slug": "get-order-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Approval Status",
|
||||
"slug": "approval-status"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1557,29 +1736,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "payments/RefundCapture",
|
||||
"title": "RefundCapture"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Refund Capture Sample",
|
||||
"slug": "refund-capture-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Refund",
|
||||
"slug": "refund"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1743,37 +1900,7 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "sale/GetSale",
|
||||
"title": "GetSale"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Get Sale sample",
|
||||
"slug": "get-sale-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Get Sale From Created Payment",
|
||||
"slug": "get-sale-from-created-payment"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Retrieve the sale object",
|
||||
"slug": "retrieve-the-sale-object"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"depth": 2
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1837,7 +1964,45 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "vault/CreateCreditCard",
|
||||
"title": "CreateCreditCard"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Create Credit Card Sample",
|
||||
"slug": "create-credit-card-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "CreditCard",
|
||||
"slug": "creditcard"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Additional Information",
|
||||
"slug": "additional-information"
|
||||
},
|
||||
"depth": 3
|
||||
}, {
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Save card",
|
||||
"slug": "save-card"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
@@ -1909,7 +2074,58 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3
|
||||
"pageTitle": "vault/GetCreditCard",
|
||||
"title": "GetCreditCard"
|
||||
},
|
||||
"depth": 2
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "Get Credit Card Sample",
|
||||
"slug": "get-credit-card-sample"
|
||||
},
|
||||
"depth": 1
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
"language": {
|
||||
"nameMatchers": [{}, ".fbp"],
|
||||
"pygmentsLexer": "php",
|
||||
"singleLineComment": ["//"],
|
||||
"ignorePrefix": "}",
|
||||
"foldPrefix": "^",
|
||||
"name": "PHP"
|
||||
},
|
||||
"sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/vault/ListCreditCards.php",
|
||||
"projectPath": "vault/ListCreditCards.php",
|
||||
"targetPath": "vault/ListCreditCards",
|
||||
"pageTitle": "vault/ListCreditCards",
|
||||
"title": "ListCreditCards"
|
||||
},
|
||||
"depth": 2,
|
||||
"outline": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 1,
|
||||
"title": "List Credit Card Sample",
|
||||
"slug": "list-credit-card-sample"
|
||||
},
|
||||
"depth": 1,
|
||||
"children": [
|
||||
{
|
||||
"type": "heading",
|
||||
"data": {
|
||||
"level": 3,
|
||||
"title": "Parameters to Filter",
|
||||
"slug": "parameters-to-filter"
|
||||
},
|
||||
"depth": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"type": "file",
|
||||
"data": {
|
||||
|
||||
@@ -50,7 +50,7 @@ define Plan information to create an agreement. Make sure the plan you are using
|
||||
|
||||
<span class="hljs-variable">$agreement</span>->setName(<span class="hljs-string">'DPRP'</span>)
|
||||
->setDescription(<span class="hljs-string">'Payment with credit Card'</span>)
|
||||
->setStartDate(<span class="hljs-string">'2015-06-17T9:45:04Z'</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Add Plan ID
|
||||
->setStartDate(<span class="hljs-string">'2019-06-17T9:45:04Z'</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Add Plan ID
|
||||
Please note that the plan Id should be only set in this case.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$plan</span> = <span class="hljs-keyword">new</span> Plan();
|
||||
<span class="hljs-variable">$plan</span>->setId(<span class="hljs-variable">$createdPlan</span>->getId());
|
||||
<span class="hljs-variable">$agreement</span>->setPlan(<span class="hljs-variable">$plan</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Add Payer</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$payer</span> = <span class="hljs-keyword">new</span> Payer();
|
||||
|
||||
@@ -33,7 +33,7 @@ define Plan information to create an agreement. Make sure the plan you are using
|
||||
|
||||
<span class="hljs-variable">$agreement</span>->setName(<span class="hljs-string">'Base Agreement'</span>)
|
||||
->setDescription(<span class="hljs-string">'Basic Agreement'</span>)
|
||||
->setStartDate(<span class="hljs-string">'2015-06-17T9:45:04Z'</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Add Plan ID
|
||||
->setStartDate(<span class="hljs-string">'2019-06-17T9:45:04Z'</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Add Plan ID
|
||||
Please note that the plan Id should be only set in this case.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$plan</span> = <span class="hljs-keyword">new</span> Plan();
|
||||
<span class="hljs-variable">$plan</span>->setId(<span class="hljs-variable">$createdPlan</span>->getId());
|
||||
<span class="hljs-variable">$agreement</span>->setPlan(<span class="hljs-variable">$plan</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Add Payer</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$payer</span> = <span class="hljs-keyword">new</span> Payer();
|
||||
|
||||
@@ -16,13 +16,8 @@ on the Payment class by passing a valid
|
||||
Payment ID
|
||||
(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {
|
||||
<span class="hljs-variable">$payment</span> = Payment::get(<span class="hljs-variable">$paymentId</span>, <span class="hljs-variable">$apiContext</span>);
|
||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError(<span class="hljs-string">"Get Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"Get Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$ex</span>);
|
||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||
}
|
||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"Get Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-variable">$payment</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$payment</span>);
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult(<span class="hljs-string">"Get Payment"</span>, <span class="hljs-string">"Payment"</span>, <span class="hljs-variable">$payment</span>->getId(), <span class="hljs-keyword">null</span>, <span class="hljs-variable">$payment</span>);
|
||||
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$payment</span>;</div></div></div></div></body></html>
|
||||
@@ -12,7 +12,15 @@ to be stored with PayPal.</p></div></div><div class="code"><div class="wrapper">
|
||||
->setExpireYear(<span class="hljs-string">"2019"</span>)
|
||||
->setCvv2(<span class="hljs-string">"012"</span>)
|
||||
->setFirstName(<span class="hljs-string">"Joe"</span>)
|
||||
->setLastName(<span class="hljs-string">"Shopper"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>For Sample Purposes Only.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$request</span> = <span class="hljs-keyword">clone</span> <span class="hljs-variable">$card</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="save-card">Save card</h3>
|
||||
->setLastName(<span class="hljs-string">"Shopper"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="additional-information">Additional Information</h3>
|
||||
<p>Now you can also store the information that could help you connect
|
||||
your users with the stored credit cards.
|
||||
All these three fields could be used for storing any information that could help merchant to point the card.
|
||||
However, Ideally, MerchantId could be used to categorize stores, apps, websites, etc.
|
||||
ExternalCardId could be used for uniquely identifying the card per MerchantId. So, combination of "MerchantId" and "ExternalCardId" should be unique.
|
||||
ExternalCustomerId could be userId, user email, etc to group multiple cards per user.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$card</span>->setMerchantId(<span class="hljs-string">"MyStore1"</span>);
|
||||
<span class="hljs-variable">$card</span>->setExternalCardId(<span class="hljs-string">"CardNumber123"</span> . uniqid());
|
||||
<span class="hljs-variable">$card</span>->setExternalCustomerId(<span class="hljs-string">"123123-myUser1@something.com"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>For Sample Purposes Only.</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$request</span> = <span class="hljs-keyword">clone</span> <span class="hljs-variable">$card</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="save-card">Save card</h3>
|
||||
<p>Creates the credit card as a resource
|
||||
in the PayPal vault. The response contains
|
||||
an 'id' that you can use to refer to it
|
||||
|
||||
21
sample/doc/vault/ListCreditCards.html
Normal file
21
sample/doc/vault/ListCreditCards.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html><html lang="en"><head><title>vault/ListCreditCards</title></head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"><meta name="groc-relative-root" content="../"><meta name="groc-document-path" content="vault/ListCreditCards"><meta name="groc-project-path" content="vault/ListCreditCards.php"><link rel="stylesheet" type="text/css" media="all" href="../assets/style.css"><script type="text/javascript" src="../assets/behavior.js"></script><body><div id="meta"><div class="file-path">vault/ListCreditCards.php</div></div><div id="document"><div class="segment"><div class="code"><div class="wrapper"><span class="hljs-preprocessor"><?php</span></div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h1 id="list-credit-card-sample">List Credit Card Sample</h1>
|
||||
<p>The CreditCard resource allows you to
|
||||
retrieve all previously saved CreditCards.
|
||||
API called: '/v1/vault/credit-cards'
|
||||
Documentation: <a href="https://developer.paypal.com/webapps/developer/docs/api/#list-credit-card-resources">https://developer.paypal.com/webapps/developer/docs/api/#list-credit-card-resources</a></p></div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Creating a Credit Card just in case</p></div></div><div class="code"><div class="wrapper"><span class="hljs-comment">/**<span class="hljs-phpdoc"> @var</span> CreditCard $card */</span>
|
||||
<span class="hljs-variable">$card</span> = <span class="hljs-keyword">require</span> <span class="hljs-string">'CreateCreditCard.php'</span>;
|
||||
|
||||
<span class="hljs-keyword">use</span> <span class="hljs-title">PayPal</span>\<span class="hljs-title">Api</span>\<span class="hljs-title">CreditCard</span>;
|
||||
|
||||
<span class="hljs-comment">/// ### List All Credit Cards</span></div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>(See bootstrap.php for more on <code>ApiContext</code>)</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">try</span> {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="parameters-to-filter">Parameters to Filter</h3>
|
||||
<p>There are many possible filters that you could apply to it. For complete list, please refere to developer docs at above link.</p></div></div><div class="code"><div class="wrapper"> <span class="hljs-variable">$params</span> = <span class="hljs-keyword">array</span>(
|
||||
<span class="hljs-string">"sort_by"</span> => <span class="hljs-string">"create_time"</span>,
|
||||
<span class="hljs-string">"sort_order"</span> => <span class="hljs-string">"desc"</span>,
|
||||
<span class="hljs-string">"merchant_id"</span> => <span class="hljs-string">"MyStore1"</span> <span class="hljs-comment">// Filtering by MerchantId set during CreateCreditCard.</span>
|
||||
);
|
||||
<span class="hljs-variable">$cards</span> = CreditCard::all(<span class="hljs-variable">$params</span>, <span class="hljs-variable">$apiContext</span>);
|
||||
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$ex</span>) {</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printError(<span class="hljs-string">"List All Credit Cards"</span>, <span class="hljs-string">"CreditCardList"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$params</span>, <span class="hljs-variable">$ex</span>);
|
||||
<span class="hljs-keyword">exit</span>(<span class="hljs-number">1</span>);
|
||||
}</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY</p></div></div><div class="code"><div class="wrapper"> ResultPrinter::printResult(<span class="hljs-string">"List All Credit Cards"</span>, <span class="hljs-string">"CreditCardList"</span>, <span class="hljs-keyword">null</span>, <span class="hljs-variable">$params</span>, <span class="hljs-variable">$cards</span>);
|
||||
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-variable">$card</span>;</div></div></div></div></body></html>
|
||||
@@ -879,6 +879,17 @@ if (PHP_SAPI == 'cli') {
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-md-8"><h5>Credit Card - List All</h5></div>
|
||||
<div class="col-md-4">
|
||||
<a href="vault/ListCreditCards.php" class="btn btn-primary pull-left execute"> Try It <i
|
||||
class="fa fa-play-circle-o"></i></a>
|
||||
<a href="doc/vault/ListCreditCards.html" class="btn btn-default pull-right">Source <i
|
||||
class="fa fa-file-code-o"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-md-8"><h5>Credit Card - Update</h5></div>
|
||||
|
||||
@@ -22,6 +22,17 @@ $card->setType("visa")
|
||||
->setFirstName("Joe")
|
||||
->setLastName("Shopper");
|
||||
|
||||
// ### Additional Information
|
||||
// Now you can also store the information that could help you connect
|
||||
// your users with the stored credit cards.
|
||||
// All these three fields could be used for storing any information that could help merchant to point the card.
|
||||
// However, Ideally, MerchantId could be used to categorize stores, apps, websites, etc.
|
||||
// ExternalCardId could be used for uniquely identifying the card per MerchantId. So, combination of "MerchantId" and "ExternalCardId" should be unique.
|
||||
// ExternalCustomerId could be userId, user email, etc to group multiple cards per user.
|
||||
$card->setMerchantId("MyStore1");
|
||||
$card->setExternalCardId("CardNumber123" . uniqid());
|
||||
$card->setExternalCustomerId("123123-myUser1@something.com");
|
||||
|
||||
// For Sample Purposes Only.
|
||||
$request = clone $card;
|
||||
|
||||
|
||||
36
sample/vault/ListCreditCards.php
Normal file
36
sample/vault/ListCreditCards.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// # List Credit Card Sample
|
||||
// The CreditCard resource allows you to
|
||||
// retrieve all previously saved CreditCards.
|
||||
// API called: '/v1/vault/credit-cards'
|
||||
// Documentation: https://developer.paypal.com/webapps/developer/docs/api/#list-credit-card-resources
|
||||
|
||||
// Creating a Credit Card just in case
|
||||
/** @var CreditCard $card */
|
||||
$card = require 'CreateCreditCard.php';
|
||||
|
||||
use PayPal\Api\CreditCard;
|
||||
|
||||
/// ### List All Credit Cards
|
||||
// (See bootstrap.php for more on `ApiContext`)
|
||||
try {
|
||||
// ### Parameters to Filter
|
||||
// There are many possible filters that you could apply to it. For complete list, please refere to developer docs at above link.
|
||||
|
||||
$params = array(
|
||||
"sort_by" => "create_time",
|
||||
"sort_order" => "desc",
|
||||
"merchant_id" => "MyStore1" // Filtering by MerchantId set during CreateCreditCard.
|
||||
);
|
||||
$cards = CreditCard::all($params, $apiContext);
|
||||
} catch (Exception $ex) {
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printError("List All Credit Cards", "CreditCardList", null, $params, $ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
|
||||
ResultPrinter::printResult("List All Credit Cards", "CreditCardList", null, $params, $cards);
|
||||
|
||||
return $card;
|
||||
Reference in New Issue
Block a user