pear:packages:payment_process2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
pear:packages:payment_process2 [2009/03/16 03:37] clockwerxpear:packages:payment_process2 [2009/05/06 07:09] clockwerx
Line 77: Line 77:
 </code> </code>
  
-Anything which used 
-<code> 
-PAYMENT_PROCESS_SOMETHING_CONSTANT 
-</code> 
-will be  
-<code> 
-Payment_Process2::SOMETHING_CONSTANT 
-</code> 
  
-as appropriate - as of 0.2.0. 
  
 ===== Roadmap ===== ===== Roadmap =====
Line 117: Line 108:
     * Need to improve the test case loaders and what have you     * Need to improve the test case loaders and what have you
     * <del>Swap to class constants.</del>     * <del>Swap to class constants.</del>
 +=== API changes ===
 +Anything which used
 +<code php>
 +PAYMENT_PROCESS_SOMETHING_CONSTANT
 +</code>
 +will be 
 +<code php>
 +Payment_Process2::SOMETHING_CONSTANT
 +</code>
 +
 +Also; setPayment() is now a lot more angry about things.
 +
 +Finally; Payment_Process2_Type::isValid() doesn't exist anymore.
  
 ==== 0.3.0 ==== ==== 0.3.0 ====
 +  * <del>Add ANZ driver</del>
   * Fix typeMapping concept   * Fix typeMapping concept
   * Fix cvvCode concept in results   * Fix cvvCode concept in results
   * Use reflection where appropriate   * Use reflection where appropriate
 +<code php>
 +<?php
  
 +$process = Payment_Process2::factory('ANZ');
 +$process->setLogin('Damo');
 +$process->setPassword('secret');
 +
 +$cc = Payment_Process2_Type::factory('CreditCard');
 +$cc->setType(Payment_Process2_Type_CreditCard::MASTERCARD);
 +$cc->setCardNumber('5123456789012346');
 +$cc->setExpDate('05/2011');
 +$cc->setCvv('123');
 +
 +$action = Payment_Process2_Action::factory($process, 'Normal');
 +$action->setPayment($cc);
 +$action->setOrderInfo('123432');
 +$action->setTransactionReference('123432/1');
 +
 +$result = $process->process($action);
 +
 +/*
 +
 +Responsibilities:
 +
 +  Processor:
 +    Knows the endpoint, prepares the request from data.
 +    Knows credentials.
 +    Has a translator for the action types.
 +    Has a translator for the base fields such as credentials.
 +    Has a process() method that:
 +      Passes response data into a Result and call the parser method.
 +      Returns the Result.
 +
 +  Action:
 +    Has a translator for the data
 +    Prepares data.
 +
 +  Translator:
 +    Very generic. Is never extended so that we don't litter
 +      the class tree; instead, we set up the translator in
 +      constructor methods.
 +
 +  Result:
 +    Has a parser that transforms the response into data that is given to it
 +      by the processor.
 +    Has a translator for the result data.
 +
 +*/
 +</code>
  
          
pear/packages/payment_process2.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1