Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dqbilling-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DQ
dqbilling-api
Commits
f7015bf5
Commit
f7015bf5
authored
Mar 13, 2018
by
Ivan Belitskii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add profile access methods
parent
211e0863
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
src/DqBilling.php
src/DqBilling.php
+23
-15
No files found.
src/DqBilling.php
View file @
f7015bf5
...
...
@@ -19,21 +19,13 @@ class DqBilling extends \Staskjs\SimpleApi\SimpleJsonApi {
}
public
function
pay
(
array
$customerData
,
array
$paymentData
)
{
$customer
=
[
'id'
=>
$customerData
[
'id'
]
];
$payment
=
[
'card_identifier'
=>
$paymentData
[
'card_identifier'
],
'merchantSessionKey'
=>
$paymentData
[
'merchant_session_key'
],
'description'
=>
$paymentData
[
'payment_type'
],
'type'
=>
$paymentData
[
'payment_type'
],
'amount'
=>
$paymentData
[
'amount'
],
'currency'
=>
$paymentData
[
'currency'
],
'save_card'
=>
$paymentData
[
'save_data'
],
'applicationAlias'
=>
$paymentData
[
'application_alias'
]
];
$customer
=
array_only
(
$customerData
,
[
'id'
]);
$payment
=
array_only
(
$paymentData
,
[
'card_identifier'
,
'merchantSessionKey'
,
'description'
,
'type'
,
'amount'
,
'currency'
,
'save_card'
,
'applicationAlias'
,
]);
return
$this
->
request
(
'POST'
,
'pay'
,
[
'customer'
=>
$customer
,
'payment'
=>
$payment
,
...
...
@@ -43,4 +35,20 @@ class DqBilling extends \Staskjs\SimpleApi\SimpleJsonApi {
public
function
getPaymentSession
()
{
return
$this
->
request
(
'GET'
,
'payment_session'
);
}
public
function
getClientProfiles
(
$urn
)
{
return
$this
->
request
(
'GET'
,
'customers'
,
[
'urn'
=>
$urn
]);
}
public
function
getProfilePaymentCards
(
$customerId
)
{
return
$this
->
request
(
'GET'
,
"customers/
{
$customerId
}
/cards"
);
}
public
function
saveProfile
(
array
$profile
)
{
$profileData
=
array_only
(
$profile
,
[
'urn'
,
'first_name'
,
'last_name'
,
'address_1'
,
'address_2'
,
'country'
,
'city'
,
'postal_code'
,
'state'
,
'id'
]);
return
$this
->
request
(
'POST'
,
'customers'
,
$profileData
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment