File tree Expand file tree Collapse file tree 7 files changed +23
-10
lines changed Expand file tree Collapse file tree 7 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## 0.59.4 - 2022-06-28
9
+
10
+ ### Fixed
11
+
12
+ - Truncate reciept_id from in app purchase
13
+
8
14
## 0.59.3 - 2022-06-27
9
15
10
16
### Added
@@ -13,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
19
14
20
## 0.59.2 - 2022-06-22
15
21
16
- #### Changed
22
+ ### Changed
17
23
18
24
- Revert Show capture options menu regardless of backend response. #1703
19
25
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ android {
6
6
applicationId " io.numbersprotocol.capturelite"
7
7
minSdkVersion rootProject. ext. minSdkVersion
8
8
targetSdkVersion rootProject. ext. targetSdkVersion
9
- versionCode 413
10
- versionName " 0.59.3 "
9
+ versionCode 414
10
+ versionName " 0.59.4 "
11
11
testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
12
12
}
13
13
buildFeatures {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " capture-lite" ,
3
- "version" : " 0.59.3 " ,
3
+ "version" : " 0.59.4 " ,
4
4
"author" : " numbersprotocol" ,
5
5
"homepage" : " https://numbersprotocol.io/" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
2
2
import { Injectable } from '@angular/core' ;
3
3
import { defer } from 'rxjs' ;
4
4
import { concatMap } from 'rxjs/operators' ;
5
+ import { truncateReceipt } from '../../../utils/in-app-purchase' ;
5
6
import { DiaBackendAuthService } from '../auth/dia-backend-auth.service' ;
6
7
import { BASE_URL , BUBBLE_API_URL } from '../secret' ;
7
8
@@ -19,7 +20,7 @@ export class DiaBackendNumService {
19
20
concatMap ( headers => {
20
21
const formData = new FormData ( ) ;
21
22
formData . set ( 'points' , pointsToAdd . toString ( ) ) ;
22
- formData . set ( 'receipt_id' , receiptId ) ;
23
+ formData . set ( 'receipt_id' , truncateReceipt ( receiptId ) ) ;
23
24
return this . httpClient . post < DiaBackendNumPointPurchaseResult > (
24
25
`${ BASE_URL } /api/v3/num/points/purchase/` ,
25
26
formData ,
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class InAppStoreService implements OnDestroy {
71
71
72
72
this . store . refresh ( ) ;
73
73
} catch ( error ) {
74
- const errorMessage = this . translocoService . getTranslation (
74
+ const errorMessage = this . translocoService . translate (
75
75
'inAppPurchase.failedToInitInAppStore'
76
76
) ;
77
77
this . errorService . toastError$ ( errorMessage ) . toPromise ( ) ;
@@ -131,7 +131,7 @@ export class InAppStoreService implements OnDestroy {
131
131
} )
132
132
) ;
133
133
} catch ( error ) {
134
- const errorMessage = this . translocoService . getTranslation (
134
+ const errorMessage = this . translocoService . translate (
135
135
'wallets.buyNum.failedToAddPoints'
136
136
) ;
137
137
this . errorService . toastError$ ( errorMessage ) . toPromise ( ) ;
@@ -175,7 +175,7 @@ export class InAppStoreService implements OnDestroy {
175
175
}
176
176
177
177
private readonly onStoreError = ( _ : IAPError ) => {
178
- const errorMessage = this . translocoService . getTranslation (
178
+ const errorMessage = this . translocoService . translate (
179
179
'inAppPurchase.inAppPurchaseErrorOcurred'
180
180
) ;
181
181
this . errorService . toastError$ ( errorMessage ) . toPromise ( ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ import { isDevMode } from '@angular/core';
2
2
import { IAPProduct } from '@awesome-cordova-plugins/in-app-purchase-2/ngx' ;
3
3
import { CaptureInAppProductIds } from '../shared/in-app-store/in-app-store.service' ;
4
4
5
+ export function truncateReceipt ( recipt : string ) {
6
+ const preferredMaxLength = 1024 ;
7
+ const receiptMaxLength = Math . min ( recipt . length , preferredMaxLength ) ;
8
+ return recipt . substring ( 0 , receiptMaxLength ) ;
9
+ }
10
+
5
11
/**
6
12
* Usefull to see in app product state changes in console for better debugging.
7
13
* It will pring to console only in dev mode aka isDevMode() === true
You can’t perform that action at this time.
0 commit comments