Skip to content

Commit

Permalink
Release 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent committed Jun 4, 2018
1 parent af1dbdc commit e7ac868
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ allprojects {

##### 2. Add the dependency to a module
```groovy
compile 'com.sumup:merchant-api:1.3.1'
compile 'com.sumup:merchant-api:1.4.0'
```

##### 3. Make a payment
Expand All @@ -36,10 +36,10 @@ compile 'com.sumup:merchant-api:1.3.1'
//mandatory parameters
// Please go to https://me.sumup.com/developers to get your Affiliate Key by entering the application ID of your app. (e.g. com.sumup.sdksampleapp)
.affiliateKey("YOUR_AFFILIATE_KEY")
.productAmount(1.23)
.total(new BigDecimal("1.23"))
.currency(SumUpPayment.Currency.EUR)
// optional: add details
.productTitle("Taxi Ride")
.title("Taxi Ride")
.receiptEmail("[email protected]")
.receiptSMS("+3531234567890")
// optional: Add metadata
Expand All @@ -52,7 +52,7 @@ compile 'com.sumup:merchant-api:1.3.1'
.skipSuccessScreen()
.build();

SumUpAPI.openPaymentActivity(MainActivity.this, payment, 1);
SumUpAPI.checkout(MainActivity.this, payment, 1);
```

##### 4. Handle payment result
Expand Down Expand Up @@ -91,7 +91,7 @@ compile 'com.sumup:merchant-api:1.3.1'
"sumupmerchant://pay/1.0"
+ "?affiliate-key="YOUR_AFFILIATE_KEY""
+ "&app-id=com.example.myapp"
+ "&amount=1.23"
+ "&total=1.23" // field available from App version 1.88.0 and above. Otherwise keep deprecated field "amount".
+ "&currency=EUR"
+ "&title=Taxi Ride"
+ "&receipt-mobilephone=+3531234567890"
Expand Down Expand Up @@ -125,9 +125,11 @@ mycallbackscheme://result?smp-status=failed&smp-failure-cause=transaction-failed
Put a link onto your website

```
<a href="sumupmerchant://pay/1.0?affiliate-key=7ca84f17-84a5-4140-8df6-6ebeed8540fc&app-id=com.example.myapp&amount=1.23&currency=EUR&title=Taxi Ride&receipt-mobilephone=+3531234567890&[email protected]&callback=http://example.com/myapp/mycallback">Start SumUp Payment</a>
<a href="sumupmerchant://pay/1.0?affiliate-key=7ca84f17-84a5-4140-8df6-6ebeed8540fc&app-id=com.example.myapp&total=1.23&currency=EUR&title=Taxi Ride&receipt-mobilephone=+3531234567890&[email protected]&callback=http://example.com/myapp/mycallback">Start SumUp Payment</a>
```

Note that field `total` is available from App version 1.88.0 and above. Keep deprecated field `amount` if still supporting older versions of the SumUp App.

Make sure that the callback URL you provide is correct and controlled by you.

Success:
Expand All @@ -154,8 +156,9 @@ Several response flags are available when the callback activity is called :
* SumUpAPI.Response.ResultCode.ERROR_TRANSACTION_FAILED = 2
* SumUpAPI.Response.ResultCode.ERROR_GEOLOCATION_REQUIRED = 3
* SumUpAPI.Response.ResultCode.ERROR_INVALID_PARAM = 4
* SumUpAPI.Response.ResultCode.ERROR_INVALID_TOKEN = 5
* SumUpAPI.Response.ResultCode.ERROR_NO_CONNECTIVITY = 6
* SumUpAPI.Response.ResultCode.ERROR_DUPLICATE_FOREIGN_TX_ID = 9;
* SumUpAPI.Response.ResultCode.ERROR_INVALID_AFFILIATE_KEY = 10;
* SumUpAPI.Response.MESSAGE
* Type : String
* Description : A human readable message describing the result of the payment
Expand All @@ -181,11 +184,11 @@ The response flags are provided within the Bundle that is passed back to the cal
### 2. Additional checkout parameters

#### Transaction identifier
The `foreignTransactionID` identifier will be associated with the transaction and can be used to retrieve details related to the transaction. See [API documentation](https://sumup.com/docs/rest-api/transactions-api) for details. Please make sure that this ID is unique within the scope of the SumUp merchant account and sub-accounts. It must not be longer than 128 characters.
The `foreignTransactionID` identifier will be associated with the transaction and can be used to retrieve details related to the transaction. See [API documentation](http://docs.sumup.com/rest-api/transactions-api/) for details. Please make sure that this ID is unique within the scope of the SumUp merchant account and sub-accounts. It must not be longer than 128 characters.
The foreignTransactionID is available when the callback activity is called: `SumUpAPI.Param.FOREIGN_TRANSACTION_ID`

#### Skip success screen
To skip the screen shown at the end of a successful transaction, the `skipSuccessScreen` parameter can be used. When using the parameter your application is responsible for displaying the transaction result to the customer. In combination with the Receipts API your application can also send your own receipts, see [API documentation](https://sumup.com/docs/rest-api/transactions-api) for details. Please note success screens will still be shown when using the SumUp Air Lite readers.
To skip the screen shown at the end of a successful transaction, the `skipSuccessScreen` parameter can be used. When using the parameter your application is responsible for displaying the transaction result to the customer. In combination with the Receipts API your application can also send your own receipts, see [API documentation](http://docs.sumup.com/rest-api/transactions-api/) for details. Please note success screens will still be shown when using the SumUp Air Lite readers.

## Community
- **Questions?** Get in contact with our integration team by sending an email to
Expand Down
13 changes: 6 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '25.0.1'
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 27
versionCode 4
versionName "1.3.1"
versionName "1.4.0"
}
}

dependencies {
compile 'com.android.support:appcompat-v7:24.2.1'

compile 'com.sumup:merchant-api:1.3.1'
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.sumup:merchant-api:1.4.0'
}
9 changes: 5 additions & 4 deletions app/src/main/java/com/sumup/apisampleapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.sumup.merchant.api.SumUpAPI;
import com.sumup.merchant.api.SumUpPayment;

import java.math.BigDecimal;
import java.util.UUID;

public class MainActivity extends Activity {
Expand All @@ -37,9 +38,9 @@ public void onClick(View v) {
// mandatory parameters
// Please go to https://me.sumup.com/developers to get your Affiliate Key by entering the application ID of your app. (e.g. com.sumup.sdksampleapp)
.affiliateKey("7ca84f17-84a5-4140-8df6-6ebeed8540fc")
.productAmount(1.23)
.total(new BigDecimal("1.23"))
.currency(SumUpPayment.Currency.EUR)// optional: add details
.productTitle("Taxi Ride")
.title("Taxi Ride")
.receiptEmail("[email protected]")
.receiptSMS("+3531234567890")
// optional: Add metadata
Expand All @@ -51,7 +52,7 @@ public void onClick(View v) {
.skipSuccessScreen()
.build();

SumUpAPI.openPaymentActivity(MainActivity.this, payment, REQUEST_CODE_PAYMENT);
SumUpAPI.checkout(MainActivity.this, payment, REQUEST_CODE_PAYMENT);
}
});

Expand All @@ -63,7 +64,7 @@ public void onClick(View v) {
"sumupmerchant://pay/1.0"
+ "?affiliate-key=7ca84f17-84a5-4140-8df6-6ebeed8540fc"
+ "&app-id=com.sumup.apisampleapp"
+ "&amount=1.23"
+ "&total=1.23" // field available from App version 1.88.0 and above. Otherwise keep deprecated field "amount"
+ "&currency=EUR"
+ "&title=Taxi Ride"
+ "&receipt-mobilephone=+3531234567890"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:3.1.2'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 11 10:08:08 CEST 2017
#Mon Jun 04 12:03:27 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 comments on commit e7ac868

Please sign in to comment.