diff --git a/README.md b/README.md index fcb73bba..25540fe4 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,11 @@ __Welcome to PayPal PHP SDK__. This repository contains PayPal's PHP SDK and sam - PHP 5.3 or above - [curl](https://secure.php.net/manual/en/book.curl.php), [json](https://secure.php.net/manual/en/book.json.php) & [openssl](https://secure.php.net/manual/en/book.openssl.php) extensions must be enabled + +## Direct Credit Card Support +[Braintree Direct](https://www.braintreepayments.com/products/braintree-direct) is PayPal's preferred integration solution for accepting direct credit card payments in your mobile app or website. Braintree, a PayPal service, is the easiest way to accept credit cards, PayPal, and many other payment methods. + + ## License Read [License](LICENSE) for more licensing information. diff --git a/sample/billing/CreateBillingAgreementWithCreditCard.php b/sample/billing/CreateBillingAgreementWithCreditCard.php deleted file mode 100644 index 0eadee1a..00000000 --- a/sample/billing/CreateBillingAgreementWithCreditCard.php +++ /dev/null @@ -1,111 +0,0 @@ -setName('DPRP') - ->setDescription('Payment with credit Card') - ->setStartDate('2019-06-17T9:45:04Z'); - -// Add Plan ID -// Please note that the plan Id should be only set in this case. -$plan = new Plan(); -$plan->setId($createdPlan->getId()); -$agreement->setPlan($plan); - -// Add Payer -$payer = new Payer(); -$payer->setPaymentMethod('credit_card') - ->setPayerInfo(new PayerInfo(array('email' => 'jaypatel512-facilitator@hotmail.com'))); - -// Add Credit Card to Funding Instruments -$card = new CreditCard(); -$card->setType('visa') - ->setNumber('4491759698858890') - ->setExpireMonth('12') - ->setExpireYear('2017') - ->setCvv2('128'); - -$fundingInstrument = new FundingInstrument(); -$fundingInstrument->setCreditCard($card); -$payer->setFundingInstruments(array($fundingInstrument)); -//Add Payer to Agreement -$agreement->setPayer($payer); - -// Add Shipping Address -$shippingAddress = new ShippingAddress(); -$shippingAddress->setLine1('111 First Street') - ->setCity('Saratoga') - ->setState('CA') - ->setPostalCode('95070') - ->setCountryCode('US'); -$agreement->setShippingAddress($shippingAddress); - -// For Sample Purposes Only. -$request = clone $agreement; - -// ### Create Agreement -try { - // Please note that as the agreement has not yet activated, we wont be receiving the ID just yet. - $agreement = $agreement->create($apiContext); -} catch (Exception $ex) { - // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printError("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $ex); - exit(1); -} - - // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY - ResultPrinter::printResult("Created Billing Agreement.", "Agreement", $agreement->getId(), $request, $agreement); - -return $agreement; diff --git a/sample/doc/billing/CreateBillingAgreementWithCreditCard.html b/sample/doc/billing/CreateBillingAgreementWithCreditCard.html deleted file mode 100644 index e833cd26..00000000 --- a/sample/doc/billing/CreateBillingAgreementWithCreditCard.html +++ /dev/null @@ -1,81 +0,0 @@ -
Retrieving the Plan from the Create Update Sample. This would be used to -define Plan information to create an agreement. Make sure the plan you are using is in active state.
Add Plan ID -Please note that the plan Id should be only set in this case.
Add Payer
Add Credit Card to Funding Instruments
Add Shipping Address
For Sample Purposes Only.
Please note that as the agreement has not yet activated, we wont be receiving the ID just yet.
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
This sample code demonstrates how you can capture a previously authorized payment. API used: /v1/payments/payment -https://developer.paypal.com/webapps/developer/docs/api/#capture-an-authorization
Replace $authorizationId with any static Id you might already have.
You can capture and process a previously created authorization
by invoking the $authorization->capture method
-with a valid ApiContext (See bootstrap.php for more on ApiContext
)
ApiContext
)Retrieve the authorization
NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
Create Billing Agreement with Credit Card as Payment Source
-This sample code demonstrate how you can create a billing agreement, as documented here at: -https://developer.paypal.com/webapps/developer/docs/api/#create-an-agreement -API used: /v1/payments/billing-agreements