Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcbf644b

Browse files
author
membersuite
committed
3.33.0.1167
1 parent1df85e7 commitcbf644b

File tree

22 files changed

+4540
-785
lines changed

22 files changed

+4540
-785
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?php
2+
//include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/APISample/phpsdk.phar'); // Use PHAR Archive
3+
include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/src/MemberSuite.php');// Use the SRC Directory
4+
5+
include_once('config.php');
6+
7+
$api =newMemberSuite();
8+
9+
$api->accesskeyId = Userconfig::read('AccessKeyId');
10+
$api->associationId = Userconfig::read('AssociationId');
11+
$api->secretaccessId = Userconfig::read('SecretAccessKey');
12+
13+
// Get product information
14+
$product1 =$api->GetObject('2537d8c3-00ce-cee4-8a33-0b371e6de173');
15+
$product2 =$api->GetObject('2537d8c3-00ce-c5f2-873e-0b371e6de173');
16+
17+
// Get user information
18+
$user =$api->GetObject('2537d8c3-0006-ceb0-8352-0b371e6de173');
19+
20+
echo"Individual <strong>".$user->Name."</strong> tries to by following items: <br/>";
21+
echo$product1->Name." for $".$product1->Price."<br/>";
22+
echo$product2->Name." for $".$product2->Price."<br/>";
23+
24+
$order =newstdClass();
25+
$order->ClassType ='Order';
26+
27+
$order->BillTo ='2537d8c3-0006-ceb0-8352-0b371e6de173';
28+
$order->ShipTo ='2537d8c3-0006-ceb0-8352-0b371e6de173';
29+
30+
$order->BillingAddress =newstdClass();
31+
$order->BillingAddress->RecordType ='Address';
32+
$order->BillingAddress->City ='Atlanta';
33+
$order->BillingAddress->Country ='US';
34+
$order->BillingAddress->Line1 ='1 Str';
35+
$order->BillingAddress->PostalCode ='30303';
36+
$order->BillingAddress->State ='GA';
37+
38+
$order->LineItems =array();
39+
40+
$lineItem =newstdClass();
41+
$lineItem->ClassType ='OrderLineItem';
42+
$lineItem->Product =$product1->ID;
43+
$lineItem->Quantity =1;
44+
$lineItem->UnitPrice =$product1->Price;
45+
$lineItem->Total =$lineItem->Quantity *$lineItem->UnitPrice;
46+
$order->LineItems[0] =$lineItem;
47+
48+
$lineItem =newstdClass();
49+
$lineItem->ClassType ='OrderLineItem';
50+
$lineItem->Product =$product2->ID;
51+
$lineItem->Quantity =1;
52+
$lineItem->UnitPrice =$product2->Price;
53+
$lineItem->Total =$lineItem->Quantity *$lineItem->UnitPrice;
54+
$order->LineItems[1] =$lineItem;
55+
56+
$order->Total =0;
57+
foreach($order->LineItemsas$lineItem) {
58+
$order->Total =$order->Total +$lineItem->Total;
59+
}
60+
61+
echo"Order total: $".$order->Total."<br/>";
62+
63+
echo"Preprocessing...<br/>";
64+
$response =$api->PreprocessOrder($order);
65+
66+
if($response->aSuccess =='true'){
67+
echo"Positive response!<br/>";
68+
$finOrder =$api->data->ConvertToObject($response->aResultValue->bFinalizedOrder);
69+
70+
//for($i = 0; $i < count($finOrder->LineItems); $i++) {
71+
//var_dump($finOrder->LineItems[$i]);
72+
//}
73+
74+
$finOrder->PaymentMethod ='CreditCard';
75+
$finOrder->CreditCardNumber ='4111111111111111';
76+
$finOrder->Status ='Pending';
77+
$finOrder->CCVCode =123;
78+
$finOrder->CreditCardExpirationDate ='01/23/2015';
79+
$finOrder->NameOnCreditCard ='test';
80+
$finOrder->ProcessOrderEvenIfPaymentFails ='false';
81+
82+
echo"Placing order...<br/>";
83+
$response =$api->ProcessOrder($finOrder);
84+
if($response->aSuccess =='true'){
85+
echo"Tracking token is:".$response->aResultValue."<br/>";
86+
87+
echo"Waiting for a response...<br/>";
88+
$result =null;
89+
do {
90+
$status =$api->CheckLongRunningTaskStatus($response->aResultValue);
91+
$result = (array)$status->aResultValue;
92+
}while (count($result) ==0);
93+
94+
echo"<br/>";
95+
96+
$result =$result['bFields']->bKeyValueOfstringanyType;
97+
foreach($resultas$value){
98+
if ($value->bKey =='Description'){
99+
echo$value->bValue."<br/>";
100+
break;
101+
}
102+
}
103+
}else {
104+
var_dump($response);
105+
}
106+
}else {
107+
var_dump($response);
108+
}
109+
?>
110+
111+
Lines changed: 96 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,116 @@
11
<?php
2-
include_once($_SERVER['DOCUMENT_ROOT'].'/APISample/phpsdk.phar');
3-
4-
5-
include_once('config.php');
2+
//include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/APISample/phpsdk.phar'); // Use PHAR Archive
3+
include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/src/MemberSuite.php');// Use the SRC Directory
64

7-
$api =newMemberSuite();
5+
include_once('config.php');
86

7+
$api =newMemberSuite();
98

10-
/*
11-
This sample is going to login to the association and create a record with a name,
12-
email, and birthday that you specify. Once saved, the system will display the ID
13-
of the individual created, the age (which MemberSuite calculates), and will automatically
14-
launch the 360 view of that record in the web browser
15-
*/
9+
/*
10+
This sample is going to login to the association and create a record with a name,
11+
email, and birthday that you specify. Once saved, the system will display the ID
12+
of the individual created, the age (which MemberSuite calculates), and will automatically
13+
launch the 360 view of that record in the web browser
14+
*/
1615

17-
// First, we need to prepare the proxy with the proper security settings.
18-
// This allows the proxy to generate the appropriate security header. For more information
19-
// on how to get these settings, see http://api.docs.membersuite.com in the Getting Started section
20-
21-
22-
$api->accesskeyId = Userconfig::read('AccessKeyId');
23-
24-
$api->associationId = Userconfig::read('AssociationId');
25-
26-
$api->secretaccessId = Userconfig::read('SecretAccessKey');
27-
28-
// run a WhoAmI to establish a session
16+
// First, we need to prepare the proxy with the proper security settings.
17+
// This allows the proxy to generate the appropriate security header. For more information
18+
// on how to get these settings, see http://api.docs.membersuite.com in the Getting Started section
19+
20+
$api->accesskeyId = Userconfig::read('AccessKeyId');
21+
$api->associationId = Userconfig::read('AssociationId');
22+
$api->secretaccessId = Userconfig::read('SecretAccessKey');
2923

30-
$response =$api->WhoAmI();
24+
// run a WhoAmI to establish a session
25+
$response =$api->WhoAmI();
3126

32-
if($response->aSuccess=='false')
27+
if($response->aSuccess=='false')
3328
{
3429
echo' Unable to login <br>'.$response->aErrors->bConciergeError->bMessage;
3530
die;
3631
}
3732

38-
// now, we want to create a new individual
39-
// First, we need to get a description of the individual
40-
// The description will tell the client SDK how to "build" the object; in other words, what the fields are
41-
// and what the default values are. So if you set a default value for LastName to 'Smith', the Describe
42-
// operation will have that in the metadata. When you construct the object, it will then have the last name
43-
// defaulted to 'Smith'
33+
// now, we want to create a new individual
34+
// First, we need to get a description of the individual
35+
// The description will tell the client SDK how to "build" the object; in other words, what the fields are
36+
// and what the default values are. So if you set a default value for LastName to 'Smith', the Describe
37+
// operation will have that in the metadata. When you construct the object, it will then have the last name
38+
// defaulted to 'Smith'
4439

45-
46-
$ObjectResponse =$api->DescribeObject($objectType ='Individual');
47-
48-
$meta =$ObjectResponse->aResultValue;
49-
50-
// now, create our MemberSuiteObject
51-
$metadata =newMembersuiteobjects();
52-
53-
54-
$mso =$metadata->FromClassMetadata($meta);
55-
56-
57-
/* it's always easier to use the typed MemberSuiteObject
58-
59-
* You could just instantiate this directly by saying:
60-
*
61-
* $person = new msIndividual();
62-
*
63-
* This would work - but without the class metadata, the object would not respect any of the defaults
64-
* that are set up. It would be a totally blank object.*/
65-
66-
$person =newConvertTomsIndividual($mso);
67-
68-
// Now Assign the value that you want to save
69-
70-
$person->FirstName ="Jitendra";
71-
72-
$person->LastName ="Kumar shukla";
73-
74-
$person->EmailAddress ="apitest@membersuite.com";
75-
76-
$person->DateOfBirth ="10/5/1989";
77-
78-
// Save Data Now
79-
$getsaveResult =$api->Save($person);
40+
$ObjectResponse =$api->DescribeObject($objectType ='Individual');
8041

81-
if($getsaveResult->aSuccess=='false')
82-
{
83-
echo"Unable to save".$getsaveResult->aErrors->bConciergeError->bMessage;
84-
die;
85-
}
42+
$meta =$ObjectResponse->aResultValue;
8643

87-
$newpersondetail =newConvertTomsIndividual($getsaveResult->aResultValue);
88-
89-
echo'Individual saved successfully .<br>';
90-
echo' LocalId'.$newpersondetail->LocalID.'<br> Name'.$newpersondetail->Name.' <br> Age'.$newpersondetail->Age;
44+
// now, create our MemberSuiteObject
45+
$mso =$api->FromClassMetadata($meta);
9146

47+
/* it's always easier to use the typed MemberSuiteObject
48+
* You could just instantiate this directly by saying:
49+
*
50+
* $person = new msIndividual();
51+
*
52+
* This would work - but without the class metadata, the object would not respect any of the defaults
53+
* that are set up. It would be a totally blank object.*/
9254

55+
$person =newmsIndividual($mso);
9356

57+
// Now Assign the data that you want to save
58+
$person->FirstName ="Jitendra";
59+
$person->LastName ="Kumar shukla";
60+
$person->EmailAddress ="apitest@membersuite.com";
61+
$person->DateOfBirth ="10/5/1989";
62+
$person->FavoriteColors__c =array('Red','Blue','NONE');
63+
64+
$address =newAddress();
65+
$address->Line1 ='123 Fake St.';
66+
$address->Line2 ='';
67+
$address->City ='Atlanta';
68+
$address->State ='GA';
69+
$address->PostalCode ='23456';
70+
$address->Country ='US';
71+
72+
$person->Home_Address =$address;
73+
74+
// Save Data Now
75+
$getsaveResult =$api->Save($person);
76+
if($getsaveResult->aSuccess=='false')
77+
{
78+
echo"Unable to save".$getsaveResult->aErrors->bConciergeError->bMessage.'<br>';
79+
die;
80+
}
81+
82+
$newpersondetail =newmsIndividual($getsaveResult->aResultValue);
83+
84+
echo'Individual saved successfully.<br>';
85+
echo' LocalId:'.$newpersondetail->LocalID.'<br> Name:'.$newpersondetail->Name.' <br> Age:'.$newpersondetail->Age.'<br>';
86+
87+
echo'Now run an update to it.<br>';
88+
$newpersondetail->DateOfBirth ="10/15/1989";
89+
$newpersondetail->FavoriteColors__c =array('Red','Green');
90+
91+
// Need to clear this out as it is currently improperly formatted
92+
$newpersondetail->Addresses ='';
93+
94+
$address =newAddress();
95+
$address->Line1 ='222 Fake St.';
96+
$address->Line2 ='';
97+
$address->City ='Atlanta';
98+
$address->State ='GA';
99+
$address->PostalCode ='90909';
100+
$address->Country ='US';
101+
102+
$newpersondetail->Home_Address =$address;
103+
104+
105+
// Save Data Now
106+
$getsaveResult =$api->Save($newpersondetail);
94107

108+
if($getsaveResult->aSuccess=='false')
109+
{
110+
echo"Unable to save".$getsaveResult->aErrors->bConciergeError->bMessage.'<br>';
111+
die;
112+
}
113+
114+
echo'Individual updated successfully.<br>';
115+
echo' LocalId:'.$newpersondetail->LocalID.'<br> Name:'.$newpersondetail->Name.' <br> Age:'.$newpersondetail->Age.'<br>';
95116
?>

‎APISample/SSOWithManualSOAPMessages/RedirectToPortal.php‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,16 @@
6262

6363
<form name="LoginForm" method="post" id="LoginForm" action="<?phpecho Userconfig::read('PortalUrl');?>Login.aspx">
6464
<input type="hidden" name="Token" id="Token" value="<?phpecho$securityToken;?>" />
65+
66+
<!--Once logged into Membersuite, jump to this URL-->
67+
<input type="hidden" name="NextUrl" id="NextUrl" />
68+
69+
<!--In the MemberSuite Portal header, provide a return link to a custom URL-->
6570
<input type="hidden" name="ReturnUrl" id="ReturnUrl" value="default.aspx" />
66-
<input type="hidden" name="NextUrl" id="NextUrl" value="" />
71+
<input type="hidden" name="ReturnText" id="ReturnText" />
72+
73+
<!--On logout from the MemberSuite Portal, redirect to this URL rather than the default login page-->
74+
<input type="hidden" name="LogoutUrl" id="LogoutUrl" />
6775
</form>
6876
<script>
6977
document.LoginForm.submit();

‎APISample/SSOWithSDK/RedirectToPortal.php‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
2-
session_start();
3-
ob_start();
2+
session_start();
3+
ob_start();
44

5-
include_once($_SERVER['DOCUMENT_ROOT'].'/APISample/phpsdk.phar');
5+
//include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/APISample/phpsdk.phar'); // Use PHAR Archive
6+
include_once($_SERVER['DOCUMENT_ROOT'].'/ms_sdk/src/MemberSuite.php');// Use the SRC Directory
67

78
include_once('./ConciergeApiHelper.php');
89

@@ -77,8 +78,16 @@
7778

7879
<form name="LoginForm" method="post" id="LoginForm" action="<?phpecho Userconfig::read('PortalUrl');?>Login.aspx">
7980
<input type="hidden" name="Token" id="Token" value="<?phpecho$securityToken;?>" />
81+
82+
<!--Once logged into Membersuite, jump to this URL-->
83+
<input type="hidden" name="NextUrl" id="NextUrl" />
84+
85+
<!--In the MemberSuite Portal header, provide a return link to a custom URL-->
8086
<input type="hidden" name="ReturnUrl" id="ReturnUrl" value="default.aspx" />
81-
<input type="hidden" name="NextUrl" id="NextUrl" value="" />
87+
<input type="hidden" name="ReturnText" id="ReturnText" />
88+
89+
<!--On logout from the MemberSuite Portal, redirect to this URL rather than the default login page-->
90+
<input type="hidden" name="LogoutUrl" id="LogoutUrl" />
8291
</form>
8392
<script>
8493
document.LoginForm.submit();

‎APISample/SSOWithSDK/index.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@
3535
</td>
3636

3737
</tr>
38-
</table>
39-
40-
41-
38+
</table>
4239
</form>
4340
</body>
4441
</html>

‎APISample/SSOWithWSDL/RedirectToPortal.php‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,16 @@
8080

8181
<form name="LoginForm" method="post" id="LoginForm" action="<?phpecho Userconfig::read('PortalUrl');?>Login.aspx">
8282
<input type="hidden" name="Token" id="Token" value="<?phpecho$securityToken;?>" />
83+
84+
<!--Once logged into Membersuite, jump to this URL-->
85+
<input type="hidden" name="NextUrl" id="NextUrl" />
86+
87+
<!--In the MemberSuite Portal header, provide a return link to a custom URL-->
8388
<input type="hidden" name="ReturnUrl" id="ReturnUrl" value="default.aspx" />
84-
<input type="hidden" name="NextUrl" id="NextUrl" value="" />
89+
<input type="hidden" name="ReturnText" id="ReturnText" />
90+
91+
<!--On logout from the MemberSuite Portal, redirect to this URL rather than the default login page-->
92+
<input type="hidden" name="LogoutUrl" id="LogoutUrl" />
8593
</form>
8694
<script>
8795
document.LoginForm.submit();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp