Google Cloud Payment Method API - google-cloud-platform

Is there any API for Google Cloud - that allows you to create billing payment method to be created?
I can create a billing account for Google Cloud using an API https://cloud.google.com/billing/reference/rest/v1/billingAccounts, however I can't seem to find a way to add payment method to this billing account.
Did any one ran in this problem before?

Google Cloud Billing API is designed to help you manage billing accounts, and their linkage to projects. Google Cloud does not provide an API to add payment information, such as credit card numbers.
Google Cloud's Billing API is designed to comply with PCI Data Security Standards (DSS). According to PCI DSS,
The PCI DSS applies to all entities that store, process, and/or transmit cardholder data.
That means you. If you write an application that stores cardholder data and transmits it programmatically, then you, yourself, may require a PCI DSS assessment of your CDE (cardholder data environment). This is likely not what you intend.
The Stripe API for Payment Methods offers similar guidance:
When creating with a card number, you must meet the requirements for PCI compliance. We strongly recommend using Stripe.js instead of interacting with this API directly.

Related

How to charge users by usage?

I’m building a service and I’m planning to charge a fixed price for each lambda call.
How to count requests per client if the lambda function being called is the same? I’m planning to pass a client id
You can use API Gateway Usage Plans for your requirement.
After you create, test, and deploy your APIs, you can use API Gateway usage plans to make them available as product offerings for your customers. You can configure usage plans and API keys to allow customers to access selected APIs at agreed-upon request rates and quotas that meet their business requirements and budget constraints. If desired, you can set default method-level throttling limits for an API or set throttling limits for individual API methods.
A usage plan specifies who can access one or more deployed API stages and methods—and also how much and how fast they can access them. The plan uses API keys to identify API clients and meters access to the associated API stages for each key. It also lets you configure throttling limits and quota limits that are enforced on individual client API keys.
Read this docs for more detail explanation.
You can use api gateway https://aws.amazon.com/api-gateway/
"Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. APIs act as the "front door" for applications to access data, business logic, or functionality from your backend services."
It provides you with statistics about usage as well as different options like limit numbers of requests per api_key, etc

Google Cloud Function endpoint blocked in Iran

I have an endpoint deployed in google cloud function to perform a microservice for my website. However, I noticed that our users from Iran are not seen in this microservice.
I have done some reading about US sanctions. Is it possible that Google is blocking users from Iran from access services in GCP (such as a HTTP endpoint built in Google Cloud Function)?
Or is Iran ISPs censoring Google services?
Even if this document is specific for Gsuite the restrictions of countries that cannot access Google services due US Embargoed Countries Policy that includes Iran are present for various other Google’s products. This means that restrictions in the service may affect for this country.

AWS Feature based licensing

I am designing a product which would be deployed to AWS. It will use Cognito for user authentication. It will be a multi-tenant application.
The application has many modules/features. The pricing depends on the features selected by the client.
Please provide guidance on how can I implement a check if the feature is licensed or not. I don't want to put the logic inside each web api endpoint.
You should create an application microservice (callable via a API, but with access locked down to your own application) that receives information such as:
Authenticated User ID
Service wanting to be accessed
Resource-level information in case you want fine-grained access control
The authentication microservice would consult a database, apply appropriate business logic and return a success indicator.
Preferably:
Each request should be logged in an audit trail
If access is denied, return an error message that could hint at the reason why (eg 'This feature is requires subscription to the XYZ module')
Use some form of cache to make the queries super-fast (eg DAX for DynamoDB, or ElastiCache)
Licensing systems can often be more complex than actual applications!

How to use Google cloud platform DLP API

Can anyone please tell me how to use Google Cloud DLP API and can I track my local system using these Google Cloud API like track info which is flow from Facebook, Gmail, Skype etc.?
Do you mean you want to track data flowing between those systems? I'm not aware of a way to inject yourself between them.
If you want to track what is being sent out on your local network and are looking for design ideas - one such idea could be to use a local proxy that you have configured to send all traffic through something like https://cloud.google.com/dlp/docs/reference/rpc/google.privacy.dlp.v2#inspectcontentrequest so that you can send up alerts if there is anything surprising.
Gmail also has a version of Cloud DLP built in for gsuite customers to automatically monitor/prevent employees from sending email with specific finding types.

How to get billing information through API

I want to create a web page regrouping billing information from Google Cloud Platform and Amazon Web Services.
I'm looking how to retrieve billing data from GCP.
Does it exist an API to request these data ?
I have tested CloudBilling API but it seems that it just gives information about billing account and not detail on usage & cost.