PHP Class PayPal\Api\CreditCard

Inheritance: extends PayPal\Common\PayPalResourceModel
Datei anzeigen Open project: paypal/rest-api-sdk-php Class Usage Examples

Public Methods

Method Description
all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : PayPal\Api\CreditCardList Retrieves a list of Credit Card resources.
create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : CreditCard Creates a new Credit Card Resource (aka Tokenize).
delete ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean Delete the Credit Card resource for the given identifier.
get ( string $creditCardId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : CreditCard Obtain the Credit Card resource for the given identifier.
getBillingAddress ( ) : Address Billing Address associated with this card.
getCreateTime ( ) : string Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates creation time.
getCvv2 ( ) : string 3-4 digit card validation code.
getExpireMonth ( ) : integer Expiration month with no leading zero. Acceptable values are 1 through 12.
getExpireYear ( ) : integer 4-digit expiration year.
getExternalCardId ( ) : string A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
getExternalCustomerId ( ) : string A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of payer_id when creating or using a stored funding instrument in the vault.**
getFirstName ( ) : string Cardholder's first name.
getId ( ) : string ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
getLastName ( ) : string Cardholder's last name.
getMerchantId ( ) : string A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
getNumber ( ) : string Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
getPayerId ( ) : string A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.
getState ( ) : string State of the credit card funding instrument.
getType ( ) : string Credit card type. Valid types are: visa, mastercard, discover, amex
getUpdateTime ( ) : string Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
getValidUntil ( ) : string Funding instrument expiration date.
setBillingAddress ( Address $billing_address ) Billing Address associated with this card.
setCreateTime ( string $create_time ) Funding instrument expiration date.
setCvv2 ( string $cvv2 ) 3-4 digit card validation code.
setExpireMonth ( integer $expire_month ) Expiration month with no leading zero. Acceptable values are 1 through 12.
setExpireYear ( integer $expire_year ) 4-digit expiration year.
setExternalCardId ( string $external_card_id ) A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
setExternalCustomerId ( string $external_customer_id ) A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of payer_id when creating or using a stored funding instrument in the vault.**
setFirstName ( string $first_name ) Cardholder's first name.
setId ( string $id ) ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
setLastName ( string $last_name ) Cardholder's last name.
setMerchantId ( string $merchant_id ) A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
setNumber ( string $number ) Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
setPayerId ( string $payer_id ) A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.
setState ( string $state ) State of the credit card funding instrument.
setType ( string $type ) Credit card type. Valid types are: visa, mastercard, discover, amex
setUpdateTime ( string $update_time ) Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
setValidUntil ( string $valid_until ) Date/Time until this resource can be used fund a payment.
update ( PatchRequest $patchRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : CreditCard Update information in a previously saved card. Only the modified fields need to be passed in the request.

Method Details

all() public static method

Retrieves a list of Credit Card resources.
public static all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : PayPal\Api\CreditCardList
$params array
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return PayPal\Api\CreditCardList

create() public method

Creates a new Credit Card Resource (aka Tokenize).
public create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : CreditCard
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return CreditCard

delete() public method

Delete the Credit Card resource for the given identifier.
public delete ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return boolean

get() public static method

Obtain the Credit Card resource for the given identifier.
public static get ( string $creditCardId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : CreditCard
$creditCardId string
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return CreditCard

getBillingAddress() public method

Billing Address associated with this card.
public getBillingAddress ( ) : Address
return Address

getCreateTime() public method

Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates creation time.
public getCreateTime ( ) : string
return string

getCvv2() public method

3-4 digit card validation code.
public getCvv2 ( ) : string
return string

getExpireMonth() public method

Expiration month with no leading zero. Acceptable values are 1 through 12.
public getExpireMonth ( ) : integer
return integer

getExpireYear() public method

4-digit expiration year.
public getExpireYear ( ) : integer
return integer

getExternalCardId() public method

A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
public getExternalCardId ( ) : string
return string

getExternalCustomerId() public method

A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of payer_id when creating or using a stored funding instrument in the vault.**
public getExternalCustomerId ( ) : string
return string

getFirstName() public method

Cardholder's first name.
public getFirstName ( ) : string
return string

getId() public method

ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
Deprecation: Not publicly available
public getId ( ) : string
return string

getLastName() public method

Cardholder's last name.
public getLastName ( ) : string
return string

getMerchantId() public method

A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
public getMerchantId ( ) : string
return string

getNumber() public method

Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
public getNumber ( ) : string
return string

getPayerId() public method

A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.
Deprecation: This is being deprecated in favor of the `external_customer_id` property.
public getPayerId ( ) : string
return string

getState() public method

State of the credit card funding instrument.
public getState ( ) : string
return string

getType() public method

Credit card type. Valid types are: visa, mastercard, discover, amex
public getType ( ) : string
return string

getUpdateTime() public method

Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
public getUpdateTime ( ) : string
return string

getValidUntil() public method

Funding instrument expiration date.
public getValidUntil ( ) : string
return string

setBillingAddress() public method

Billing Address associated with this card.
public setBillingAddress ( Address $billing_address )
$billing_address Address

setCreateTime() public method

Funding instrument expiration date.
public setCreateTime ( string $create_time )
$create_time string

setCvv2() public method

3-4 digit card validation code.
public setCvv2 ( string $cvv2 )
$cvv2 string

setExpireMonth() public method

Expiration month with no leading zero. Acceptable values are 1 through 12.
public setExpireMonth ( integer $expire_month )
$expire_month integer

setExpireYear() public method

4-digit expiration year.
public setExpireYear ( integer $expire_year )
$expire_year integer

setExternalCardId() public method

A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant.
public setExternalCardId ( string $external_card_id )
$external_card_id string

setExternalCustomerId() public method

A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of payer_id when creating or using a stored funding instrument in the vault.**
public setExternalCustomerId ( string $external_customer_id )
$external_customer_id string

setFirstName() public method

Cardholder's first name.
public setFirstName ( string $first_name )
$first_name string

setId() public method

ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.**
Deprecation: Not publicly available
public setId ( string $id )
$id string

setLastName() public method

Cardholder's last name.
public setLastName ( string $last_name )
$last_name string

setMerchantId() public method

A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id
public setMerchantId ( string $merchant_id )
$merchant_id string

setNumber() public method

Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.*
public setNumber ( string $number )
$number string

setPayerId() public method

A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.
Deprecation: This is being deprecated in favor of the `external_customer_id` property.
public setPayerId ( string $payer_id )
$payer_id string

setState() public method

Valid Values: ["expired", "ok"]
public setState ( string $state )
$state string

setType() public method

Credit card type. Valid types are: visa, mastercard, discover, amex
public setType ( string $type )
$type string

setUpdateTime() public method

Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time.
public setUpdateTime ( string $update_time )
$update_time string

setValidUntil() public method

Date/Time until this resource can be used fund a payment.
public setValidUntil ( string $valid_until )
$valid_until string

update() public method

Update information in a previously saved card. Only the modified fields need to be passed in the request.
public update ( PatchRequest $patchRequest, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : CreditCard
$patchRequest PatchRequest
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return CreditCard