Minor Fixes to Sample

This commit is contained in:
Jay Patel
2015-03-16 12:31:51 -05:00
parent 124c122fff
commit 104fad61bb
4 changed files with 196 additions and 299 deletions

View File

@@ -310,7 +310,104 @@ 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/CreateInvoice",
"title": "CreateInvoice"
},
"depth": 2
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "Create Invoice Sample",
"slug": "create-invoice-sample"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "Invoice Info",
"slug": "invoice-info"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Merchant Info",
"slug": "merchant-info"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Address Information",
"slug": "address-information"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Billing Information",
"slug": "billing-information"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Items List",
"slug": "items-list"
},
"depth": 3,
"children": [
{
"type": "heading",
"data": {
"level": 4,
"title": "Tax Item",
"slug": "tax-item"
},
"depth": 4
}, {
"type": "heading",
"data": {
"level": 4,
"title": "Tax Item",
"slug": "tax-item"
},
"depth": 4
}
]
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Shipping Information",
"slug": "shipping-information"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Logo",
"slug": "logo"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Create Invoice",
"slug": "create-invoice"
},
"depth": 3
}
]
}
]
}, {
"type": "file",
"data": {
@@ -554,18 +651,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": {
@@ -595,6 +681,73 @@ 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
"depth": 1,
"children": [
{
"type": "file",
"data": {
"language": {
"nameMatchers": [{}, ".fbp"],
"pygmentsLexer": "php",
"singleLineComment": ["//"],
"ignorePrefix": "}",
"foldPrefix": "^",
"name": "PHP"
},
"sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/notifications/CreateWebhook.php",
"projectPath": "notifications/CreateWebhook.php",
"targetPath": "notifications/CreateWebhook",
"pageTitle": "notifications/CreateWebhook",
"title": "CreateWebhook"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "Create Webhook Sample",
"slug": "create-webhook-sample"
},
"depth": 1
}, {
"type": "heading",
"data": {
"level": 1,
"title": "Basic Information",
"slug": "basic-information"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 4,
"title": "NOTE: Please note that you need an https url for paypal webhooks. You can however override the url with https, and accept",
"slug": "note-please-note-that-you-need-an-https-url-for-paypal-webhooks-you-can-however-override-the-url-with-https-and-accept"
},
"depth": 4
}
]
}, {
"type": "heading",
"data": {
"level": 1,
"title": "Event Types",
"slug": "event-types"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "Create Webhook",
"slug": "create-webhook"
},
"depth": 3
}
]
}
]
}, {
"type": "file",
"data": {
"language": {
@@ -738,24 +891,6 @@ 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
"title": "WebhookEventTypesList"
},
"depth": 2
}, {
"type": "file",
"data": {
"language": {
"nameMatchers": [{}, ".fbp"],
"pygmentsLexer": "php",
"singleLineComment": ["//"],
"ignorePrefix": "}",
"foldPrefix": "^",
"name": "PHP"
},
"sourcePath": "/Users/japatel/Documents/workspace/paypal/PayPal-PHP-SDK/sample/notifications/createWebhook.php",
"projectPath": "notifications/createWebhook.php",
"targetPath": "notifications/createWebhook",
"pageTitle": "notifications/createWebhook",
"title": "createWebhook"
},
"depth": 2
}
]
}, {
@@ -901,29 +1036,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/AuthorizationCapture",
"title": "AuthorizationCapture"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "AuthorizationCapture",
"slug": "authorizationcapture"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "Capture Payment",
"slug": "capture-payment"
},
"depth": 3
}
]
}
]
"depth": 2
}, {
"type": "file",
"data": {
@@ -941,29 +1054,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/AuthorizePayment",
"title": "AuthorizePayment"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "Authorize Payment",
"slug": "authorize-payment"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "Create Payment",
"slug": "create-payment"
},
"depth": 3
}
]
}
]
"depth": 2
}, {
"type": "file",
"data": {
@@ -1017,93 +1108,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/CreatePayment",
"title": "CreatePayment"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "CreatePaymentSample",
"slug": "createpaymentsample"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "CreditCard",
"slug": "creditcard"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "FundingInstrument",
"slug": "fundinginstrument"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Payer",
"slug": "payer"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Itemized information",
"slug": "itemized-information"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Additional payment details",
"slug": "additional-payment-details"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Amount",
"slug": "amount"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Transaction",
"slug": "transaction"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Payment",
"slug": "payment"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Create Payment",
"slug": "create-payment"
},
"depth": 3
}
]
}
]
"depth": 2
}, {
"type": "file",
"data": {
@@ -1121,93 +1126,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/CreatePaymentUsingPayPal",
"title": "CreatePaymentUsingPayPal"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "Create Payment using PayPal as payment method",
"slug": "create-payment-using-paypal-as-payment-method"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "Payer",
"slug": "payer"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Itemized information",
"slug": "itemized-information"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Additional payment details",
"slug": "additional-payment-details"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Amount",
"slug": "amount"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Transaction",
"slug": "transaction"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Redirect urls",
"slug": "redirect-urls"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Payment",
"slug": "payment"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Create Payment",
"slug": "create-payment"
},
"depth": 3
}, {
"type": "heading",
"data": {
"level": 3,
"title": "Get redirect url",
"slug": "get-redirect-url"
},
"depth": 3
}
]
}
]
"depth": 2
}, {
"type": "file",
"data": {
@@ -1261,29 +1180,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/GetAuthorization",
"title": "GetAuthorization"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "GetAuthorization",
"slug": "getauthorization"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "GetAuthorization",
"slug": "getauthorization"
},
"depth": 3
}
]
}
]
"depth": 2
}, {
"type": "file",
"data": {
@@ -1301,29 +1198,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/GetCapture",
"title": "GetCapture"
},
"depth": 2,
"outline": [
{
"type": "heading",
"data": {
"level": 1,
"title": "GetCapture",
"slug": "getcapture"
},
"depth": 1,
"children": [
{
"type": "heading",
"data": {
"level": 3,
"title": "Retrieve Capture details",
"slug": "retrieve-capture-details"
},
"depth": 3
}
]
}
]
"depth": 2
}, {
"type": "file",
"data": {

View File

@@ -40,7 +40,18 @@ used to identify merchant</p></div></div><div class="code"><div class="wrapper">
-&gt;setCountryCode(<span class="hljs-string">"US"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="billing-information">Billing Information</h3>
<p>Set the email address for each billing</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$billing</span> = <span class="hljs-variable">$invoice</span>-&gt;getBillingInfo();
<span class="hljs-variable">$billing</span>[<span class="hljs-number">0</span>]
-&gt;setEmail(<span class="hljs-string">"example@example.com"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="items-list">Items List</h3>
-&gt;setEmail(<span class="hljs-string">"example@example.com"</span>);
<span class="hljs-variable">$billing</span>[<span class="hljs-number">0</span>]-&gt;setBusinessName(<span class="hljs-string">"Jay Inc"</span>)
-&gt;setAdditionalInfo(<span class="hljs-string">"This is the billing Info"</span>)
-&gt;setAddress(<span class="hljs-keyword">new</span> InvoiceAddress());
<span class="hljs-variable">$billing</span>[<span class="hljs-number">0</span>]-&gt;getAddress()
-&gt;setLine1(<span class="hljs-string">"1234 Main St."</span>)
-&gt;setCity(<span class="hljs-string">"Portland"</span>)
-&gt;setState(<span class="hljs-string">"OR"</span>)
-&gt;setPostalCode(<span class="hljs-string">"97217"</span>)
-&gt;setCountryCode(<span class="hljs-string">"US"</span>);</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h3 id="items-list">Items List</h3>
<p>You could provide the list of all items for
detailed breakdown of invoice</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$items</span> = <span class="hljs-keyword">array</span>();
<span class="hljs-variable">$items</span>[<span class="hljs-number">0</span>] = <span class="hljs-keyword">new</span> InvoiceItem();

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><title>notifications/createWebhook</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="notifications/createWebhook"><meta name="groc-project-path" content="notifications/createWebhook.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">notifications/createWebhook.php</div></div><div id="document"><div class="segment"><div class="code"><div class="wrapper"><span class="hljs-preprocessor">&lt;?php</span></div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h1 id="create-webhook-sample">Create Webhook Sample</h1>
<!DOCTYPE html><html lang="en"><head><title>notifications/CreateWebhook</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="notifications/CreateWebhook"><meta name="groc-project-path" content="notifications/CreateWebhook.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">notifications/CreateWebhook.php</div></div><div id="document"><div class="segment"><div class="code"><div class="wrapper"><span class="hljs-preprocessor">&lt;?php</span></div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h1 id="create-webhook-sample">Create Webhook Sample</h1>
<p>This sample code demonstrate how you can create a webhook, as documented here at:
<a href="https://developer.paypal.com/webapps/developer/docs/api/#create-a-webhook">https://developer.paypal.com/webapps/developer/docs/api/#create-a-webhook</a>
API used: POST /v1/notifications/webhooks</p></div></div><div class="code"><div class="wrapper"><span class="hljs-keyword">require</span> <span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">'/../bootstrap.php'</span>;</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><p>Create a new instance of Webhook object</p></div></div><div class="code"><div class="wrapper"><span class="hljs-variable">$webhook</span> = <span class="hljs-keyword">new</span> \PayPal\Api\Webhook();</div></div></div><div class="segment"><div class="comments "><div class="wrapper"><h1 id="basic-information">Basic Information</h1>

View File

@@ -58,6 +58,17 @@ $billing = $invoice->getBillingInfo();
$billing[0]
->setEmail("example@example.com");
$billing[0]->setBusinessName("Jay Inc")
->setAdditionalInfo("This is the billing Info")
->setAddress(new InvoiceAddress());
$billing[0]->getAddress()
->setLine1("1234 Main St.")
->setCity("Portland")
->setState("OR")
->setPostalCode("97217")
->setCountryCode("US");
// ### Items List
// You could provide the list of all items for
// detailed breakdown of invoice