diff --git a/sample/common.php b/sample/common.php index 2ab665f..a75d79c 100644 --- a/sample/common.php +++ b/sample/common.php @@ -36,7 +36,7 @@ function getBaseUrl() { } /** - * Creates a new payment authorization + * Creates a new mock 'payment authorization' * * @param PayPal\Api\ApiContext apiContext * @return PayPal\Api\Authorization @@ -74,12 +74,12 @@ function createAuthorization($apiContext) { $transaction = new Transaction(); $transaction->setAmount($amount) - ->setDescription("This is the payment description."); + ->setDescription("Payment description."); $payment = new Payment(); // Setting intent to authorize creates a payment - // authorization. Setting it to sale makes an actual payment + // authorization. Setting it to sale creates actual payment $payment->setIntent("authorize") ->setPayer($payer) ->setTransactions(array($transaction)); diff --git a/sample/index.html b/sample/index.html index b90b55d..c191506 100644 --- a/sample/index.html +++ b/sample/index.html @@ -31,15 +31,19 @@
- toArray());?> -+
toArray());?>Back diff --git a/sample/payments/CreatePayment.php b/sample/payments/CreatePayment.php index 3e45a36..ccbfa76 100644 --- a/sample/payments/CreatePayment.php +++ b/sample/payments/CreatePayment.php @@ -1,8 +1,11 @@ setLine1("3909 Witmer Road") ->setLine2("Niagara Falls") @@ -41,23 +43,23 @@ $card->setType("visa") // ### FundingInstrument // A resource representing a Payer's funding instrument. -// Use a Payer ID (A unique identifier of the payer generated -// and provided by the facilitator. This is required when -// creating or using a tokenized funding instrument) -// and the `CreditCardDetails` +// For direct credit card payments, set the CreditCard +// field on this object. $fi = new FundingInstrument(); $fi->setCreditCard($card); // ### Payer // A resource representing a Payer that funds a payment -// Use the List of `FundingInstrument` and the Payment Method -// as 'credit_card' +// For direct credit card payments, set payment method +// to 'credit_card' and add an array of funding instruments. $payer = new Payer(); $payer->setPaymentMethod("credit_card") ->setFundingInstruments(array($fi)); // ### Amount -// Let's you specify a payment amount. +// Lets you specify a payment amount. +// You can also specify additional details +// such as shipping, tax. $amount = new Amount(); $amount->setCurrency("USD") ->setTotal("1.00"); @@ -65,15 +67,14 @@ $amount->setCurrency("USD") // ### Transaction // A transaction defines the contract of a // payment - what is the payment for and who -// is fulfilling it. Transaction is created with -// a `Payee` and `Amount` types +// is fulfilling it. $transaction = new Transaction(); $transaction->setAmount($amount) - ->setDescription("This is the payment description."); + ->setDescription("Payment description"); // ### Payment // A Payment Resource; create one using -// the above types and intent as 'sale' +// the above types and intent set to sale 'sale' $payment = new Payment(); $payment->setIntent("sale") ->setPayer($payer) @@ -82,7 +83,7 @@ $payment->setIntent("sale") // ### Create Payment // Create a payment by posting to the APIService // using a valid ApiContext (See bootstrap.php for more on `ApiContext`) -// The return object contains the status; +// The return object contains the state. try { $payment->create($apiContext); } catch (PayPal\Exception\PPConnectionException $ex) { @@ -92,6 +93,9 @@ try { } ?> + +
toArray());?>diff --git a/sample/payments/ListPayments.php b/sample/payments/ListPayments.php index ce60abd..6b19b3e 100644 --- a/sample/payments/ListPayments.php +++ b/sample/payments/ListPayments.php @@ -29,6 +29,9 @@ try { } ?> + +
toArray());?>diff --git a/sample/payments/Reauthorization.php b/sample/payments/Reauthorization.php index e4c42b2..7fc500c 100644 --- a/sample/payments/Reauthorization.php +++ b/sample/payments/Reauthorization.php @@ -1,6 +1,7 @@ + +
Credit Card deleted Successfully
Back diff --git a/sample/vault/GetCreditCard.php b/sample/vault/GetCreditCard.php index 6489485..c33e333 100644 --- a/sample/vault/GetCreditCard.php +++ b/sample/vault/GetCreditCard.php @@ -2,9 +2,8 @@ // # Get Credit Card Sample // The CreditCard resource allows you to -// retrieve previously saved CreditCards, -// by sending a GET request to the URI -// '/v1/vault/credit-card' +// retrieve previously saved CreditCards. +// API called: '/v1/vault/credit-card' // The following code takes you through // the process of retrieving a saved CreditCard require __DIR__ . '/../bootstrap.php'; @@ -25,8 +24,11 @@ try { } ?> + +