AltaPay
Deprecated - maintenance
AltaPay is being maintained by integration and support. However, Upodi have deprecated customer onboarding using AltaPay. Contact us for more information.
AltaPay is a national payment provider, supporting Denmark, VISA and Mastercard. To use AltaPay you must first configure a terminal to allow recurring payments and tokenization.
- In addition, it is important to understand that AltaPay does not support multi-currency scenarios. Only process payments with the same currency of the terminal and invoices.
- Partial refunds are not allowed only full amount.
Payment methods
AltaPay is supported using 4 distinct and different token formats. You must prefix the transactionId
(aka agreement Id) using one of these prefixes to obtain the token format.
Token type | Format | Remarks |
---|---|---|
Transaction | * tran_{transactionId} | Future payments in Altapay will be flagged without any parameter, using the deprecated subscription flow (not agreement id flow). |
Agreement | * agr_{agreementId} | Recommended Future payments in Altapay will be flagged with agreement[type]=unscheduled agreement[unscheduled_type]=delayedCharges agreement[Id]=agreementId |
Recurring | * rec_{agreementId} | As with agreement, however future payments are handled as recurring without any flags sent to AltaPay. Flow will use agreementId flow. |
To use Upodi with AltaPay tokens, you must create a payment token via the AltaPay frontend integration.
Route 1: Create a recurring payment token with a Reservation in AltaPay
Use this route if you have an actual first payment in relation to the signup. This ensures that Upodi will be able to capture the already reserved amount.
Step 1: Create the token:
curl --request POST \
--url https://<YourShopName>.altapaysecure.com/merchant/API/createPaymentRequest \
--header 'Authorization: Basic (auth)' \
--data type=subscriptionAndReserve \
--data agreement[type]=unscheduled \
--data terminal=(your terminal) \
--data shop_orderid=abc123 \
--data amount=50 \
--data currency=DKK \
--data config[callback_ok]=(valid OK callback)
The callback will receive an XML response with two value values. Use the first one as the agreement Id and the second one as the pre-authorized payment.
Step 2: Post the token to Upodi
curl --location 'https://api-front.upodi.io/PaymentMethods' \
--header 'X-version: {version}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {ApiKey}' \
--data '{
"customerId": "guid",
"gateway" : "altapay",
"makedefault" : "true",
"source" : "{ \"TransactionId\": \"agr_{transactionId}\", \"ReservationId\": \"{pre-authorized payment transactionId}\" }"
}'
In the above case we are creating an Agreement-type, and therefore we post it to Upodi with the agr-prefix.
You can also post the payment inside a Checkout API call.
Route 2: Create a recurring payment token in AltaPay
This is for when you just want to create a recurring token to be charged at a later point. Use this if you do not have an actual purchase in relation to the first signup, and just want to save the token for future payments.
Create the token:
We recommend the path using createPaymentRequest as follows:
curl --request POST \
--url https://<YourShopName>.altapaysecure.com/merchant/API/createPaymentRequest \
--header 'Authorization: Basic (auth)' \
--data type=subscription \
--data agreement[type]=unscheduled \
--data terminal=(your terminal) \
--data shop_orderid=abc123 \
--data amount=50 \
--data currency=DKK \
--data config[callback_ok]=(valid OK callback)
The callback will receive an XML response. Use the value in the next step.
Adding the payment method in Upodi
To create a payment method with an AltaPay token, make a POST request to /paymentmethods/{customerId} :
{
"gateway" : "altapay",
"makedefault" : "true", /* will make the payment method default */
"source" : "agr_{transactionId}", /* AltaPay token */
}
Upodi may respond to this request by either HTTP 200 (payment method created) or HTTP 422 (something is not correct with the token).
Updated about 1 year ago