Use PaymentCard instead of CreditCard

- Fixed deprecation messages.
- Fixes #639.
- Fixes #648.
- Updated Samples.
This commit is contained in:
Jay Patel
2016-10-17 17:12:07 -05:00
parent 3f98d9f182
commit ae31151ba3
7 changed files with 29 additions and 28 deletions

View File

@@ -12,10 +12,10 @@
$createdPlan = require 'UpdatePlan.php';
use PayPal\Api\Agreement;
use PayPal\Api\CreditCard;
use PayPal\Api\FundingInstrument;
use PayPal\Api\Payer;
use PayPal\Api\PayerInfo;
use PayPal\Api\PaymentCard;
use PayPal\Api\Plan;
use PayPal\Api\ShippingAddress;
@@ -70,15 +70,15 @@ $payer->setPaymentMethod('credit_card')
->setPayerInfo(new PayerInfo(array('email' => 'jaypatel512-facilitator@hotmail.com')));
// Add Credit Card to Funding Instruments
$creditCard = new CreditCard();
$creditCard->setType('visa')
$paymentCard = new PaymentCard();
$paymentCard->setType('visa')
->setNumber('4491759698858890')
->setExpireMonth('12')
->setExpireYear('2017')
->setCvv2('128');
$fundingInstrument = new FundingInstrument();
$fundingInstrument->setCreditCard($creditCard);
$fundingInstrument->setPaymentCard($paymentCard);
$payer->setFundingInstruments(array($fundingInstrument));
//Add Payer to Agreement
$agreement->setPayer($payer);