2020
2121/*
2222 * Account information. Below is all the variables needed to perform a purchase with
23- * payson. Replace the placeholders with your actual information
23+ * payson. Replace the placeholders with your actual information
2424 */
2525
2626// Your agent ID and md5 key
4747$ senderLastname = "Person " ;
4848
4949
50- /* Every interaction with Payson goes through the PaysonApi object which you set up as follows.
50+ /* Every interaction with Payson goes through the PaysonApi object which you set up as follows.
5151 * For the use of our test or live environment use one following parameters:
5252 * TRUE: Use test environment, FALSE: use live environment */
53- $ credentials = new PaysonCredentials ($ agentID , $ md5Key );
53+ $ credentials = new PaysonApi_PaysonCredentials ($ agentID , $ md5Key );
5454$ api = new PaysonApi ($ credentials , TRUE );
5555
5656/*
6767
6868
6969// Details about the receiver
70- $ receiver = new Receiver (
70+ $ receiver = new PaysonApi_Receiver (
7171 $ receiverEmail , // The email of the account to receive the money
7272 $ amountToReceive ); // The amount you want to charge the user, here in SEK (the default currency)
7373$ receivers = array ($ receiver );
7474
7575// Details about the user that is the sender of the money
76- $ sender = new Sender ($ senderEmail , $ senderFirstname , $ senderLastname );
76+ $ sender = new PaysonApi_Sender ($ senderEmail , $ senderFirstname , $ senderLastname );
7777
78- $ payData = new PayData ($ returnURL , $ cancelURL , $ ipnURL , "Min fina vara " , $ sender , $ receivers );
78+ $ payData = new PaysonApi_PayData ($ returnURL , $ cancelURL , $ ipnURL , "Min fina vara " , $ sender , $ receivers );
7979
8080//Set the list of products. For direct payment this is optional
8181$ orderItems = array ();
82- $ orderItems [] = new OrderItem ("Test produkt " , 100 , 1 , 0.25 , "kalle " );
82+ $ orderItems [] = new PaysonApi_OrderItem ("Test produkt " , 100 , 1 , 0.25 , "kalle " );
8383
8484$ payData ->setOrderItems ($ orderItems );
8585
8686
8787//Set the payment method
88- $ constraints = array (FundingConstraint ::BANK );
88+ $ constraints = array (PaysonApi_FundingConstraint ::BANK );
8989$ payData ->setFundingConstraints ($ constraints );
9090
9191//Set the payer of Payson fees
92- $ payData ->setFeesPayer (FeesPayer ::PRIMARYRECEIVER );
92+ $ payData ->setFeesPayer (PaysonApi_FeesPayer ::PRIMARYRECEIVER );
9393
9494// Set currency code
95- $ payData ->setCurrencyCode (CurrencyCode ::SEK );
95+ $ payData ->setCurrencyCode (PaysonApi_CurrencyCode ::SEK );
9696
9797// Set locale code
98- $ payData ->setLocaleCode (LocaleCode ::SWEDISH );
98+ $ payData ->setLocaleCode (PaysonApi_LocaleCode ::SWEDISH );
9999
100100// Set guarantee options
101- $ payData ->setGuaranteeOffered (GuaranteeOffered ::OPTIONAL );
101+ $ payData ->setGuaranteeOffered (PaysonApi_GuaranteeOffered ::OPTIONAL );
102102
103103/*
104104 * Step 2 initiate payment
114114 */
115115 header ("Location: " . $ api ->getForwardPayUrl ($ payResponse ));
116116}
117- ?>
117+ ?>
0 commit comments