forked from LiveCarta/PayPal-PHP-SDK
Use PaymentCard instead of CreditCard
- Fixed deprecation messages. - Fixes #639. - Fixes #648. - Updated Samples.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user