You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: The `debitTransaction` method will be deprecated starting from Sep 14th 2019 in favor of the new `chargeCustomerInitiatedTransaction` and `chargeMerchantInitiatedTransaction` in order to comply with the EU's PSD2 directive.
209
+
208
210
```php
209
211
$token = new \Solinor\PaymentHighway\Model\Token( $tokenId );
210
212
211
-
$transaction = new \Solinor\PaymentHighway\Model\Request\Transaction( $amount, $currency, $token );
213
+
$transaction = new \Solinor\PaymentHighway\Model\Request\Transaction( $token, $amount, $currency );
After the introduction of the European PSD2 directive the electronic payment transactions are categorised in so called customer initiated transactions (CIT) and merchant initiated transactions (MIT).
221
+
222
+
Customer initiated transactions are scenarios where the customer takes actively part in the payment process either by providing their card information or selecting a previously stored payment method. Also so-called "one-click" purchases where the transaction uses a previously saved default payment method are CITs.
223
+
224
+
Merchant initated transactions are transactions which are initated by the merchant without customer's participation. Merchant initated transactions require a prior agreement between the customer and merchant also called the "mandate". Merchant initiated transactions can be used for example in scenarios where the final price is not known at the time of the purchase or the customer is not present when the charge is made.
225
+
226
+
#### Charging a customer initiated transaction (CIT)
227
+
228
+
When charging a customer initiated transaction there is always a possibility that the card issuer requires strong customer authentication. In case the issuer requests SCA then the response will contain "soft decline" code 400 and an URL where the customer needs to be redirected to perform authentication. The URLs where the customer will be redirected after completing authentication need to be defined in the [`ReturnUrls`](/src/Model/Sca/ReturnUrls.php) object.
229
+
230
+
In addition to the return urls the [`StrongCustomerAuthentication`](/src/Model/Sca/StrongCustomerAuthentication.php) object has many optional fields for information about the customer and the transaction. This information is used in transaction risk analysis (TRA) and can increase the likelihood that the transaction is considered low risk so that strong customer authentication is not needed.
231
+
232
+
```php
233
+
$token = new \Solinor\PaymentHighway\Model\Token( $tokenId );
234
+
235
+
$strongCustomerAuthentication = new \Solinor\PaymentHighway\Model\Sca\StrongCustomerAuthentication(
236
+
new \Solinor\PaymentHighway\Model\Sca\ReturnUrls(
237
+
"https://example.com/success", // URL the user is redirected after succesful 3D-Secure authentication if strong customer authentication is required
238
+
"https://example.com/cancel", // URL the user is redirected after cancelled 3D-Secure authentication if strong customer authentication is required
239
+
"https://example.com/failure" // URL the user is redirected after failed 3D-Secure authentication if strong customer authentication is required
240
+
)
241
+
// Optinally other information about the customer and purchase to help in transaction risk analysis (TRA)
242
+
);
243
+
244
+
$transaction = new \Solinor\PaymentHighway\Model\Request\CustomerInitiatedTransaction( $token, $amount, $currency, $strongCustomerAuthentication );
#### Charging a merchant initiated transaction (MIT)
250
+
251
+
When charging the customer's card in context where the customer is not actively participating in the transaction you should use the `chargeMerchantInitiatedTransaction` method. The MIT transactions are exempt from the strong customer authentication requirements of PSD2 so the request cannot be answered with "soft-decline" response (code 400) unlike customer initated transactions.
252
+
253
+
```php
254
+
$token = new \Solinor\PaymentHighway\Model\Token( $tokenId );
255
+
256
+
$transaction = new \Solinor\PaymentHighway\Model\Request\Transaction( $token, $amount, $currency );
* @param string $account_age_indicator Length of time that the cardholder has had the account.
27
+
* @param string $account_date Date, when the cardholder opened the account at merchant (eg. "2019-07-05")
28
+
* @param string $change_indicator Length of time since the cardholder’s account information was last changed.
29
+
* @param string $change_date Date, when the cardholder’s account was last changed. Including Billing or Shipping address (eg. "2019-07-05")
30
+
* @param string $password_change_indicator Length of time since the cardholder’s account had a password change or account reset.
31
+
* @param string $password_change_date Date, when cardholder’s account with the 3DS Requestor had a password change or account reset. (eg. "2019-07-05")
32
+
* @param int $number_of_recent_purchases Max value: 9999, Number of purchases with this cardholder account during the previous six months.
33
+
* @param int $number_of_add_card_attempts_day Max value: 999, Number of Add Card attempts in the last 24 hours.
34
+
* @param int $number_of_transaction_activity_day Max value: 999, Number of transactions (successful and abandoned) for this cardholder account across all payment accounts in the previous 24 hours.
35
+
* @param int $number_of_transaction_activity_year Max value: 999, Number of transactions (successful and abandoned) for this cardholder account with the 3DS Requestor across all payment accounts in the previous year.
36
+
* @param string $shipping_address_indicator Indicates when the shipping address used for this transaction was first used.
37
+
* @param string $shipping_address_usage_date Date, when the shipping address used for this transaction was first used. (eg. "2019-07-05")
38
+
* @param string $suspicious_activity Indicates whether suspicious activity has been experienced (including previous fraud) on the cardholder account.
* Length of time that the cardholder has had the account.
73
+
* 01 = No account (guest check-out)
74
+
* 02 = Created during this transaction
75
+
* 03 = Less than 30 days
76
+
* 04 = 30−60 days
77
+
* 05 = More than 60 days
78
+
*/
79
+
abstractclass AccountAgeIndicator {
80
+
constNoAccount = "01";
81
+
constCreatedDuringTransaction = "02";
82
+
constLessThan30Days = "03";
83
+
constBetween30And60Days = "04";
84
+
constMoreThan60Days = "05";
85
+
}
86
+
87
+
/**
88
+
* Length of time since the cardholder’s account information was last changed. Including Billing or Shipping address, new payment account, or new user(s) added.
89
+
* 01 = Changed during this transaction
90
+
* 02 = Less than 30 days
91
+
* 03 = 30−60 days
92
+
* 04 = More than 60 days
93
+
*/
94
+
abstractclass AccountInformationChangeIndicator {
95
+
constChangedDuringTransaction = "01";
96
+
constLessThan30Days = "02";
97
+
constBetween30And60Days = "03";
98
+
constMoreThan60Days = "04";
99
+
}
100
+
101
+
/**
102
+
* Length of time since the cardholder’s account had a password change or account reset.
103
+
* 01 = No change
104
+
* 02 = Changed during this transaction
105
+
* 03 = Less than 30 days
106
+
* 04 = 30−60 days
107
+
* 05 = More than 60 days
108
+
*/
109
+
abstractclass AccountPasswordChangeIndicator {
110
+
constNoChange = "01";
111
+
constChangedDuringTransaction = "02";
112
+
constLessThan30Days = "03";
113
+
constBetween30And60Days = "04";
114
+
constMoreThan60Days = "05";
115
+
}
116
+
117
+
/**
118
+
* Indicates when the shipping address used for this transaction was first used.
119
+
* 01 = This transaction
120
+
* 02 = Less than 30 days
121
+
* 03 = 30−60 days
122
+
* 04 = More than 60 days
123
+
*/
124
+
abstractclass ShippingAddressFirstUsedIndicator {
125
+
constThisTransaction = "01";
126
+
constLessThan30Days = "02";
127
+
constBetween30And60Days = "03";
128
+
constMoreThan60Days = "04";
129
+
}
130
+
131
+
/**
132
+
* Indicates whether suspicious activity has been experienced (including previous fraud) on the cardholder account.
0 commit comments