Google is reporting an E_DEVELOPER_ERROR, suggesting there may be a problem with our connection to the payment system

I encountered an issue after incorporating Google Play subscription in my React Native project using the package

"react-native-iap": "12.10.4",
.

The error message reads as follows:

E_DEVELOPER_ERROR Google is indicating that we have some issue connecting to payment.

After facing a number of challenges with this particular package, I was able to resolve them up to the point where I encountered the aforementioned error while attempting to subscribe using the following code:

async subscribe(sku: string, offerToken: string) {
    let res = null;

    const init = await initConnection();
    console.log(init);

    try {
      res = await requestSubscription({
        purchaseTokenAndroid: sku,
        subscriptionOffers: [{sku, offerToken}],
      });
    } catch (err) {
      console.warn(err.code, err.message);
    }

    return res;
  }

Although the 'sku' and 'offerToken' values are accurate, running this code still results in the specified error message.

I am currently using an internal testing release and have attempted adding my Google account to both internal testers and License testing to no avail.

Answer №1

My implementation of requestSubscription() was incorrect.

The correct way to implement it is as follows:

await requestSubscription({
        sku: productId,
        ...(offerToken && {
          subscriptionOffers: [{sku: productId, offerToken}],
        }),
      })

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to implement persistStore in Redux-Toolkit?

Here is my setup: import AsyncStorage from '@react-native-async-storage/async-storage' import { persistStore, persistReducer } from 'redux-persist'; import { configureStore } from "@reduxjs/toolkit"; import { searchReducer } f ...

A function that takes an array of objects and combines all their keys to create a single unified object representing all the information

I have a JavaScript function that accepts an array containing zero or more objects of type {string => async fn*(...) => ...} (with the asterisk indicating async generator functions). This function will output a single object which combines all keys ...

Is there a way in Typescript to dynamically create a type based on an array of potential values?

I am seeking a solution to dynamically define a type based on an array of possibilities. Within the provided map, the keys represent the type's name, while the corresponding values are arrays containing possible options for that type. export const ty ...

Utilizing svgr in NextJS with TypeScript and Webpack

I have a collection of separate svg files that I want to load in React and use as React components. Here is an example of how I am trying to do this: import SampleIcon from '@/components/editor/icons/add-column-after.svg'; <SampleIcon classNam ...

Display a custom error message containing a string in an Angular error alert

How can I extract a specific string from an error message? I'm trying to retrieve the phrase "Bad Request" from this particular error message "400 - Bad Request URL: put: Message: Http failure response for : 400 Bad Request Details: "Bad Request ...

What is the best method to determine the length of a DataSource in react-native?

Is there a way to retrieve the length of a ListView's DataSource? Let's say we have this declaration: const ds = new ListView.DataSource({ rowHasChanged }); ... someObjectsDs = ds.cloneWithRows(someObjectsArray); I attempted to use someObjects ...

Using Typescript in conjunction with nodemon and VS Code for seamless integration of declaration merging

After adding a middleware to my express app app.use(function(req: express.Request, res: express.Response, next: express.NextFunction) { req.rawBody = 'hello2'; next(); }); I also included custom.d.ts declare namespace Express { expor ...

Understanding Typescript parameter types that reference another parameter is essential for writing concise and

Looking to create a unique interface interface CustomObject { x: string; y: number; z: string[]; } I am in need of a specialized function function customFunction(obj: CustomObject, property: keyof CustomObject, data: any) Currently, the 'da ...

Executing 'npm start' initiates the process of installing expo-cli in a continuous loop

INQUIRY: What steps can I take to ensure that $ echo $PATH displays export PATH=~/.npm-global/bin:$PATH CONTEXT: I ran an npm install on macOS Catalina through the terminal and encountered a recurring issue with installing expo cli when attempting to us ...

Having difficulty subscribing to multiple observables simultaneously using withLatestFrom

I am facing an issue where I have three observables and need to pass their values to a service as parameters. I attempted to do this using WithLatestFrom(), but it works fine only when all values are observables. this.payment$.pipe( withLatestFrom(this.fir ...

Incorporating TypeScript basics into the if statement post compiling

As I delve into the Angular2 Quickstart, I stumbled upon a peculiar issue within app.component.js after compiling app.component.ts using tsc (version 1.8.2): if (d = decorators[i]) I am unable to pinpoint where I may have gone wrong in configuring the qu ...

Encountering difficulty in resolving the getTheme module 'themes/components' within NativeBase

Excitement fills me as I embark on my journey with react-native, particularly after discovering the seamless integration with native-base. However, my enthusiasm waned when I encountered an issue while attempting to implement Customizing themes for NativeB ...

What is the reason onPress does not trigger after a new view is rendered but triggers before it's rendered in React Native?

I've taken on a project created by the agora.io community. You can find the original project here: https://github.com/AgoraIO-Community/Agora-RN-Quickstart. If you take a quick look at the App.tsx file in that repository, you'll see the file I&ap ...

Finding compatibility between two arrays with flexibility

I am currently working on an Ionic app that involves an array of ingredients and a service with recipes. You can find the structure of the recipe service here. My goal is to match the ingredients with the recipes. Currently, I have implemented the followi ...

How can the center element be aligned without recursively centering all children?

How can I center all children within a particular element without affecting their children? <Col style={{ textAlign: "center" }}> <Space>...</Space> <div>...</div> </Col> In this scenario, I am utilizing t ...

Example of Signature in TypeScript Function Declaration

While going through this documentation, I found myself puzzled by the concept of having a parameter that can be both an object and a function in JavaScript. type DescribableFunction = { description: string; (a: any): boolean; }; function doSomething( ...

Common problem encountered with TypeScript is the preference for using import instead of require statements

Is there a correct way to handle the issue of using import over require breaking type checking? Can imports be cast, and are all require's replaceable with import's? https://i.sstatic.net/iihi3.png Left: Property 'get' does not exist. ...

Running the React Native official examples packager on a Windows system - a guide to success

Upon following the instructions outlined in this guide and successfully cloning the official repository, gradlew :Examples:UIExplorer:android:app:installDebug The next step as per the guide is to Start the packager in a separate shell (ensure np ...

The specified resource cannot be found in the CDK Stack Export

I'm facing an issue while trying to import values generated and exported from a cdk stack that deploys into eu-west-1 into a different stack that needs to be deployed into af-south-1. The error message states that the export name does not exist: EU n ...

Node.js and mongoose provide a powerful tool for filtering documents dynamically by leveraging a variable that is dependent on another document. Want to learn

I've hit a bit of a roadblock here... I'm trying to add a new property to a document that will change based on the values in that document as well as another document. Let me provide an example to clarify. First, I have a Candidate Schema: const ...