Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Stripe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rich
Stripe
Commits
4a2267a1
Commit
4a2267a1
authored
7 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
State/County is not required by Stripe, so make it optional
parent
7eb10d53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/Payment/Stripe.php
+25
-0
25 additions, 0 deletions
CRM/Core/Payment/Stripe.php
with
25 additions
and
0 deletions
CRM/Core/Payment/Stripe.php
+
25
−
0
View file @
4a2267a1
...
@@ -304,6 +304,31 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
...
@@ -304,6 +304,31 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
);
);
}
}
/**
* Get form metadata for billing address fields.
*
* @param int $billingLocationID
*
* @return array
* Array of metadata for address fields.
*/
public
function
getBillingAddressFieldsMetadata
(
$billingLocationID
=
NULL
)
{
$metadata
=
parent
::
getBillingAddressFieldsMetadata
(
$billingLocationID
);
if
(
!
$billingLocationID
)
{
// Note that although the billing id is passed around the forms the idea that it would be anything other than
// the result of the function below doesn't seem to have eventuated.
// So taking this as a param is possibly something to be removed in favour of the standard default.
$billingLocationID
=
CRM_Core_BAO_LocationType
::
getBilling
();
}
// Stripe does not require the state/county field
if
(
!
empty
(
$metadata
[
"billing_state_province_id-
{
$billingLocationID
}
"
][
'is_required'
]))
{
$metadata
[
"billing_state_province_id-
{
$billingLocationID
}
"
][
'is_required'
]
=
FALSE
;
}
return
$metadata
;
}
/**
/**
* Implementation of hook_civicrm_buildForm().
* Implementation of hook_civicrm_buildForm().
*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment