Adventures in Payment Processing 360 view from around the - - PowerPoint PPT Presentation

adventures in payment processing 360 view from around the
SMART_READER_LITE
LIVE PREVIEW

Adventures in Payment Processing 360 view from around the - - PowerPoint PPT Presentation

Adventures in Payment Processing 360 view from around the globe Goals for Today History: Payment Processing in CiviCRM Current state of affairs


slide-1
SLIDE 1

Adventures ¡in ¡Payment ¡Processing ¡ 360 ¡view ¡from ¡around ¡the ¡globe ¡

slide-2
SLIDE 2

Goals ¡for ¡Today ¡

  • History: ¡Payment ¡Processing ¡in ¡CiviCRM ¡
  • Current ¡state ¡of ¡affairs ¡– ¡based ¡on ¡true ¡stories! ¡
  • Moving ¡onward ¡and ¡forward ¡

There ¡will ¡be ¡no ¡Eme ¡for ¡any ¡ ¡ ¡quesEons… ¡

slide-3
SLIDE 3

Payment ¡Processing ¡

  • Is ¡there ¡anything ¡more ¡important? ¡… ¡to ¡

so ¡many ¡organizaEons ¡than ¡the ¡ability ¡to ¡ process ¡a ¡variety ¡of ¡live ¡payments ¡across ¡ all ¡CiviCRM ¡pathways? ¡

slide-4
SLIDE 4

In ¡the ¡beginning ¡

slide-5
SLIDE 5

There ¡was ¡PayPal… ¡

  • PayPal ¡was ¡wriLen ¡directly ¡into ¡Core ¡AS ¡IF ¡it ¡was ¡

the ¡only ¡Payment ¡Processor ¡out ¡there! ¡

  • and ¡– ¡fair ¡enough ¡-­‑ ¡it ¡essenEally ¡was! ¡

¡ ¡civispace-­‑0.8.3 ¡

  • was ¡certainly ¡meant ¡to ¡be ¡processor ¡agnosEc ¡
  • over ¡Eme ¡a ¡lot ¡of ¡PayPal ¡assumpEons ¡went ¡into ¡

Core ¡and ¡not ¡everything ¡got ¡refactored ¡into ¡ PayPal ¡specific ¡bits ¡

slide-6
SLIDE 6

PayPal ¡Became ¡Entangled ¡in ¡Core ¡

$ ¡grep ¡-­‑inr ¡paypal ¡civicrm ¡| ¡wc ¡–l ¡

441 ¡

Example: ¡ CRM/Event/Form/ParEcipant.php:277: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

if ¡($paymentProcessor['payment_processor_type'] ¡== ¡'PayPal' ¡&& ¡! $paymentProcessor['user_name']) ¡{ ¡

slide-7
SLIDE 7

PayPal ¡Express ¡ PayPal ¡Pro ¡ PayPal ¡Standard ¡

3 ¡Flavors: ¡

slide-8
SLIDE 8

PayPal ¡Express ¡ PayPal ¡Pro ¡ PayPal ¡Standard ¡

3 ¡Flavors: ¡ 3 ¡Buckets ¡

billing_mode ¡ form_mode ¡ express ¡

slide-9
SLIDE 9

PayPal ¡Express ¡ PayPal ¡Pro ¡ PayPal ¡Standard ¡

3 ¡Flavors: ¡ 3 ¡Buckets ¡

billing_mode ¡ form_mode ¡ express ¡

NOT ¡an ¡omission ¡ Cannot ¡do ¡AMEX ¡ with ¡PayPal ¡Pro ¡in ¡ Canada ¡

slide-10
SLIDE 10

IntroducEon ¡of ¡PayPal ¡Vagaries ¡

  • PayPal ¡standard ¡does ¡not ¡support ¡backoffice ¡– ¡so ¡
  • ffsite ¡(hosted) ¡payments ¡via ¡backoffice ¡do ¡not ¡

work, ¡period. ¡

  • PayPal ¡has ¡delayed ¡payment ¡for ¡recurring ¡

contribuEons ¡– ¡so ¡assume ¡delayed ¡payment ¡for ¡ all ¡recurring ¡contribuEons ¡

  • PayPal ¡does ¡IPNs ¡– ¡so ¡there ¡is ¡no ¡place ¡in ¡Core ¡to ¡

store/handle ¡tokens ¡(customer ¡codes) ¡

slide-11
SLIDE 11

Processors ¡Added ¡to ¡Core ¡

slide-12
SLIDE 12

BaseIPN ¡

  • Horrible ¡things ¡happened ¡

¡kept ¡on ¡happening ¡ ¡ ¡to ¡the ¡BaseIPN ¡

slide-13
SLIDE 13

Extensions ¡Framework ¡Introduced ¡

  • Developers ¡LOVE ¡

extensions! ¡

  • OrganizaEons ¡LOVE ¡to ¡

choose/work ¡with ¡ Payment ¡Processor ¡of ¡ their ¡choice! ¡

  • Payment ¡Processor ¡

Extensions ¡– ¡first ¡off ¡ the ¡blocks! ¡

slide-14
SLIDE 14

and ¡Kept ¡Evolving ¡

  • And ¡over ¡the ¡years ¡Payment ¡Processor ¡

extensions ¡started ¡trying ¡to ¡do ¡more ¡complex ¡ things: ¡e.g. ¡ACH/EFT ¡(direct ¡debit), ¡encrypted ¡ swipe, ¡direct ¡post, ¡backoffice ¡recurring, ¡etc. ¡

slide-15
SLIDE 15

Current ¡State ¡of ¡Affairs ¡

  • What ¡sort ¡of ¡Payment ¡Processors ¡are ¡there ¡

now ¡– ¡and ¡what ¡do ¡they ¡look ¡like ¡compared ¡to ¡ CiviCRM ¡assumpEons? ¡

slide-16
SLIDE 16

Type ¡ Examples ¡(not ¡a ¡ complete ¡ lis2ng) ¡ Fit ¡with ¡built-­‑in ¡ assump2ons ¡ Simple ¡onsite ¡ Credit ¡Card ¡ PayPal ¡Pro, ¡Eway ¡ Standard ¡

✔ ¡

Simple ¡redirect ¡ DPS ¡Payment ¡ Express ¡

✔ ¡

Random ¡PayPal ¡ specific ¡ PayPal ¡Express ¡ (only) ¡

✔ ¡

slide-17
SLIDE 17

ACH/EFT ¡(direct ¡ debit) ¡ iATS ¡Payments, ¡ Moneris ¡(last) ¡

✘ ¡

JS ¡intercept ¡ Eway ¡client ¡side ¡(3) ¡ encrypEon, ¡(Stripe) ¡

✘ ¡

Transparent ¡ redirect ¡ Cybersource ¡(2) ¡

✘ ¡

Off-­‑site ¡post ¡ Paybox ¡(1) ¡

✘ ¡

Payment ¡ tokenizaEon ¡ Beanstream, ¡iATS ¡ Payments, ¡eWay ¡ recurring ¡

✘ ¡

Fly-­‑ins ¡ Global ¡Collect ¡(4) ¡

✘ ¡

slide-18
SLIDE 18

CiviCRM ¡thinks ¡It ¡can ¡build ¡a ¡form ¡ based ¡on ¡assumpEons ¡about ¡the ¡ processor ¡but ¡the ¡assumpEons ¡are ¡ based ¡on ¡PayPal ¡

slide-19
SLIDE 19

CiviCRM ¡thinks ¡It ¡can ¡build ¡a ¡form ¡ based ¡on ¡assumpEons ¡about ¡the ¡ processor ¡but ¡the ¡assumpEons ¡are ¡ based ¡on ¡PayPal ¡

slide-20
SLIDE 20

Poking ¡through ¡ buckets ¡

com.paymentprocessor.civicrm ¡ Membership Event Registration Bookkeeping Etc

slide-21
SLIDE 21

iATS ¡Extension ¡– ¡Test ¡Matrix ¡-­‑ ¡p1 ¡

Extensive ¡tesEng ¡is ¡required ¡– ¡because ¡every ¡ ¡ pathway ¡has ¡its ¡own ¡logic ¡

slide-22
SLIDE 22

But… ¡organizaEons ¡want ¡to: ¡ ¡

  • Membership ¡+ ¡
  • Recurring ¡+ ¡
  • ACH/EFT ¡(Direct ¡Debit) ¡+ ¡
  • by ¡admin ¡staff ¡in ¡backoffice! ¡

¡ ¡Sorry… ¡

slide-23
SLIDE 23

IF ¡

$paymentParams[contribuEon_status_id] ¡= ¡1 ¡

All ¡subsequent ¡logic ¡should ¡reside ¡in ¡CiviCRM ¡core ¡ and ¡should ¡be ¡Payment ¡Processor ¡agnosEc ¡

  • event ¡registraEon ¡(online ¡or ¡backoffice, ¡credit ¡

card ¡or ¡direct ¡debit) ¡-­‑ ¡✔ ¡

  • membership ¡(online ¡or ¡backoffice ¡or ¡recurring ¡
  • nline, ¡or ¡recurring ¡backoffice, ¡credit ¡card ¡or ¡

direct ¡debit) ¡-­‑ ¡✔ ¡

slide-24
SLIDE 24

Onward ¡and ¡Forward: ¡Recently ¡

  • 4.6 ¡code ¡changes: ¡decoupling ¡of ¡payment ¡

processor ¡type ¡from ¡assumpEons: ¡power ¡to ¡ the ¡processors ¡– ¡does ¡this ¡processor ¡support ¡ back ¡office ¡transacEons? ¡Let's ¡ask ¡it! ¡

if ¡($processor-­‑>supports('BackOffice')) ¡{ ¡ // ¡sing ¡& ¡dance! ¡ } ¡

slide-25
SLIDE 25

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>supportsLiveMode() ¡

slide-26
SLIDE 26

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>supportsFutureRecurStartDate() ¡

slide-27
SLIDE 27

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>supports('BackOffice') ¡

slide-28
SLIDE 28

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>getPaymentFormFields() ¡

slide-29
SLIDE 29

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>getPaymentFormFieldsMetadata() ¡

slide-30
SLIDE 30

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>getPaymentTypeLabel() ¡(e.g ¡Credit ¡Card) ¡

slide-31
SLIDE 31

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>getPaymentTypeName() ¡(e.g ¡credit_card) ¡

slide-32
SLIDE 32

Override-­‑able ¡in ¡4.6 ¡

  • Payment ¡Processor ¡Extensions ¡can ¡now ¡override ¡

these ¡assumpEons: ¡

$processor-­‑>validatePaymentInstrument($values, ¡ $errors); ¡

slide-33
SLIDE 33

Death ¡to ¡Singletons! ¡

Old ¡Way ¡

  • $paymentProcessor ¡= ¡

CRM_Financial_BAO_PaymentProcessor:: ¡ ¡ ¡ ¡ ¡ ¡getPayment($payment_processor_id, ¡ ¡ ¡ ¡ ¡'live'); ¡

  • $paymentObject ¡= ¡ ¡

¡CRM_Core_Payment:: ¡ ¡ ¡ ¡ ¡ ¡singleton('test', ¡$paymentProcessor); ¡

slide-34
SLIDE 34

Start ¡Phasing ¡Them ¡Out ¡Now! ¡

New ¡Way ¡

  • Civi\Payment\System::singleton()-­‑> ¡

¡ ¡getById($paymentProcessor) ¡

  • Civi\Payment\System::singleton()-­‑> ¡

¡getByProcessor($paymentProcessor) ¡

slide-35
SLIDE 35

So… ¡surely ¡now ¡we ¡can ¡do ¡off-­‑site ¡ transacEons ¡via ¡backoffice? ¡

slide-36
SLIDE 36

So… ¡surely ¡now ¡we ¡can ¡do ¡off-­‑site ¡ transacEons ¡via ¡backoffice? ¡

slide-37
SLIDE 37

So… ¡surely ¡now ¡we ¡can ¡do ¡off-­‑site ¡ transacEons ¡via ¡backoffice? ¡

Uh… ¡no ¡-­‑ ¡Because ¡the ¡Paypal ¡assumpEon ¡was ¡so ¡ heavily ¡wriLen ¡into ¡the ¡code ¡that ¡backoffice ¡ contribuEons ¡create ¡completed ¡ ¡ contribuEons ¡or ¡they ¡get ¡rolled ¡

  • back. ¡In ¡front-­‑end ¡forms ¡the ¡ ¡

pathways ¡for ¡onsite ¡& ¡offsite ¡ ¡ transacEons ¡ayer ¡form ¡ ¡ submission ¡are ¡heavily ¡forked ¡& ¡ ¡ hard ¡to ¡read... ¡

slide-38
SLIDE 38

A ¡BeLer ¡Approach ¡(IEHO) ¡

  • A ¡strong ¡tested ¡API ¡funcEon ¡to ¡create ¡pending ¡

transacEons ¡for ¡ANY ¡transacEon ¡ ¡

  • When ¡the ¡outcome ¡is ¡known ¡(by ¡whatever ¡

means) ¡a ¡funcEon ¡to ¡update ¡this ¡status ¡to ¡ completed ¡or ¡failed ¡ ¡

  • The ¡flow ¡would ¡be ¡the ¡same ¡for ¡on-­‑site ¡AND ¡
  • ff-­‑site ¡
slide-39
SLIDE 39

A ¡BeLer ¡Approach ¡(IEHO) ¡

  • Could ¡it ¡be ¡the ¡same ¡for ¡pay-­‑later? ¡(one ¡to ¡

ponder) ¡Pay ¡Later ¡has ¡extra ¡complicaEons ¡– ¡ but ¡are ¡they ¡really ¡also ¡relevant ¡to ¡incomplete? ¡ ¡

  • Could ¡Pay ¡Later ¡be ¡implemented ¡as ¡a ¡

processor? ¡

slide-40
SLIDE 40

Recurring ¡TransacEons ¡& ¡Tokens ¡

Need ¡to ¡STOP ¡wriEng ¡these ¡per ¡processor! ¡ ¡

  • contribuEon.repeaLransacEon ¡(exists) ¡to ¡

create ¡a ¡new ¡transacEon ¡copying ¡soy_credits, ¡ line_items ¡etc ¡(CRM-­‑15996) ¡ ¡ ¡

  • paymenLoken ¡extension ¡has ¡started ¡to ¡create ¡

common ¡storage, ¡api ¡& ¡views ¡access ¡for ¡tokens ¡ – ¡but ¡core ¡would ¡make ¡more ¡sense ¡

slide-41
SLIDE 41

Omnipay ¡= ¡Open ¡Source ¡Framework ¡ for ¡Payment ¡Processors ¡

  • allows ¡Omnipay ¡Gateways ¡to ¡be ¡plugged ¡in ¡
  • provides ¡mechanism ¡for ¡TransparentRedirect ¡

and ¡offsite ¡POST ¡

  • implements ¡IPNs ¡provided ¡there ¡is ¡a ¡

transacEon ¡idenEfier ¡(current ¡problem ¡with ¡ Mollie) ¡ hLps://github.com/eileenmcnaughton/ nz.co.fuzion.omnipaymulEprocessor.git ¡

slide-42
SLIDE 42

Convince ¡me ¡-­‑ ¡why ¡not ¡Omnipay? ¡ ¡

  • of ¡the ¡30 ¡Payment ¡Processors ¡out ¡there: ¡3 ¡

currently ¡integrated ¡into ¡CiviCRM ¡via ¡OmniPay ¡

  • Omnipay ¡is ¡a ¡good ¡model ¡for ¡fairly ¡simple ¡

processors ¡-­‑ ¡about ¡80% ¡of ¡those ¡in ¡the ¡wild ¡ could ¡be ¡in ¡the ¡Omnipay ¡stable ¡

  • but ¡complex ¡ones ¡like ¡Stripe ¡or ¡iATS ¡Payments ¡

may ¡not ¡fit ¡-­‑ ¡but ¡that’s ¡ok ¡-­‑ ¡they ¡can ¡remain ¡ Extensions ¡

  • not ¡sure ¡about ¡PayPal ¡Express? ¡
slide-43
SLIDE 43

CiviCRM ¡-­‑ ¡eventually ¡

CiviContribute ¡

OMNIPAY ¡ EXTENSION ¡ BRIDGE ¡

com.drasEkbydesign.stripe ¡

  • mnipay.authnet ¡
  • mnipay.paypal ¡

com.iatspayments.civicrm ¡ Membership ¡ ¡ Events ¡ Bookkeeping ¡ Etc ¡ Omnipay ¡Library ¡

  • mnipay.gopay ¡
slide-44
SLIDE 44

Park Canada: Fire plays many important ecological roles in ecosystems - it is beneficial and necessary to maintain health and diversity!

slide-45
SLIDE 45

Your ¡CiviCRM ¡needs ¡you! ¡

  • Can ¡CiviCRM ¡afford ¡NOT ¡to ¡provide ¡a ¡

beLer ¡framework ¡that ¡would ¡support ¡ new ¡and ¡advanced ¡Payment ¡Processor ¡ funcEonality? ¡

  • Is ¡there ¡anything ¡more ¡important ¡to ¡so ¡

many ¡organizaEons ¡than ¡the ¡ability ¡to ¡ process ¡a ¡variety ¡of ¡live ¡payments ¡across ¡ all ¡pathways? ¡

slide-46
SLIDE 46

hLps://github.com/thephpleague/omnipay ¡ hLps://civicrm.org/blogs/eileen/rethinking-­‑payment-­‑processing ¡ hLp://wiki.civicrm.org/confluence/display/CRM/Order+API ¡

THANK ¡YOU! ¡