Skip to content

Commit

Permalink
Merge pull request #2132 from SwedbankPay/DX-2368-Add-info-from-PAX-2562
Browse files Browse the repository at this point in the history
Dx 2368 add info from pax 2562
  • Loading branch information
the-anders-jarold authored Feb 21, 2024
2 parents 374d2ce + cc52f6e commit 747106c
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 20 deletions.
2 changes: 1 addition & 1 deletion _includes/pax-saleitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace SwpTrmLib.Nexo
{:.table .table-striped}
| :------------- | :-------------- |:--------------- |:---|
| **Type** | **Name** | **Description** | |
| UnitOfMeasure | Enumeration UnitOfMeasures |Litre or Kilogram | Mandatory |
| UnitsOfMeasure | UnitOfMeasures |Litre or Kilogram | Mandatory |

Check failure on line 30 in _includes/pax-saleitem.md

View workflow job for this annotation

GitHub Actions / misspell

[misspell] _includes/pax-saleitem.md#L30

"Litre" is a misspelling of "Liter"
Raw output
./_includes/pax-saleitem.md:30:35: "Litre" is a misspelling of "Liter"
| Decimal | Quantity | | Mandatory |
| string |ProductLabel |Name of product | Optional |
| string |AdditionalProductInfo | | Optional |
Expand Down
4 changes: 3 additions & 1 deletion pax-terminal/NET/SwpTrmLib/Methods/essential/openasync.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ menu_order: 20
### Method Signatures

* void Open(string POIID=null)
* void OpenEx(string POIID=null, string OperatorID=null, string ShiftNumber=null)

* async Task\<OpenResult\> OpenAsync(string POIID=null)
* async Task\<OpenResult\> OpenExAsync(string POIID=null, string OperatorID=null, string ShiftNumber=null)

### Description

Expand All @@ -22,7 +24,7 @@ The Open/OpenAsync call is the first method call that actually communicates with
body= "Even if the Open is successful, some action towards the host will occur and possibly cause the next method call to fail."
%}
{% include alert.html type="informative" icon="info" header="Reset terminal state"
body= "A LoginRequest that happens when calling OpenAsync, should reset states in the terminal. A login session lasts until next open, close or reboot."
body= "A LoginRequest that happens when calling any of the open functions, should reset states in the terminal. A login session lasts until next open, close or reboot."
%}
{% include alert.html type="informative" icon="info" header="POIID cannot change during login session"
body= "To change POIID for a terminal a Logout or terminal reboot needs to be performed"
Expand Down
34 changes: 18 additions & 16 deletions pax-terminal/NET/includes/transactionsetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,35 @@ description: TransactionSetup may be used as a parameter when starting a transac
TransactionSetup holds properties for a transaction and may be passed as an input parameter to functions that start a transaction sequence. All properties are not relevant depending on which function that is called.

```c#
public class TransactionSetup
public interface ITransactionSetup
{
public Nexo.PaymentTypes type { get; set; } = Nexo.PaymentTypes.Normal;
public decimal Amount { get; set; } = 0;
public decimal CashBack { get; set; } = 0;
public string Currency { get; set; } = string.Empty;
public string TransactionID { get; set; } = String.Empty;
public string APMReference { get; set; } = String.Empty;
public string PaymentInstrument { get; set; } = String.Empty;
public List<SaleItem> SaleItems {get; set;} = List<SaleItem>();
public override string ToString()
{
return $"{type}, {Amount}, {CashBack}, {Currency}, {TransactionID}, {APMReference}, {PaymentInstrument}";
}
string AcquirerData { get; set; }
decimal Amount { get; set; }
string APMReference { get; set; }
decimal CashBack { get; set; }
string Currency { get; set; }
string PaymentInstrument { get; set; }
List<SaleItem> SaleItems { get; set; }
bool SplitPayment { get; set; }
string TransactionID { get; set; }
PaymentTypes type { get; set; }

string ToString();
}
```

{:.table .table-striped}
| :------------- | :-------------- |:--------------- |:---|
| Nexo.PaymentTypes |type |Normal or Refund | Mandatory if used with `GetPaymentInstrument` or `GetPaymentInstrumentAsync`. Overridden when used with `Refund` or `RefundAsync` |
| string |AcquirerData | Additional data to be sent to host. Used for PurchaseOrderNumber. JSON format | Optional |
| decimal |Amount |Total amount | Mandatory |
| string |APMReference |Used only if refund of a transaction made using alternative payment method. The reference originates from the response of the APM transaction | Only for Refund of APM transaction |
| decimal |CashBack |included in Amount | Optional |
| string |Currency |As a 3 letter abbrivation - ISO-4217. Available are `SEK`, `NOK`, `DKK`, `EUR`. Needs to be configured in terminal. | Optional. Default currency of current culture. |
| string |TransactionID |A transaction id that may be set by sale system for tracking. If a transaction is started by calling `GetPayementInstrument`, the transaction id must be set in that call and cannot be changed when later calling `Payment` or `Refund` | Optional |
| string |APMReference |Used only if refund of a transaction made using alternative payment method. The reference originates from the response of the APM transaction | Only for Refund of APM transaction |
| string |PaymentInstrument |A non PCI regulated payment instrument. Prefix and supplied PAN must be registred in the terminal setup. The normal usage is for giftcards or card numbers that are created on site such as financing.| Optional |
| List\<[SaleItem][saleitem]\> | SaleItems | Product details for fuel functionality | Optional |
| bool | SplitPayment | Just a flag sent to host to indicate this sale in part of a complete sale made in the sale system. Does only make sense for certain host. | Optional |
string |TransactionID |A transaction id that may be set by sale system for tracking. If a transaction is started by calling `GetPayementInstrument`, the transaction id must be set in that call and cannot be changed when later calling `Payment` or `Refund` | Optional |
| Nexo.PaymentTypes |type |Normal or Refund | Mandatory if used with `GetPaymentInstrument` or `GetPaymentInstrumentAsync`. Overridden when used with `Refund` or `RefundAsync` |

{:.code-view-header}
**Example creating a list of sale items**
Expand Down
12 changes: 12 additions & 0 deletions pax-terminal/NET/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ icon:
outlined: true

---
## February 27 2024

### .Net SDK 1.3.24047

* PaymentRequestResult now populates ProductName and PAN even if PaymentInstrumentData is missing.
* Possibility to use OpenEx or OpenExAsync to set OperatorID and ShiftNumber that will be forwarded and seen in reports.
* Possibility to attach purchase order Id by setting in in TransactionSetup when starting a payment.
* Setting up the logfile will only be made once even if new instances is created. Filter is removed when calling Stop.
* Calling Stop will stop and remove the listener
* SplitPayment may be indicated in TranactionSetup and is sent to terminal to be forwarded to host.
* Property type of TransactionSetup is always overridden and set to Refund if Refund or RefundAsync is called.
* Default currency fixed when using TransactionSetup

## February 6 2024

Expand Down
5 changes: 3 additions & 2 deletions pax-terminal/NET/tutorial/fuel-card-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If the result has `ResponseResult` set to failure and the `ErrorCondition` is `P

## Product List

The list of products that is passed in the `TransactionSetup` consists of one or more `SaleItem` objects.
The list of products that is passed in the [`TransactionSetup`][transactionsetup] consists of one or more `SaleItem` objects.

{% include pax-saleitem.md %}

Expand All @@ -31,7 +31,8 @@ Starting a payment would be done similar to the following:

If the [`PaymentRequestResult.ResponseResult`][paymentrequestresult] is `Failure` the transaction has failed either for a normal reason or, if `ErrorCondition` is `PaymentRestriction`, due to the restriction for the card used. The [`PaymentRequestResult`][paymentrequestresult] has a property named `AllowedProducts` that is a list of product codes from the request that may be purchased using the same card. If the list is empty none of the products can be purchased with the card used.

Let's say the above example failed and the `AllowedProducts` has one item with value "24601", then the customer may either change card or just buy that product. A new Payment must be issued with a new list of SaleItem with just that one product and the amount 25.5.
Let's say the above example failed and the `AllowedProducts` has one item with value "24601", then the customer may either change card or just buy that product. A new Payment must be issued with a new list of SaleItem with just that one product and the amount 25.5. This is also typically when you set the flag `SplitPayment` if the other goods are paid with an other card or cash.

[paymentasync]: /pax-terminal/NET/SwpTrmLib/Methods/essential/paymentasync
[paymentrequestresult]: /pax-terminal/NET/includes/paymentrequestresult
[transactionsetup]: /pax-terminal/NET/includes/transactionsetup
34 changes: 34 additions & 0 deletions pax-terminal/NET/tutorial/payment-with-orderid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Make Payment Including Order Number
description: |
A payment may include an order id that is forwarded to the acquirer host.
permalink: /:path/payment-with-orderid/
hide_from_sidebar: true
icon:
content: bookmark_add
outlined: true
menu_order: 100
---
To include an order number in a payment the [TransactionSetup][transactionsetup] must be used. The following example shows how to make a payment for 120 SEK for order number 123456789.

```c#
using System.Text.Json;


class PaxImplementation : ISwpTrmCallbackInterface
{
public ISwpTrmIf_1 Pax = {get; internal set; } = null;
.
.
.

public async Task CreatePayment()
{
var pr = Pax.PaymentAsync(new TransactionSetup() {
AcquirerData = JsonSerializer.Serialize(new { purchaseOrderNumber = "123456789"}),
Amount = (decimal)120
};
}
```

[transactionsetup]: /pax-terminal/NET/includes/transactionsetup
2 changes: 2 additions & 0 deletions pax-terminal/Nexo-Retailer/Quick-guide/first-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ A LoginRequest starts a so called `Login Session` in the terminal. A `Login Sess
| Name | Lev | Attribute | Description |
| :------------- | :---: | :-------------- |:--------------- |
| LoginRequest | 1 | OperatorLanguage | Language used in the POS system. Supported: `sv`,`no`,`fi`,`da`. |
| | | ShiftNumber | This is forwarded to the Pospay server. |
| | | OperatorID | This is not used as of now. |
| DateTime | 2 | | Local time when request is made with time zone offset. |
| SaleSoftware | 3 | | Important information for SwedbankPay to be able to get an understanding of how different setups work. |
| | | ApplicationName | Name of the POS application or the module communicating with the terminal. |
Expand Down
38 changes: 38 additions & 0 deletions pax-terminal/Nexo-Retailer/submit-purchse-order-number.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Include Purchase Order Number
description: |
A Purchase Order Number may be included in the PaymentRequest and will be forwarded to the aquirer host.
menu_order: 65
icon:
content: bookmark_add
outlined: true
---
There is a possibility to forward information to the host by using the `SaleToAquirerData` of `PaymentRequest` - `SaleData`. The data must be a JSON object that is Base64 encoded.

{:.code-view-header}

Eg. PurchaseRequest with purchase order in SaleToAquirerData

```xml
<SaleToPOIRequest>
<MessageHeader ProtocolVersion="3.1" MessageClass="Service" MessageCategory="Payment" MessageType="Request" ServiceID="5" SaleID="1" POIID="A-POIID"/>
<PaymentRequest>
<SaleData TokenRequestedType="Customer">
<SaleTransactionID TransactionID="202402060950219170" TimeStamp="2024-02-06T09:50:21+01:00"/>
<SaleToAcquirerData>ewogICAgInB1cmNoYXNlT3JkZXJOdW1iZXIiOiAiMTIzNDU2Nzg5Igp9</SaleToAcquirerData>
</SaleData>
<PaymentTransaction>
<AmountsReq RequestedAmount="60" CashBackAmount="0" Currency="SEK"/>
</PaymentTransaction>
</PaymentRequest>
</SaleToPOIRequest>
```

{:.code-view-header}
Eg. SaleToAquirerData Base64 decoded JSON

```xml
<SaleToAcquirerData>{
"purchaseOrderNumber": "123456789"
}</SaleToAcquirerData>
```
6 changes: 6 additions & 0 deletions pax-terminal/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ description: |
published on this page.
menu_order: 100
---
## February 27 2024

* ShiftNumber in LoginRequest forwarded to Pospay server.
* Purchase order number may be included in payment and forwarded to Pospay.
* Updates for the [.Net SDK][dotnetrelease]

## 6 February 2024

* [Manually entered Payment Instrument explained][keyinpaymentinstrument].
Expand Down

0 comments on commit 747106c

Please sign in to comment.