Skip to content

Commit

Permalink
Showing 13 changed files with 387 additions and 41 deletions.
92 changes: 91 additions & 1 deletion src/Builders/AuthorizationBuilder.php
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
namespace GlobalPayments\Api\Builders;

use GlobalPayments\Api\Entities\Address;
use GlobalPayments\Api\Entities\AutoSubstantiation;
use GlobalPayments\Api\Entities\EcommerceInfo;
use GlobalPayments\Api\Entities\HostedPaymentData;
use GlobalPayments\Api\Entities\Enums\AddressType;
@@ -78,6 +79,9 @@ class AuthorizationBuilder extends TransactionBuilder
*/
public $authAmount;

/** @var AutoSubstantiation */
public $autoSubstantiation;

/**
* Balance inquiry type
*
@@ -396,6 +400,38 @@ class AuthorizationBuilder extends TransactionBuilder
*/
public $verifyAddress;

/**
* For TransIT cash amount for a specified transaction
* Note: If a decimal point is included, the amount reflects a dollar value.
* If a decimal point is not included, the amount reflects a cent value.
*
* @internal
* @var string
*/
public $cashTendered;

/**
* For TransIT transaction discount details
*
* @internal
* @var string
*/
public $discountDetails;

/*
* Card on File field
* @var string
*
*/
public $cardBrandTransactionId;

/*
* Card on File field
* @var string
*
*/
public $transactionInitiator;

/**
* {@inheritdoc}
*
@@ -612,6 +648,19 @@ public function withAuthAmount($authAmount)
return $this;
}

/**
* Sets the auto substantiation values for the transaction
*
* @param AutoSubstantiation
*
* @return AuthorizationBuilder
*/
public function withAutoSubstantiation($autoSubstantiation)
{
$this->autoSubstantiation = $autoSubstantiation;
return $this;
}

/**
* Set the request's balance inquiry type
*
@@ -1024,7 +1073,7 @@ public function withDccType($value)
*/
public function withConvenienceAmount($convenienceAmount)
{
$this->convenienceAmount = $convenienceAmount ;
$this->convenienceAmount = $convenienceAmount;
return $this;
}

@@ -1114,4 +1163,45 @@ public function withScheduleId($scheduleId)
$this->scheduleId = $scheduleId;
return $this;
}

/**
* Set the associated schedule ID
*
* @param string $scheduleId
*
* @return AuthorizationBuilder
*/
public function withDiscountDetails($discountDetails)
{
$this->discountDetails = $discountDetails;
return $this;
}

/**
* Set the cash tendered amount
*
* @param string $cashTendered
*
* @return AuthorizationBuilder
*/
public function withCashTenderedDetails($cashTendered)
{
$this->cashTendered = $cashTendered;
return $this;
}

/**
* Set the Card on File storage
*
* @param string $transactionInitiator
* @param string $value
*
* @return AuthorizationBuilder
*/
public function withCardBrandStorage($transactionInitiator, $value = '')
{
$this->transactionInitiator = $transactionInitiator;
$this->cardBrandTransactionId = $value;
return $this;
}
}
16 changes: 15 additions & 1 deletion src/Builders/Secure3dBuilder.php
Original file line number Diff line number Diff line change
@@ -50,6 +50,8 @@ class Secure3dBuilder extends BaseBuilder
public $billingAddress;
/** @var BrowserData */
public $browserData;
/** @var ChallengeRequestIndicator */
public $challengeRequestIndicator;
/** @var string */
public $currency;
/** @var string */
@@ -240,6 +242,11 @@ public function getBrowserData()
return $this->browserData;
}
/** @return string */
public function getChallengeRequestIndicator()
{
return $this->challengeRequestIndicator;
}
/** @return string */
public function getCurrency()
{
return $this->currency;
@@ -681,6 +688,13 @@ public function withBrowserData($value)
return $this;
}

/** @return Secure3dBuilder */
public function withChallengeRequestIndicator($challengeRequestIndicator)
{
$this->challengeRequestIndicator = $challengeRequestIndicator;
return $this;
}

/** @return Secure3dBuilder */
public function withCustomerAccountId($customerAccountId)
{
@@ -1155,7 +1169,7 @@ public function execute($version = Secure3dVersion::ANY)
// check the response
if (!empty($response)) {
switch ($this->transactionType) {
case TransactionType::VERIFY_ENROLLED:
case TransactionType::VERIFY_ENROLLED:
if (!empty($response->threeDSecure)) {
$rvalue = $response->threeDSecure;
if ((bool)$rvalue->enrolled) {
19 changes: 19 additions & 0 deletions src/Entities/Enums/Secure3dPaymentDataSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
namespace GlobalPayments\Api\Entities\Enums;

use GlobalPayments\Api\Entities\Enum;

class Secure3dPaymentDataSource extends Enum
{
const AMEX_3DSECURE = 'AMEX 3DSecure';
const APPLEPAY = 'ApplePay';
const APPLEPAYAPP = 'ApplePayApp';
const APPLEPAYWEB = 'ApplePayWeb';
const GOOGLEPAYAPP = 'GooglePayApp';
const GOOGLEPAYWEB = 'GooglePayWeb';
const DISCOVER_3DSECURE = 'Discover 3DSecure';
const MASTERCARD_3DSECURE = 'MasterCard 3DSecure';
const VISA_3DSECURE = 'Visa 3DSecure';
const UPEXPRESS_3DSECURE = 'UPExpress 3DSecure';
const UPSECUREPLUS_3DSECURE = 'UPSecurePlus 3DSecure';
}
20 changes: 20 additions & 0 deletions src/Entities/Transaction.php
Original file line number Diff line number Diff line change
@@ -114,6 +114,13 @@ class Transaction
*/
public $emvIssuerResponse;

/**
* The host response date
*
* @var DateTime
*/
public $hostResponseDate;

/**
* The remaining points on the account after the transaction.
*
@@ -224,6 +231,19 @@ class Transaction
public $avsAddressResponse;

public $alternativePaymentResponse;

public $customerReceipt;

public $merchantReceipt;

public $transactionKey;

/*
* Card on File field response
* @var string
*
*/
public $cardBrandTransactionId;

/**
* Creates a `Transaction` object from a stored transaction ID.
7 changes: 5 additions & 2 deletions src/Gateways/Gp3DSProvider.php
Original file line number Diff line number Diff line change
@@ -139,6 +139,7 @@ public function processSecure3d(Secure3dBuilder $builder)
$request = $this->maybeSetKey($request, 'merchant_id', $this->merchantId);
$request = $this->maybeSetKey($request, 'account_id', $this->accountId);
$request = $this->maybeSetKey($request, 'challenge_notification_url', $this->challengeNotificationUrl);
$request = $this->maybeSetKey($request, 'challenge_request_indicator', $builder->getChallengeRequestIndicator());
$request = $this->maybeSetKey($request, 'method_url_completion', $builder->getMethodUrlCompletion());
$request = $this->maybeSetKey($request, 'merchant_contact_url', $this->merchantContactUrl);
$request = $this->maybeSetKey($request, 'merchant_initiated_request_type', $builder->getMerchantInitiatedRequestType());
@@ -153,7 +154,8 @@ public function processSecure3d(Secure3dBuilder $builder)
$request['card_detail'] = $this->maybeSetKey($request['card_detail'], 'number', $cardData->number);
$request['card_detail'] = $this->maybeSetKey($request['card_detail'], 'scheme', strtoupper($cardData->getCardType()));
$request['card_detail'] = $this->maybeSetKey($request['card_detail'], 'expiry_month', $cardData->expMonth);
$request['card_detail'] = $this->maybeSetKey($request['card_detail'], 'expiry_year', substr($cardData->expYear, 2));
$request['card_detail'] = $this->maybeSetKey($request['card_detail'], 'expiry_year',
substr(str_pad($cardData->expYear, 4, '0', STR_PAD_LEFT), 2, 2));
$request['card_detail'] = $this->maybeSetKey($request['card_detail'], 'full_name', $cardData->cardHolderName);

if (!empty($cardData->cardHolderName)) {
@@ -310,7 +312,8 @@ public function processSecure3d(Secure3dBuilder $builder)
$request['sdk_information'] = [];
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'application_id', $builder->getApplicationId());
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'ephemeral_public_key', $builder->getEphemeralPublicKey());
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'maximum_timeout', $builder->getMaximumTimeout());
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'maximum_timeout',
(!empty($builder->getMaximumTimeout())) ? str_pad($builder->getMaximumTimeout(), 2, '0' , STR_PAD_LEFT) : '');
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'reference_number', $builder->getReferenceNumber());
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'sdk_trans_id', $builder->getSdkTransactionId());
$request['sdk_information'] = $this->maybeSetKey($request['sdk_information'], 'encoded_data', $builder->getEncodedData());
Loading

0 comments on commit 44cefbf

Please sign in to comment.