Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit b4c5d7c

Browse files
Patrick Stadlergitbook-bot
Patrick Stadler
authored andcommitted
GitBook: [master] 7 pages modified
1 parent 8d8efbb commit b4c5d7c

File tree

7 files changed

+66
-52
lines changed

7 files changed

+66
-52
lines changed

collect-and-store-cards/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In general, you have different inbound channels where you receive sensitive card
1212
| :--- | :--- | :--- |
1313
| ![](../.gitbook/assets/website.png) | ![](../.gitbook/assets/webservice.png) | ![](../.gitbook/assets/app.png) |
1414
| Your customers enter their credit card data on a form within your website. | You receive a request from a remote server including credit card data in the payload. | Your customers enter their credit card data on a form within your native app. |
15-
| [Inline Mode](capture-iframes/) seamlessly tokenizes sensitive data within your web app. | [Filter Proxy](filter-payloads.md) tokenizes sensitive data on the fly within your web services. | [Vault \(alias gateway\)](vault-alias-gateway.md) tokenizes sensitive data within your mobile app. |
15+
| [Secure Fields](capture-iframes/) seamlessly tokenizes sensitive data within your web app. | [Filter Proxy](filter-payloads.md) tokenizes sensitive data on the fly within your web services. | [Vault \(alias gateway\)](vault-alias-gateway.md) tokenizes sensitive data within your mobile app. |
1616

1717

1818

collect-and-store-cards/capture-iframes/README.md

+27-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Capture \(iframes\)
22

3-
The Inline Mode allows you to securely collect card data by injecting iframes to your DOM. A separate iframe for both, card number and CVV code is used. Thereby, sensitive data never touches your server and allows you to capture all other related card data such as cardholder name, expiry date, etc. directly by yourself.
3+
Secure Fields allow you to securely collect card data by injecting iframes to your DOM. A separate iframe for both, card number and CVV code is used. Thereby, sensitive data never touches your server and allows you to capture all other related card data such as cardholder name, expiry date, etc. directly by yourself.
44

55
{% hint style="success" %}
6-
**The Inline Mode qualifies you for SAQ A.**
6+
**Secure Fields qualify you for SAQ A.**
77
{% endhint %}
88

9-
Browser compatibility for the Inline Mode:
9+
Browser compatibility for Secure Fields:
1010

1111
| **Browser** | **Version** |
1212
| :--- | :--- |
@@ -18,20 +18,20 @@ Browser compatibility for the Inline Mode:
1818
| Blackberry Browser | >=8 |
1919
| Android Browser | >=4 |
2020

21-
## 1. Setup Inline Mode
21+
## 1. Setup Secure Fields
2222

2323
To get started include the following script on your page.
2424

2525
{% code-tabs %}
2626
{% code-tabs-item title="Inline Mode Script" %}
2727
```javascript
28-
<script src="https://pay.sandbox.datatrans.com/upp/payment/js/datatrans-inline-1.0.0.js"></script>
28+
<script src="https://pay.sandbox.datatrans.com/upp/payment/js/secure-fields-1.0.0.js"></script>
2929
```
3030
{% endcode-tabs-item %}
3131

3232
{% code-tabs-item title="Minified Version" %}
3333
```javascript
34-
<script src="https://pay.sandbox.datatrans.com/upp/payment/js/datatrans-inline-1.0.0.min.js"></script>
34+
<script src="https://pay.sandbox.datatrans.com/upp/payment/js/secure-fields-1.0.0.min.js"></script>
3535
```
3636
{% endcode-tabs-item %}
3737
{% endcode-tabs %}
@@ -42,7 +42,7 @@ Please make sure to always load it directly from [https://pay.sandbox.datatrans.
4242

4343
## 2. Create payment form
4444

45-
In order for the Inline Mode to insert the card number and CVV iframes at the right place, create empty DOM elements and assign them unique IDs. In the example below those are:
45+
In order for Secure Fields to insert card number and CVV iframes at the right place, create empty DOM elements and assign them unique IDs. In the example below those are:
4646

4747
* `card-number-placeholder`
4848
* `cvv-placeholder`
@@ -72,32 +72,47 @@ In test mode, only [test credit cards](../../test-card-data.md) are allowed.
7272

7373
## 3. Retrieve a transactionId
7474

75-
Initialize the Inline Mode with your `merchantId` and specify which DOM element containers should be used to inject the iframes:
75+
First, create a new Secure Fields instance:
7676

7777
```javascript
78-
Inline.initTokenize( "1100007006", {
78+
var secureFields = new SecureFields();
79+
80+
// Multiple instances might be created and used independently:
81+
// e.g. var secureFields2 = new SecureFields();
82+
```
83+
84+
Initialize it with your `merchantId` and specify which DOM element containers should be used to inject the iframes:
85+
86+
```javascript
87+
secureFields.initTokenize( "1100007006", {
7988
cardNumber: "card-number-placeholder",
8089
cvv: "cvv-placeholder"
8190
});
8291
```
8392

84-
Afterwards you submit the form and listen for the success event:
93+
Afterwards submit the form and listen for the success event:
8594

8695
```javascript
8796
$(function() {
8897
$("#go").click( function() {
89-
Inline.submit(); // submit the "form"
98+
secureFields.submit(); // submit the "form"
9099
})
91100
});
92101

93-
Inline.on("success", function(data) {
102+
secureFields.on("success", function(data) {
94103
if(data.transactionId) {
95104
// transmit data.transactionId and the rest
96105
// of the form to your server
97106
}
98107
});
99108
```
100109

110+
Instances can be destroyed if no longer used:
111+
112+
```javascript
113+
secureFields.destroy();
114+
```
115+
101116
## 4. Obtain tokens
102117

103118
Once you've transmitted the `transactionId` to your server \(together with the the rest of your form\) you can execute a server to server [`GET Token`](token-api.md) request to get tokens for card number and CVV code:

collect-and-store-cards/capture-iframes/events.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# Events
22

3-
Use the `Inline.on(...)` callback function to subscribe to one or more of the `ready`, `change`, `error` or `validate` events.
3+
Use the `secureFields.on(...)` callback function to subscribe to one or more of the `ready`, `change`, `error` or `validate` events.
44

55
{% tabs %}
66
{% tab title="on ready" %}
77
The ready event will be emitted once the iframes are loaded.
88

99
```javascript
10-
Inline.on("ready", function() {
10+
secureFields.on("ready", function() {
1111
// setting a placholder for the cardNumber field
12-
Inline.setPlaceholder("cardNumber", "Card number");
12+
secureFields.setPlaceholder("cardNumber", "Card number");
1313

1414
// setting a placeholder for the CVV field
15-
Inline.setPlaceholder("cvv", "CVV");
15+
secureFields.setPlaceholder("cvv", "CVV");
1616
});
1717
```
1818
{% endtab %}
1919

2020
{% tab title="on validate" %}
21-
The validate event will be emitted once the form was submitted with `Inline.submit();`
21+
The validate event will be emitted once the form was submitted with `secureFields.submit();`
2222

2323
```javascript
24-
Inline.on("validate", function(event) {
24+
secureFields.on("validate", function(event) {
2525
// put a red border around the fields if they are not valid
26-
Inline.setStyle("cardNumber.invalid","border: 1px solid #f00");
27-
Inline.setStyle("cvv.invalid","border: 1px solid #f00");
26+
secureFields.setStyle("cardNumber.invalid","border: 1px solid #f00");
27+
secureFields.setStyle("cvv.invalid","border: 1px solid #f00");
2828
});
2929
```
3030

@@ -51,7 +51,7 @@ Where the `event` callback object has the following structure:
5151
The success event will be emitted if the tokenization was successful.
5252

5353
```javascript
54-
Inline.on("success", function(data) {
54+
secureFields.on("success", function(data) {
5555
if(data.transactionId) {
5656
// send data.transactionId and the
5757
// rest of the form to your server
@@ -90,7 +90,7 @@ The `change` event will be emitted whenever one of the following events are gett
9090
* `touchforcechange`
9191

9292
```javascript
93-
Inline.on("change", function(event) {
93+
secureFields.on("change", function(event) {
9494
// some fancy stuff
9595
});
9696
```
@@ -119,18 +119,18 @@ Where the `event` callback object has the following structure:
119119
{% endtab %}
120120

121121
{% tab title="on error" %}
122-
The error event will be emitted if there was an error after calling `Inline.initTokenize(...)`.
122+
The error event will be emitted if there was an error after calling `secureFields.initTokenize(...)`.
123123

124124
Possible scenarios are:
125125

126-
* Wrong merchantId configured in `Inline.init(...);`
126+
* Wrong merchantId configured in `secureFields.initTokenize(...);`
127127
* Wrong name of card number, CVV fields
128128
* Wrong merchantId configuration on Datatrans side
129129

130130
Those errors should only occur during development/testing.
131131

132132
```javascript
133-
Inline.on("error", function(data) {
133+
secureFields.on("error", function(data) {
134134
// something bad happened
135135
});
136136
```

collect-and-store-cards/capture-iframes/initialization-and-styling.md

+21-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Initialization and Styling
22

3-
Using Inline Mode leaves you complete control over the styling of your payment form. The card number and CVV fields can be styled individually.
3+
Using Secure Fields leaves you complete control over the styling of your payment form. The card number and CVV fields can be styled individually.
44

55
```javascript
66
var styles = {
@@ -34,16 +34,16 @@ var styles = {
3434
'*:hover': 'border: 1px solid #66AFE9',
3535
'*::placeholder': 'color: #999999',
3636
'*:-ms-input-placeholder': 'color: #999999' // thanks MS :(
37-
};
37+
};
3838

39-
Inline.initTokenize(
40-
":your-merchant-id",
39+
secureFields.initTokenize(
40+
"your-merchant-id",
4141
{
4242
cardNumber: "cardNumberPlaceholder",
4343
cvv: "cvvPlaceholder"
4444
},{
4545
styles: styles,
46-
focus: "cardNumber" // or Inline.focus("cardNumber");
46+
focus: "cardNumber" // or secureFields.focus("cardNumber");
4747
}
4848
);
4949
```
@@ -54,15 +54,15 @@ The individual fields can also be styled dynamically:
5454

5555
```javascript
5656
// the card number field
57-
Inline.setStyle("cardNumber", "border: 1px solid #ccc");
57+
secureFields.setStyle("cardNumber", "border: 1px solid #ccc");
5858

5959
// the CVV field
60-
Inline.setStyle("cvv", "border: 1px solid #ccc")
60+
secureFields.setStyle("cvv", "border: 1px solid #ccc")
6161
```
6262

6363
## Toggled classes
6464

65-
The inline mode automatically toggles CSS classes on the input fields based on various user input. Use `"cardNumber.valid:hover": "background-color: green;"` for example to apply different style based classes.
65+
Secure Fields automatically toggle CSS classes on the input fields based on various user input. Use `"cardNumber.valid:hover": "background-color: green;"` for example to apply different style based classes.
6666

6767
| Class name | Description |
6868
| :--- | :--- |
@@ -80,7 +80,7 @@ The `initTokenize` function allows to set the input type, placeholder value and
8080
* The placeholder value will be `enter your cvv`
8181

8282
```javascript
83-
Inline.initTokenize(
83+
secureFields.initTokenize(
8484
merchantId,
8585
{
8686
cardNumber: "cardNumberPlaceholder",
@@ -101,7 +101,7 @@ Inline.initTokenize(
101101
By default all credit cards available in your merchant setup will be accepted. Use the `paymentMethods` option if there's a need to accept only a subset of card `types`.
102102

103103
```javascript
104-
Inline.initTokenize(
104+
secureFields.initTokenize(
105105
merchantId,
106106
{
107107
cardNumber: "cardNumberPlaceholder",
@@ -131,21 +131,20 @@ Parameter values for “paymentmethod”:
131131
Web fonts are supported via the standard `@font-face` CSS rule. Because of security concerns it is not permitted to link external resources. So, in order to get custom fonts, you need to:
132132

133133
* Contact [[email protected]](mailto:[email protected]) and provide the font files \(woff, woof2, ttf etc\). The files will be uploaded into your merchant id hosted files space.
134-
* Reference the font files, by name \(no path\) in the styles section of the `Inline.initTokenize` call:
134+
* Reference the font files, by name \(no path\) in the styles section of the `initTokenize` call:
135135

136136
```javascript
137137
var styles = {
138-
// setting the font-family to both fields
139-
"*": "font-family: Metamorphous;",
140-
141-
"@font-face": {
142-
"*": {
143-
fontFamily: "Metamorphous",
144-
fontStyle: "normal",
145-
fontWeight: 400,
146-
src: "url('metamorphous.woff2') format('woff2')"
147-
}
148-
}
138+
// setting the font-family to both fields
139+
"*": "font-family: Metamorphous;",
140+
"@font-face": {
141+
"*": {
142+
fontFamily: "Metamorphous",
143+
fontStyle: "normal",
144+
fontWeight: 400,
145+
src: "url('metamorphous.woff2') format('woff2')"
146+
}
147+
}
149148
}
150149
```
151150

collect-and-store-cards/capture-iframes/token-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ see Setup
2020

2121
{% api-method-query-parameters %}
2222
{% api-method-parameter name="transactionId" type="number" required=true %}
23-
The transaction id obtained via the `Inline.submit()` operation.
23+
The transaction id obtained via the `secureFields.submit()` operation.
2424
{% endapi-method-parameter %}
2525

2626
{% api-method-parameter name="returnPaymentMethod" type="boolean" %}

collect-and-store-cards/vault-alias-gateway.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The Alias Gateway allows you to pass credit card data directly to the PCI Proxy vault to create tokens. This can be interesting if you want to migrate existing credit card data that is currently stored somewhere else to store it within the PCI Proxy vault.
44

55
{% hint style="danger" %}
6-
We strongly discourage passing credit card data directly to our Alias Gateway as it means your systems get in contact with full credit card numbers. Please use the [Filter Proxy](filter-payloads.md) or [Inline Mode](capture-iframes/) to reduce your PCI scope to a minimum.
6+
We strongly discourage passing credit card data directly to our Alias Gateway as it means your systems get in contact with full credit card numbers. Please use the [Filter Proxy](filter-payloads.md) or [Secure Fields](capture-iframes/) to reduce your PCI scope to a minimum.
77
{% endhint %}
88

99
{% api-method method="post" host="https://api.sandbox.datatrans.com/" path="upp/jsp/XML\_AliasGateway.jsp" %}

setup/sandbox-account.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
### Browser APIs
3030

3131
{% tabs %}
32-
{% tab title="Inline Mode" %}
33-
[https://pay.sandbox.datatrans.com/upp/payment/js/datatrans-inline-1.0.0.js](https://pay.sandbox.datatrans.com/upp/payment/js/datatrans-inline-1.0.0.js)
32+
{% tab title="Secure Fields" %}
33+
[https://pay.sandbox.datatrans.com/upp/payment/js/secure-fields-1.0.0.js](https://pay.sandbox.datatrans.com/upp/payment/js/secure-fields-1.0.0.js)
3434
{% endtab %}
3535

3636
{% tab title="Payment Page" %}

0 commit comments

Comments
 (0)