Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions lib/Checkout/Payments/Setups/Common/Customer/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,66 @@

use Checkout\Common\Phone;

/**
* The customer's details.
*/
class Customer
{
/**
* Details of the customer's email.
* [Optional]
* @var Email
*/
public $email;

/**
* The customer's full name.
* [Optional]
* max 100 characters
* @var string
*/
public $name;

/**
* The customer's phone number.
* [Optional]
* @var Phone
*/
public $phone;

/**
* Details of the customer's device.
* [Optional]
* @var Device
*/
public $device;

/**
* Details of the account the customer holds with the merchant.
* [Optional]
* @var MerchantAccount
*/
public $merchant_account;

/**
* The unique identifier of the customer.
* [Optional]
* @var string
*/
public $id;

/**
* The two-letter ISO country code of the customer for this payment.
* [Optional]
* min 2 characters, max 2 characters
* @var string value of Country
*/
public $country;

/**
* The customer's tax identification number.
* [Optional]
* @var string
*/
public $tax_number;

Check warning on line 68 in lib/Checkout/Payments/Setups/Common/Customer/Customer.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$tax_number" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXT1M-LKsyhE77n8&open=AaEWrXT1M-LKsyhE77n8&pullRequest=389
}
42 changes: 42 additions & 0 deletions lib/Checkout/Payments/Setups/Common/Customer/Device.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,52 @@

namespace Checkout\Payments\Setups\Common\Customer;

/**
* Details of the customer's device.
*/
class Device
{
/**
* The locale of the device.
* [Optional]
* @var string
*/
public $locale;

/**
* A unique identifier for the customer's device.
* [Optional]
* @var string
*/
public $fingerprint;

/**
* The customer's device IPv4 address, used by some payment methods for risk and eligibility checks.
* [Optional]
* @var string
*/
public $ipv4;

/**
* The customer's device IPv6 address, used by some payment methods for risk and eligibility checks.
* [Optional]
* @var string
*/
public $ipv6;

/**
* The type of client the customer uses to initiate the payment. Required when using Cash App Pay.
* [Optional]
* Enum: "web" "mobile_web" "app"
* @var string value of DeviceClient
*/
public $client;

/**
* The operating system of the customer's device.
* [Optional]
* Enum: "android" "ios"
* @var string value of DeviceOs
*/
public $os;
}
27 changes: 27 additions & 0 deletions lib/Checkout/Payments/Setups/Common/Customer/DeviceClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Checkout\Payments\Setups\Common\Customer;

/**
* The type of client the customer uses to initiate the payment.
*/
class DeviceClient
{
/**
* A web browser on a desktop device.
* @var string
*/
public static $web = "web";

/**
* A web browser on a mobile device.
* @var string
*/
public static $mobile_web = "mobile_web";

Check warning on line 20 in lib/Checkout/Payments/Setups/Common/Customer/DeviceClient.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$mobile_web" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXQWM-LKsyhE77n7&open=AaEWrXQWM-LKsyhE77n7&pullRequest=389

/**
* A native mobile application.
* @var string
*/
public static $app = "app";
}
21 changes: 21 additions & 0 deletions lib/Checkout/Payments/Setups/Common/Customer/DeviceOs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Checkout\Payments\Setups\Common\Customer;

/**
* The operating system of the customer's device.
*/
class DeviceOs
{
/**
* Android.
* @var string
*/
public static $android = "android";

/**
* iOS.
* @var string
*/
public static $ios = "ios";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Checkout\Payments\Setups\Common\PaymentMethods\CashApp;

use Checkout\Payments\Setups\Common\PaymentMethods\Common\PaymentMethodBase;

/**
* The Cash App payment method's details and configuration.
*
* Inherits status, flags and initialization from PaymentMethodBase. Send initialization and
* customer_profile_sharing; the remaining properties are returned by the API only. To authorize the
* payment, send the customer to the redirect URL returned in the action. The customer device client
* (customer.device.client) is required when using this payment method.
*/
class CashApp extends PaymentMethodBase
{
/**
* Indicates whether the customer consents to share their Cash App customer profile with Checkout.com.
* [Optional]
* @var bool
*/
public $customer_profile_sharing;

Check warning on line 22 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashApp.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$customer_profile_sharing" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUDM-LKsyhE77oH&open=AaEWrXUDM-LKsyhE77oH&pullRequest=389

/**
* The customer's Cash App profile that they consented to share. Included in the response when
* customer_profile_sharing is enabled.
* Cash App releases this profile only once. It's present in the first successful response when you get
* the Payment Setup after the customer authorizes the payment. Every subsequent response omits it.
* [Optional]
* readOnly
* @var CashAppCustomerProfile
*/
public $customer_profile;

Check warning on line 33 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashApp.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$customer_profile" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUDM-LKsyhE77oI&open=AaEWrXUDM-LKsyhE77oI&pullRequest=389

/**
* A reference for the Cash App Pay transaction, returned by the provider.
* [Optional]
* readOnly
* max 80 characters
* @var string
*/
public $reference;

/**
* The next available action for the payment method.
* [Optional]
* readOnly
* @var CashAppAction
*/
public $action;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Checkout\Payments\Setups\Common\PaymentMethods\CashApp;

/**
* The next available action for the Cash App payment method (response only).
*/
class CashAppAction
{
/**
* The type of action.
* [Optional]
* readOnly
* Enum: "redirect"
* @var string value of CashAppActionType
*/
public $type;

/**
* The URL to redirect the customer to so they can authorize the payment with Cash App.
* [Optional]
* readOnly
* Format: uri
* @var string
*/
public $redirect_url;

Check warning on line 26 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashAppAction.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$redirect_url" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUKM-LKsyhE77oJ&open=AaEWrXUKM-LKsyhE77oJ&pullRequest=389
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Checkout\Payments\Setups\Common\PaymentMethods\CashApp;

/**
* The type of the Cash App payment method action.
*/
class CashAppActionType
{
/**
* Redirect the customer to Cash App to authorize the payment.
* @var string
*/
public static $redirect = "redirect";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

namespace Checkout\Payments\Setups\Common\PaymentMethods\CashApp;

/**
* The address in a Cash App customer profile (response only).
*
* Uses Cash App's own key names (address_line_1, administrative_district_level_1), which differ from the
* Checkout.com Address (address_line1, city, state, zip). Do not replace it with the common Address.
*/
class CashAppAddress
{
/**
* The first line of the address.
* [Optional]
* readOnly
* @var string
*/
public $address_line_1;

Check warning on line 19 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashAppAddress.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$address_line_1" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUTM-LKsyhE77oK&open=AaEWrXUTM-LKsyhE77oK&pullRequest=389

/**
* The second line of the address.
* [Optional]
* readOnly
* @var string
*/
public $address_line_2;

Check warning on line 27 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashAppAddress.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$address_line_2" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUTM-LKsyhE77oL&open=AaEWrXUTM-LKsyhE77oL&pullRequest=389

/**
* The third line of the address.
* [Optional]
* readOnly
* @var string
*/
public $address_line_3;

Check warning on line 35 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashAppAddress.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$address_line_3" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUTM-LKsyhE77oM&open=AaEWrXUTM-LKsyhE77oM&pullRequest=389

/**
* The address locality, such as the city or town.
* [Optional]
* readOnly
* @var string
*/
public $locality;

/**
* The address sublocality, such as the district or neighborhood.
* [Optional]
* readOnly
* @var string
*/
public $sublocality;

/**
* The address's top-level administrative district, such as the state or province.
* [Optional]
* readOnly
* @var string
*/
public $administrative_district_level_1;

Check warning on line 59 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashAppAddress.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$administrative_district_level_1" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUTM-LKsyhE77oN&open=AaEWrXUTM-LKsyhE77oN&pullRequest=389

/**
* The postal or zip code.
* [Optional]
* readOnly
* @var string
*/
public $postal_code;

Check warning on line 67 in lib/Checkout/Payments/Setups/Common/PaymentMethods/CashApp/CashAppAddress.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "$postal_code" to match the regular expression ^[a-z][a-zA-Z0-9]*$.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-php&issues=AaEWrXUTM-LKsyhE77oO&open=AaEWrXUTM-LKsyhE77oO&pullRequest=389

/**
* The address country, in ISO 3166-1 alpha-2 format.
* [Optional]
* readOnly
* max 2 characters
* @var string value of Country
*/
public $country;
}
Loading
Loading