-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vincent
committed
Jun 4, 2018
1 parent
af1dbdc
commit e7ac868
Showing
5 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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". | ||
+ "¤cy=EUR" | ||
+ "&title=Taxi Ride" | ||
+ "&receipt-mobilephone=+3531234567890" | ||
|
@@ -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¤cy=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¤cy=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: | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -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 | ||
|
@@ -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); | ||
} | ||
}); | ||
|
||
|
@@ -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" | ||
+ "¤cy=EUR" | ||
+ "&title=Taxi Ride" | ||
+ "&receipt-mobilephone=+3531234567890" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |