All Projects → cirruspath → Stripeforce

cirruspath / Stripeforce

Licence: mit
Stripe API Client Library for Force.com

Labels

Projects that are alternatives of or similar to Stripeforce

Apex Chainable
Chain Batches in a readable and flexible way without hardcoding the successor.
Stars: ✭ 27 (-46%)
Mutual labels:  apex
Game Cheating Tutorial
热门网络游戏辅助开发教程
Stars: ✭ 961 (+1822%)
Mutual labels:  apex
Forcedotcomsprintwall
An agile sprint wall built on the force.com platform with jQuery and Javascript Remoting
Stars: ✭ 42 (-16%)
Mutual labels:  apex
Force.com Utility Library
Salesforce Utility
Stars: ✭ 9 (-82%)
Mutual labels:  apex
Sfdc Debug Logs
Browser extension for Salesforce logs management
Stars: ✭ 28 (-44%)
Mutual labels:  apex
Grid
A Lightning Component grid implementation that expects a server-side data store.
Stars: ✭ 35 (-30%)
Mutual labels:  apex
Salesforce Apex Templates
Looking for a possibility to use Email Templates within APEX code? Here's the answer!
Stars: ✭ 22 (-56%)
Mutual labels:  apex
Ridge
AWS Lambda HTTP Proxy integration event bridge to Go net/http.
Stars: ✭ 45 (-10%)
Mutual labels:  apex
Pytorch Auto Drive
Segmentation models (ERFNet, ENet, DeepLab, FCN...) and Lane detection models (SCNN, SAD, PRNet, RESA, LSTR...) based on PyTorch 1.6 with mixed precision training
Stars: ✭ 32 (-36%)
Mutual labels:  apex
Data Ingestion Platform
Stars: ✭ 39 (-22%)
Mutual labels:  apex
Cdev Server
Development REST API for InterSystems Caché 2014.1+
Stars: ✭ 11 (-78%)
Mutual labels:  apex
Df17 Ant To Sfdx
Metadata repository demonstrating move from Ant Migration Tools to the Salesforce CLI
Stars: ✭ 20 (-60%)
Mutual labels:  apex
Objectmerge
Open-source solution for merging Salesforce objects and their related objects.
Stars: ✭ 35 (-30%)
Mutual labels:  apex
Affiliationsecurity
HEDA Affiliation-Based Security for Salesforce
Stars: ✭ 8 (-84%)
Mutual labels:  apex
Purealoe Lwc
Sample application for Lightning Web Components on Salesforce Platform. Part of the sample gallery. Agriculture and retail use case. Get inspired and learn best practices.
Stars: ✭ 43 (-14%)
Mutual labels:  apex
Fflib Apex Common Builder
Builder Extension library to fflib_apex-common
Stars: ✭ 25 (-50%)
Mutual labels:  apex
Sendgrid Apex
SendGrid (http://sendgrid.com) Apex helper library.
Stars: ✭ 33 (-34%)
Mutual labels:  apex
Dg Net
Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral)
Stars: ✭ 1,042 (+1984%)
Mutual labels:  apex
Gh Polls
Create a poll with gh-polls
Stars: ✭ 45 (-10%)
Mutual labels:  apex
Forcedotcom Enterprise Architecture
Force.com Enterprise Architecture - First Edition - Source Code
Stars: ✭ 35 (-30%)
Mutual labels:  apex

Stripe SDK for Force.com

Stripe is a fantastic developer-friendly payment processing platform. This SDK was originally developed by Cirruspath in 2012. Please send comments, pull requests, and questions here on github.

Stripe API Documentation

Read up: https://stripe.com/docs/api

Listening for Webhooks

To implement a listener for Stripe webhooks, start with the ExampleWebhookListener.cls class. This class isn't included in the 'src' directory to help avoid contributors' own webhook implementations from unintentionally gettting committed to this public repo or from being overwritten when they pull in the latest code.

Note that not ALL Stripe webhooks are currently supported. However, support for additional webhooks can easily be added to the StripeWebhookListener class. If you make changes to it, please also include the corresponding updates to this webhook implementation class.

WebhookDelayedProcessor

There is often an "indexing delay" after inserting (or updating) records in Salesforce. If your Webhook implementation relies on finding existing records to complete its task (i.e. searching for the account that corresponds to a new Stripe customer), you may find the WebhookDelayedProcessor job useful.

In the example below, after searching for a 'license', we're unable to find one. We check to ensure that delayed processing is allowed (an implementation choice), and we create a Stripe_Webhook__c record with the webhook details. A scheduled job will then re-run the appropriate webhook handler up to 3 times, waiting 5 minutes beteween attempts -- adequate time for Salesforce indexing to catch up.

public void handle_ChargeSucceeded(StripeCharge charge, Boolean allowDelayedProcessing) {
...
		if (license == null) {
			if (allowDelayedProcessing) {
				System.debug(System.LoggingLevel.INFO, '\n**** License Not Found; Delay Webhook Processing'); 
				Stripe_Webhook__c webhook = new Stripe_Webhook__c(
					Webhook_Type__c = 'charge.succeeded',
					Webhook_Data__c = JSON.serializePretty(charge)
				);
				insert webhook;
				return;
			} 
				
			throw new WebhookDelayedProcessor.WebhookDelayedProcessorException();
		}
...
}

Note that delayed processing is currently only implemented for the charge.succeeded webhook, but extending the concept to other webhooks (or making it generic) is not difficult.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].