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.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## 0.59.4 - 2022-06-28
9+
10+ ### Fixed
11+
12+ - Truncate reciept_id from in app purchase
13+
814## 0.59.3 - 2022-06-27
915
1016### Added
@@ -13,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1319
1420## 0.59.2 - 2022-06-22
1521
16- #### Changed
22+ ### Changed
1723
1824- Revert Show capture options menu regardless of backend response. #1703
1925
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ android {
66 applicationId " io.numbersprotocol.capturelite"
77 minSdkVersion rootProject. ext. minSdkVersion
88 targetSdkVersion rootProject. ext. targetSdkVersion
9- versionCode 413
10- versionName " 0.59.3 "
9+ versionCode 414
10+ versionName " 0.59.4 "
1111 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
1212 }
1313 buildFeatures {
Original file line number Diff line number Diff line change 11{
22 "name" : " capture-lite" ,
3- "version" : " 0.59.3 " ,
3+ "version" : " 0.59.4 " ,
44 "author" : " numbersprotocol" ,
55 "homepage" : " https://numbersprotocol.io/" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
22import { Injectable } from '@angular/core' ;
33import { defer } from 'rxjs' ;
44import { concatMap } from 'rxjs/operators' ;
5+ import { truncateReceipt } from '../../../utils/in-app-purchase' ;
56import { DiaBackendAuthService } from '../auth/dia-backend-auth.service' ;
67import { BASE_URL , BUBBLE_API_URL } from '../secret' ;
78
@@ -19,7 +20,7 @@ export class DiaBackendNumService {
1920 concatMap ( headers => {
2021 const formData = new FormData ( ) ;
2122 formData . set ( 'points' , pointsToAdd . toString ( ) ) ;
22- formData . set ( 'receipt_id' , receiptId ) ;
23+ formData . set ( 'receipt_id' , truncateReceipt ( receiptId ) ) ;
2324 return this . httpClient . post < DiaBackendNumPointPurchaseResult > (
2425 `${ BASE_URL } /api/v3/num/points/purchase/` ,
2526 formData ,
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class InAppStoreService implements OnDestroy {
7171
7272 this . store . refresh ( ) ;
7373 } catch ( error ) {
74- const errorMessage = this . translocoService . getTranslation (
74+ const errorMessage = this . translocoService . translate (
7575 'inAppPurchase.failedToInitInAppStore'
7676 ) ;
7777 this . errorService . toastError$ ( errorMessage ) . toPromise ( ) ;
@@ -131,7 +131,7 @@ export class InAppStoreService implements OnDestroy {
131131 } )
132132 ) ;
133133 } catch ( error ) {
134- const errorMessage = this . translocoService . getTranslation (
134+ const errorMessage = this . translocoService . translate (
135135 'wallets.buyNum.failedToAddPoints'
136136 ) ;
137137 this . errorService . toastError$ ( errorMessage ) . toPromise ( ) ;
@@ -175,7 +175,7 @@ export class InAppStoreService implements OnDestroy {
175175 }
176176
177177 private readonly onStoreError = ( _ : IAPError ) => {
178- const errorMessage = this . translocoService . getTranslation (
178+ const errorMessage = this . translocoService . translate (
179179 'inAppPurchase.inAppPurchaseErrorOcurred'
180180 ) ;
181181 this . errorService . toastError$ ( errorMessage ) . toPromise ( ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ import { isDevMode } from '@angular/core';
22import { IAPProduct } from '@awesome-cordova-plugins/in-app-purchase-2/ngx' ;
33import { CaptureInAppProductIds } from '../shared/in-app-store/in-app-store.service' ;
44
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+
511/**
612 * Usefull to see in app product state changes in console for better debugging.
713 * It will pring to console only in dev mode aka isDevMode() === true
You can’t perform that action at this time.
0 commit comments